raspberry-vanilla / android_local_manifest

149 stars 58 forks source link

sampling rate is limited to 48 kHz #145

Closed chipdipru closed 3 weeks ago

chipdipru commented 1 month ago

Hi Konsta When playing audio through a DAC, the sampling rate is limited to 48 kHz. Is it possible to remove the limitation in Android?

KonstaT commented 1 month ago

Android audio HAL that is used with external GPIO audio DACs uses 48 kHz sampling rate. https://github.com/raspberry-vanilla/android_device_brcm_rpi5/blob/android-15.0/audio/audio_hw.c#L56

Primary output is also configured to use 48 kHz as there's different audio output devices/drivers to take into consideration (3.5mm jack, HDMI, DAC). https://github.com/raspberry-vanilla/android_device_brcm_rpi5/blob/android-15.0/audio/audio_policy_configuration.xml#L22-L26

You're welcome to investigate if you can adjust the sampling rate for your DAC hardware but I doubt it's something that can be merged here.

chipdipru commented 3 weeks ago

I definitely don't have the resources to automatically set the sampling rate for the GPIO DAC. Thousands of owners of similar DACs will be grateful to you if you can do this for us.

KonstaT commented 3 weeks ago

As mentioned, default configuration needs to support different audio output devices (3.5mm jack, HDMI, DAC).