HydrogenAudio

Hosted Forums => foobar2000 => foobar2000 mobile => Topic started by: phunkydizco on 2021-03-30 09:37:57

Title: Android audio processing
Post by: phunkydizco on 2021-03-30 09:37:57
I have a general question about the Android app.

How exactly does the audio processing work here?
How are audio files handled that have a higher or lower sampling rate than the device supports?
Is resampling used internally?
Is there an advantage to enable the setting "Use OpenSL audio output"?
Title: Re: Android audio processing
Post by: phunkydizco on 2021-04-14 09:48:59
It would be really great if the developer or support could answer this. Even if you don't know how the sound is generated at all and in the source code only some ominous Android libraries are used, I would appreciate the answer.

Reading through this forum, I almost think the mobile version was thrown together by an external developer and now nobody understands the source code and there is no support anymore.
Title: Re: Android audio processing
Post by: Qboy61 on 2021-04-29 15:09:30
Looks like it is upon the user to maintain the samplerate of the resampler to match the samplerate of your phone or computer.  It would be nice if there was a selection to make the resampler always track the sound card's samplerate.  If the resampler is correctly selected the frequency response is excellent as in the picture "noise_Foobar2k_wResampler_96k24b-file_44.1k24b-sys".
Title: Re: Android audio processing
Post by: Qboy61 on 2021-04-29 15:12:29
If the samplerate is misaligned either up or down relative to the file being played you get the response like this picture "noise_Foobar2k_96k24b-file_44.1k24b-sys" only good to about 16kHz.  While most people won't hear the difference, some decent speakers will sound somewhat dull in bells or cymbals when the response is rolled off.
Title: Re: Android audio processing
Post by: Qboy61 on 2021-04-29 15:15:34
Oh.  This works also when upconverting 44.1kHz files to 96kHz samplerate.  Mismatch in this direction does the same if you don't set the resampler to match the cound card's samplerate.
Title: Re: Android audio processing
Post by: phunkydizco on 2021-04-29 15:39:52
Thank you for your detailed information. The problem is that it's not clear which samplerate is really used by the device. An overview  what's going on inside the app would be really nice.
Title: Re: Android audio processing
Post by: Qboy61 on 2021-04-30 06:16:24
Hopefully one of the developers can shed some light on the internals of foobar2k.

Just as a test...  I tested my Samsung S9plus with foobar2k but turned off the re-sampler (no DSP functions within foobar2k).  Using my PC and a EVGA sound card set to 96kHz sample rate I sent the headphone output of my S9+ to the line input of the sound card.  I this case the 96kb sample rate will not digitally interact with the phone's sample rate.  Running the sound card at 96kb will give me the ability to judge the frequency response out to about 45kHz.  Looks like the Android phone is running at a sample rate of 96kHz or above and the built-in re-samplers do an excellent job with the three files I tested with, 44.1k, 48k and 96kHz sample rates.  Or...  The Android phone is setting the audio sample rate to match the file sample rate which would also give the same results and would not require a re-sampler (probably more power efficient also).  I also tested my Android file manager's simple audio player and it gave identical results to foobar2k.