Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New audio_policy_configuration.xml disables HD sound output #171

Open
Flamefire opened this issue Dec 14, 2021 · 1 comment
Open

New audio_policy_configuration.xml disables HD sound output #171

Flamefire opened this issue Dec 14, 2021 · 1 comment

Comments

@Flamefire
Copy link

Flamefire commented Dec 14, 2021

The issue is likely introduced by this commit: de349af

Prior to the XML config files the audio_policy.conf on e.g. lilac included for example this:

      direct_pcm {
        sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000|64000|88200|96000|176400|192000|352800|384000
        channel_masks AUDIO_CHANNEL_OUT_MONO|AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_2POINT1|AUDIO_CHANNEL_OUT_QUAD|AUDIO_CHANNEL_OUT_PENTA|AUDIO_CHANNEL_OUT_5POINT1|AUDIO_CHANNEL_OUT_6POINT1|AUDIO_CHANNEL_OUT_7POINT1
        formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT|AUDIO_FORMAT_PCM_32_BIT
        devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_PROXY|AUDIO_DEVICE_OUT_USB_DEVICE|AUDIO_DEVICE_OUT_USB_HEADSET|AUDIO_DEVICE_OUT_BLUETOOTH_A2DP|AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES|AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER
        flags AUDIO_OUTPUT_FLAG_DIRECT
      }

I.e. using AUDIO_OUTPUT_FLAG_DIRECT basically any sample rate and format is possible for pretty much any output.

Now (with the above commit) we have a mixport with name="direct_pcm" for this flag which is via <routes> connected to pretty much all outputs. So far so good.

However now e.g. for the "Wired headset" output we only have a single profile: 48kHz@16Bit de349af#diff-ca13afe69a6d9ad751f1375d1dd1a847c892ea76ca115b8a1370dcfc83b671a9R177-R181

This means when selecting a matching profile the only available one for this source-sink-combination will be chosen: 48kHz@16Bit

I assume by leaving the <devicePort> empty ANY profile was acceptable for this sink. This is now no longer the case.

This means newer devices using that new XML configuration will have degraded features.

I'd try to remove those profiles from the sinks or is there a reason for them?

Edit: Not so sure anymore. Issue seems to be related to the accessibility config "Mono-Audio" which effectively redirects "DIRECT" output to "DEEPBUFFER" output, see e.g. https://github.com/LineageOS/android_vendor_qcom_opensource_audio/blob/343077c4a5393459bc6b4a5fbccdeb0b33b6e5d4/policy_hal/AudioPolicyManager.cpp#L1727-L1731

Can anyone knowledgeable comment on whether my assumption from above is correct or not?

I assume by leaving the <devicePort> empty ANY profile was acceptable for this sink.

@QGB
Copy link

QGB commented Sep 26, 2022

brw-------  1 root   root   179,  7 Apr  5  1970 mmcblk0p7
brw-------  1 root   root   179,  8 Apr  5  1970 mmcblk0p8
brw-------  1 root   root   179,  9 Apr  5  1970 mmcblk0p9
brw-------  1 root   root   179, 32 Apr  5  1970 mmcblk0rpmb
drwxr-xr-x  3 root   root        60 Apr  5  1970 platform
brw-------  1 root   root     1,  0 Apr  5  1970 ram0
brw-------  1 root   root     1,  1 Apr  5  1970 ram1
brw-------  1 root   root     1, 10 Apr  5  1970 ram10
brw-------  1 root   root     1, 11 Apr  5  1970 ram11
brw-------  1 root   root     1, 12 Apr  5  1970 ram12
brw-------  1 root   root     1, 13 Apr  5  1970 ram13
brw-------  1 root   root     1, 14 Apr  5  1970 ram14
brw-------  1 root   root     1, 15 Apr  5  1970 ram15
brw-------  1 root   root     1,  2 Apr  5  1970 ram2
brw-------  1 root   root     1,  3 Apr  5  1970 ram3
brw-------  1 root   root     1,  4 Apr  5  1970 ram4
brw-------  1 root   root     1,  5 Apr  5  1970 ram5
brw-------  1 root   root     1,  6 Apr  5  1970 ram6
brw-------  1 root   root     1,  7 Apr  5  1970 ram7
brw-------  1 root   root     1,  8 Apr  5  1970 ram8
brw-------  1 root   root     1,  9 Apr  5  1970 ram9
drwx------  2 root   root        40 Apr  5  1970 vold
brw-------  1 root   root   254,  0 Apr  5  1970 zram0
/data/data/com.termux/files/home # dd if=/dev/block/bootdevice/by-name/boot of=/sdcard/boot.img
65536+0 records in
65536+0 records out
33554432 bytes (34 MB, 32 MiB) copied, 0.510163 s, 65.8 MB/s
/data/data/com.termux/files/home # find /dev/ -name boot
/dev/block/platform/soc.0/f9824900.sdhci/by-name/boot
/data/data/com.termux/files/home # dd if=/dev/block/platform/soc.0/f9824900.sdhci/by-name/boot of=/sdcard/f9824900.sdhci=boot.img
65536+0 records in
65536+0 records out
33554432 bytes (34 MB, 32 MiB) copied, 0.505882 s, 66.3 MB/s
/data/data/com.termux/files/home # md5sum /sdcard/f9824900.sdhci=boot.img /sdcard/boot.img 
e1f12dc3822aa409a4d9622f355f24c4  /sdcard/f9824900.sdhci=boot.img
e1f12dc3822aa409a4d9622f355f24c4  /sdcard/boot.img
/data/data/com.termux/files/home # 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants