Open fgnm opened 7 years ago
Hey maybe I'm near the solution but since I'm not so much familiar with your code there is still something I don't understand. I've changed this parameter useLowLatencyIfAvailable = true;
(default is false). Now the OnePlus 3 works with .flac file format without issue (at least for now), but on OnePlus One still return the same error on OMXCodec.cpp
So now I suppose that there is a problem while passing audio info between the player and flac decoder, in particular bitPerSample parameter.
I'll try to test this on more devices and see what's happens. Hope you can clarify my ideas :smiley:
Hi. Thanks for the issue report.
However, I cannot reproduce this on my setup. I guess this might be a specific FLAC files or specific devices issue, so could you upload your FLAC files which can reproduce it?
(NOTE: email me if files should not be available on public)
My test setup:
Okay so maybe you have right about device specific issue. Tested FLAC in 16, 24 bit PCM on a Galaxy Nexus running stock Android 4.3 and it works. Upgrade OnePlus 3 to Android 7.0 solve the issue once and for all, Galaxy S6 running Android 6.0.1 also no problem. So there must be something in the OnePlus One and in the older firmware of the 3 that makes crash with FLAC files. Anyway standard media player works always without issue, also PowerAmp and AIMP works always without issue (They have a 10 band equalizer so I suppose they use OpenSL too). So I'm wondering if there could be a workaround for this, maybe skip bitPerSample checks, because as I understand from CM source (https://github.com/CyanogenMod/android_frameworks_av/blob/cm-13.0/media/libstagefright/OMXCodec.cpp @ 4129) the problem is that 'nBitPerSample' param is always 0 whatever file I play. Or, if possible, include a FLAC decoder inside the library itself (I suspect that PowerAmp/AIMP works because this). Let me know what do you think.
Thanks for the investigation! It seems a device specific issue around FLAC format extractor.
So I'm wondering if there could be a workaround for this, maybe skip bitPerSample checks
I am not sure that we can workaround this by skipping nBitPerSample checks, because PowerAmp and AIMP do not use Android framework audio decoder for FLAC format (*).
Or, if possible, include a FLAC decoder inside the library itself
Yeah, this is the most reliable solution. However it requires lots of work to integrate with current implementation of this library...
Hello, I've noticed that FLAC file format cannot be played both with OpenSL and Hybrid Player. The issue can be easily reproduced with demo app too. The logcat rise the following exception (running OnePlus 3 stock ROM - Android 6.0):
Or this (running OnePlus One - CyanogenMod 13):
Standard Media Player works without problem. Is this a bug or FLAC are not supported? Thanks