badaix / snapdroid

Snapcast client for Android
GNU General Public License v3.0
124 stars 25 forks source link

24-Bit Stream Does Not Play #22

Closed jbfunk closed 4 years ago

jbfunk commented 4 years ago

Using a Pixel 3 running Android 10 and Snapdroid 0.17.1.2 (apk downloaded from the releases page), playback will not start with 24-bit streams. 16-bit streams (from the same server with the same number of channels and sampling rate) play fine.

badaix commented 4 years ago

Please try v0.17.1.3 The log tag for errors changed from Err to Error in latest Snapclient, and so Snapdroid didn't parse the error messages correctly. When using 24 bit on my phone, I now get the error message

Controller::onException: Init failed, operation: Engine::CreateAudioPlayer, result: SL_RESULT_CONTENT_UNSUPPORTED(9)

which simply means that the (24 bit) content is not supported by the DAC.

jbfunk commented 4 years ago

Thank you so much for so quickly following-up on this and releasing a fix. I now have the same error behavior as you describe.

Are there any plans to perhaps implement conversion of the bit depth down to 16 from 24 (or higher) on Android in the future (even if it's just truncation or rounding)? I know this is handled via, eg, ALSA on linux and not by Snapclient itself, but practically speaking I would like to be able to have just one higher bit-depth stream rather than both a 24-bit and 16-bit version.

Thanks again.

badaix commented 4 years ago

Actually, I'm planning to add resampling capabilities into the v0.19 (v0.18 is will be released soon). I've already a prototype using lobsoxr to resample the audio signal to the "native samplerate". Libsoxr can not only resample but can also requantize to 16 bit.

jbfunk commented 4 years ago

Thanks--looking forward to it. Nice to be using libsoxr also as it seems like it's a quite high quality resampler.