MOC freeze after pause using ogg 24 bit


How to get MOC freeze:
- use 24 bit hardware
- play a ogg file
- pause playing (with Space)
- change file and start playing (with Enter)
- there is a high chance that MOC freezes

You can do the same without a freeze, if you one of this:
- use 16 bit hardware
- use wav files
- change to a file (with Enter) without pressing pause before

It causes a total freeze of MOC. There is no error message.
Tested version: 2.5.0 (final) and 2.6-alpha1

To clarify: are the ogg files 24 bit as well? What bitrate? I assume also that you have Allow24BitOutput set in config file? Also output of mocp -D might be helpful to try and duplicate the issue.

I just tried and I can't reproduce it. Vorbis decoder in MOC (as I understand - it is the way Vorbis works - unless you want float) produces only 16-bit audio. Does your card support _only_ 24-bit output?

I have an experimental patch for MOC which enables float decoding in Vorbis and Opus, you can try to play with it if you wish:

tomaszg thanks for your help!
The ogg files are 16 bit, the hardware is AudioBox 22 VSL.

Test with patched 2.5.0-beta1:
I tried with and without Allow24BitOutput: freeze
with "MaskOutputFormats = SFMT_FLOAT:SFMT_S32:SFMT_U32:SFMT_S24:SFMT_U24": also freeze

Test with 2.6-alpha1:
Yes, I use Allow24BitOutput. Without that "FATAL_ERROR: Can't receive value from the server!"
So I think it supports 24 bit only.

Here are the log files (2.6-alpha1):
Playing "Battery", pause, change to "Whiplash" and MOC freezes.

Yep, it's 24-bit only:

audio.c:941 print_output_capabilities(): Sound driver capabilities: channels 2 - 2, formats: 24-bit signed (as 32-bit samples) little-endian (native)

I tried emulating 24-bit only hardware using MaskOutputFormats = FLOAT:S32:U32:U24:S16:U16:S8:U8:S24_3:U24_3, even converted some of my Metallica to OGG, but still couldn't hang current version of MOC. However when I downgraded to patched version of MOC-2.5.0-beta1, I suddenly succeeded. So, I suspect you were affected by some bug already resolved in svn. Could you try upgrading your version to current development code?

BTW. Your "patched 2.5.0-beta1" results got me thinking - the freeze with MaskOutputFormats was of a different kind. It was caused by you masking all available formats (SFMT_S24 being the only one). MOC probably hang right after you started the first track. I think there should be a check in a code if there are any formats available.

Correction to the "BTW" part. Your MaskOutputFormats was ignored, I mixed-up a bit in description of my patch. Values should be eg. S32, not SFMT_S32...

Still the same problem with revision 2771.

What I did:
I checked out trunk from svn, copied from 2.5.0, renamed to and executed to get "configure".
Then executed ./configure, make, sudo make install

I discovered why I didn't catch it earlier. My patch optionally enables float decoding for vorbis and in that case the freeze disappears. I don't know why yet, but using --enable-internal-float configure option (on patched MOC) seems to solve the issue.

If you wish, you can try more current version of my patch (against current rev 2771) . However it adds even more experimental features, e.g. logarithmic volume setting, lyrics fixes.

Thanks for the help, but still doesn't work, same freeze.
I executed ./configure --enable-internal-float and compiled.
Test with patched rev2771 (and patched 2.5.0-beta1).
Log files:

Ah, sorry. Made mistake in patch file and internal-float didn't work (I disabled it while looking for the problem). Please redownload the patch.

It works!
"--enable-internal-float" is the solution.
Thanks a lot for the help, very appreciated!
Will be great to see the fix in upcoming releases.
I'll do some more stress tests next days and let you know the result.

Wouldn't say it is a solution. I think it is only a coincidence that my patches fixed that. I still think that we need a proper fix, but that's beyond me :)

Yeah works, no more freezes.

I have committed tomaszg's format and channels checking patch as a partial fix as r2772.