Open whatamesss opened 3 months ago
more info....i was able to find libsnapclient.so in my android device...and run it manually with the format 96000/24/* it only outputs noise.
and i can confirm that snapclient on linux connects to my snapserver and recognizes/correctly plays the format 96000/24/2
it seems there's a problem with the android client
here is the shell output from running it manually on android 12. again, the audio output is just noise.
/libsnapclient.so -h io -p 1704 --hostID 0e2bcfe3-5d26-477d-a516-a3f035b0cb88 --player oboe --sampleformat 96000:24: --logfilter :info,Stats:debug <
2024-06-25 09-41-39.896 [Info] (Snapclient) Version 0.28.0
2024-06-25 09-41-39.897 [Info] (Connection) Resolving host IP for: io
2024-06-25 09-41-39.905 [Info] (Connection) Connecting to 10.10.10.10:1704
2024-06-25 09-41-39.917 [Notice] (Connection) Connected to 10.10.10.10
2024-06-25 09-41-39.918 [Info] (Connection) My MAC: "c4:4e:ac:e6:95:e4", socket: 7
2024-06-25 09-41-39.927 [Info] (Controller) ServerSettings - buffer: 750, latency: 0, volume: 100, muted: 0
2024-06-25 09-41-39.932 [Info] (Controller) Codec: flac, sampleformat: 96000:24:2
2024-06-25 09-41-39.933 [Info] (Player) Player name: oboe, device: default, description:
found more options to the client...but they dont seem to be working
(set mixer none and sharing mode exclusive) result=noise "OboePlayer) DefaultStreamValues::SampleRate: 48000"=wrong
bcfe3-5d26-477d-a516-a3f035b0cb88 --player oboe --mixer none --sharingmode exclusive --sampleformat 96000:24: --logfilter :info,Stats:debug <
2024-06-25 09-55-00.004 [Info] (Snapclient) Version 0.28.0
2024-06-25 09-55-00.005 [Info] (Connection) Resolving host IP for: io
2024-06-25 09-55-00.017 [Info] (Connection) Connecting to 10.10.10.10:1704
2024-06-25 09-55-00.025 [Notice] (Connection) Connected to 10.10.10.10
2024-06-25 09-55-00.025 [Info] (Connection) My MAC: "c4:4e:ac:e6:95:e4", socket: 7
2024-06-25 09-55-00.036 [Info] (Controller) ServerSettings - buffer: 750, latency: 0, volume: 100, muted: 0
2024-06-25 09-55-00.041 [Info] (Controller) Codec: flac, sampleformat: 96000:24:2
2024-06-25 09-55-00.041 [Info] (Player) Player name: oboe, device: default, description:
using --player opensl (much prefered!) result=snapclient fails
bcfe3-5d26-477d-a516-a3f035b0cb88 --player opensl --mixer none --sharingmode exclusive --sampleformat 96000:24: --logfilter :info,Stats:debug <
2024-06-25 09-55-17.005 [Info] (Snapclient) Version 0.28.0
2024-06-25 09-55-17.006 [Info] (Connection) Resolving host IP for: io
2024-06-25 09-55-17.020 [Info] (Connection) Connecting to 10.10.10.10:1704
2024-06-25 09-55-17.025 [Notice] (Connection) Connected to 10.10.10.10
2024-06-25 09-55-17.026 [Info] (Connection) My MAC: "c4:4e:ac:e6:95:e4", socket: 7
2024-06-25 09-55-17.029 [Info] (Controller) ServerSettings - buffer: 750, latency: 0, volume: 100, muted: 0
2024-06-25 09-55-17.029 [Info] (Controller) Codec: flac, sampleformat: 96000:24:2
2024-06-25 09-55-17.030 [Info] (Player) Player name: opensl, device: default, description:
This code snipped looks suspicious (client/player/oboe_player.cpp):
auto result = builder.setSharingMode(sharing_mode)
->setPerformanceMode(oboe::PerformanceMode::None)
->setChannelCount(stream_->getFormat().channels())
->setSampleRate(stream_->getFormat().rate())
->setFormat(oboe::AudioFormat::I16)
->setDataCallback(this)
->setErrorCallback(this)
->setDirection(oboe::Direction::Output)
//->setFramesPerCallback((8 * stream->getFormat().rate) / 1000)
//->setFramesPerCallback(2 * oboe::DefaultStreamValues::FramesPerBurst)
//->setFramesPerCallback(960) // 2*192)
->openStream(out_stream_);
It seems to set the bit depth to 16 bit: setFormat(oboe::AudioFormat::I16)
i do believe you've identified the 16-bit issue....i'd love to submit a PR but unfortunately i'm not a coder....is it something you can fix?
Hello again Johannes, i see you may have a fix in your development branch ...any chance of a release soon? i'm forced to use http streaming for the meantime with poweramp...(because i am testing some hi-res dacs)
cheers
I don't know yet when I will do the next release, but you can install the build artifact: https://github.com/badaix/snapdroid/actions/runs/9731928937
Snapdroid and Snapcast will now support 16, 24 and 32 bit audio, but will use the sample rate, given by AudioManager::PROPERTY_OUTPUT_SAMPLE_RATE, as documented here: https://developer.android.com/reference/android/media/AudioManager.html#PROPERTY_OUTPUT_SAMPLE_RATE and here: https://google.github.io/oboe/classoboe_1_1_default_stream_values.html
I've also tested to query the "native" sample rate of the device with getHardwareSampleRate, which returns the same sample rate as the audio manager. There is also a setting in Oboe, which sample rate quality to apply for internal resampling. Since this internal resampling will have impact on the latency estimation, Snapcast will continue doing the resampling into the native hardware rate, so that Oboe must not apply further resampling.
i'm unable to run the server now (linux) which i build from your master..it gives a floating point exception
Master is 1.5 years old, try develop, which is the default branch
hello! love snapcast! my mpd server and snapserver are both running on linux with format 9600:24:2 (tried 32-bit as well) the problem is, on android, the snapclient is not playing with the right format. where is the the config for the client?
from my process list: libsnapclient.so -h io -p 1704 --hostID 0e2bcfe3-5d26-477d-a516-a3f035b0cb88 --player oboe --sampleformat 96000:16: --logfilter :info,Stats:debug
in the pursuit of bit-perfect audio, i've tried several android devices and some do have crippled audio engines (typcally 24/48) but not the one i'm using in this case. i read that snapclient uses oboe and open sl/es as a backend but using poweramp i was able to see that it had acutally selected the audiotrack backend. i have changed this (using poweramp) to open sl/es with float capability and the audio chain seems to respect 24/96 all the way through now...however the snapcast client still doesnt respect 24-bit or 32-bit float audio.
this is a bug! please help!
as a feature request i'd also love to see snapserver respect whatever source format is preseneted by mpd. mpd as the ability to set the format as ::* which would completely disable resampling (exactaly what i'm looking for) but unfortunately snapserver does not accept this as a format setting...
(edit to mention that i'm using an external dac via usb) best j