anonymix007 / ExtA2DP

LSPosed module for adding A2DP codecs
GNU General Public License v3.0
55 stars 2 forks source link

Xiaomi 12x (psyche) Paranoid Android LHDC not working #9

Open Ilia-yash opened 8 months ago

Ilia-yash commented 8 months ago

Paranoid Android Topaz 13, CLO On MIUI it originally supported LHDC, earbuds support LHDC as well. But when LHDC is enabled, independently of bitrate or other parameters it doesn't work, there's no sound at all. LDAC seems to work fine if bitrate is selected manually. Screenshot_20231017-215709_Magic Screenshot_20231017-215602_Shell Screenshot_20231017-215621_Shell Screenshot_20231017-215641_ExtA2DP

anonymix007 commented 8 months ago

Provide logs.

Ilia-yash commented 8 months ago

I'm sorry for the dumb question, but what logs exactly? Where to get them? Here's the log folder from logs saved from LSposed https://dropmefiles.com/6nFLL

anonymix007 commented 8 months ago

https://github.com/anonymix007/ExtA2DP#logs

Ilia-yash commented 8 months ago

Here: https://file.io/YkW0IgQDGh8l

anonymix007 commented 8 months ago

Another broken Xiaomi device. On my phone both is_aidl_hal_available and is_qc_hal_available are 1, you seem to have only qc hal. Maintainer will have to fix it somehow.

anonymix007 commented 8 months ago

Can you run sudo getprop persist.bluetooth.bluetooth_audio_hal.disabled and post the output?

Ilia-yash commented 8 months ago

Sure! There's no output basically. Here: https://dropmefiles.com/B9IBV

anonymix007 commented 8 months ago

The issue is device-specific (more like vendor-specific). I haven't seen any instances of this happening on non-Xiaomi devices. It's probably related to the fact that Xiaomi did implement LHDC HW offload. I have a feeling that just enabling AIDL will help. Alternatively, you might try disabling A2DP Hardware Offload for now.

I don't know who's the maintainer, can they ping me in PA telegram group to discuss this?

Ilia-yash commented 8 months ago

Disabled hardware offload, now the music is playing on the device speakers 😅 Previously there was no sound at all. @mickaelmendes50 (same in Tg) is Xiaomi 12X maintainer. He also suggested to ping Jake in PA group about that.

anonymix007 commented 8 months ago

Run dumpsys media.audio_policy | awk ' /^ Config source: / { print $3 }' and upload this file and full path.

Ilia-yash commented 8 months ago

Here: https://dropmefiles.com/EO4dH Path: /vendor/etc/audio/audio_policy_configuration.xml

anonymix007 commented 8 months ago

Looks fine. Assuming you have Magisk companion module installed, it should be working almost fine (but switching between codecs needs to be done through LHDC, also aptX codecs will not work). Does LHDC present in module app? Does the line APM::HwModule: createDevice: could not find HW module for device 0080 address present in logcat?

Ilia-yash commented 8 months ago

I have audio_policy_changer_magisk.zip installed, do I need some additional module? LHDC is present in ExtA2DP

![Screenshot_20231018-214733_ExtA2DP](https://github.com/anonymix007/ExtA2DP/assets/54913721/d3735156-41a5-4791-b4b8-146454ea3cfb)

There's no such line in logcat. There are these lines: " APM::HwModule: createDevice: adding dynamic device AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET, @:SUPPRESSED to module primary

APM::HwModule: createDevice: adding dynamic device AUDIO_DEVICE_OUT_BLUETOOTH_SCO, @:SUPPRESSED to module primary " But if Hardware offload is disabled, the sound comes from speakers, and if it's enabled, there's no sound at all, silence.

anonymix007 commented 8 months ago

Have you tried LHDC V4? Currently you seem to be using LLAC, try changing bitrate to 500 or 900 for LHDC V4

Ilia-yash commented 8 months ago

Yeah, I have tried all bitrates and Sample Rates combinations, nothing helps. Seems like it's really broken somewhere I don't know where 😢