Audio engine update (patch)

Forums:

I've been working on several optimalizations and fixes for MOC audio processing engine. I'm posting a patch against 2.5.0-beta1 version for anyone who would like to test/help/comment. The patch also includes some of "official" changes committed to SVN by JCF.

Changes:

  1. Support of more ALSA output sample formats. Until now MOC supported only S8,U8,S16,U16,FLOAT and S32,U32 (which were in fact 24bit data in 32bit samples). Now MOC supports also true S32 and U32, and 24-bit versions were renamed to S24,U24. Also S24_3 and U24_3 were added to support 24bit data in 3-byte samples (needed for exotic soundcards. please let me know if you need/use it).
  2. Added more detailed debug output of soundcard capabilities: Driver sfmt, Driver channels, Driver rate.
  3. Added config file option "MaskOutputFormats" to mask some output formats and removed "Allow24bitOutput". For example, to disable float, 24bit and 32bit formats set MaskOutputFormats = SFMT_FLOAT:SFMT_S32:SFMT_U32:SFMT_S24:SFMT_U24. Let me know if that it is useful to solve any problem.
  4. Added config file option "MaxChannels" to limit number of available channels.
  5. Added Dolby Prologic downmixing of 5.1 data down to 2.0. Support for more downmixing algorithms is possible in future.
  6. configure option --enable-internal-float which enables Vorbis float decoding which is the recommended way.
  7. Cleanup and removal of duplicate code, more debug messages in log.

The changes should be pretty transparent, only thing that needs to be changed is the removal of "Allow24bitOutput" option from config file.

Patch file: http://tomaszg.pl/moc/moc-2.5.0-beta1-sound.patch.gz (11kB)

Hey, this could be a possible fix for Debian #579828, isn't it?

Elimar

Impossible to determine from the data provided by reporter. MOC should play 24/96 files without this patch. I would have to look at least at moc_server_log to decide what the problem was. However my guess would be that ALSA/soundcard was misreporting soundformats which it can accept. Easy check would be to try different settings of Allow24bitOutput. Also it is possible that soundcard can't play 6 channels and that version of MOC couldn't downmix 6 channels to 2. In that case it should trigger: error ("Can't change number of channels (%d to %d)!", from->channels, to->channels);

I'll try producing multichannel 24/96 flac file and see if I can trigger some weird behaviour on 2.5.0-alpha4.