phhusson / treble_experimentations

Notes about tinkering with Android Project Treble
3.35k stars 658 forks source link

[enhancement] redmi note 9 pro sound playback #1573

Open 99degree opened 3 years ago

99degree commented 3 years ago

Hi there,

I got a distorted sound speaker problem and is more noticeable after update to latest miui-vendor and phh-quack v222, below is the detail and hope if on os layer can do something about it.

Situation 1 I owned a redmi note 9 pro and clean flashed latest V11.0.7.0.QJZMIXM (MIUI11), gets in miui and update again with same rom, and then flash aosp-quack v222 system.img and clear cache/clean all; boots up fine. when speaker playback with many yt video with a third party player, all clips with distorted sound.

Situation 2 Month ago, my redmi note 9 pro with older miui vendor V11.0.4.0 w/quack v222, same setup, same third party player, playback with small amount of clip have such said problem. This is happened with other devices (other yt audience playback same clip, same issue, and they put it at comment, but chrome browser do its job right),

Situation 3 Redmi note 9 pro earphone it not working, which I am not complaining at all, is expected. So no test result. I used other phone and this might also happened on my very owned LineageOS device, my own compiled kernel, happened too. And I knows that the kernel i had, do not set the speaker as mono in sound driver module, specifically in BACKEND_DAI settings. I used earphone and the issue did not happened, for same clip, same device.

Situation 4 When I plug in usb and connect "vendor V11.0.7.0 w/quack v222" to pc, there is a dialog popup ask for adb ssh key, the distort sound happened. on the contrast, i lock the phone, the playback is fine. that did not happened with older vendor blob.

So I believed there is some setting that related to mono/stereo audio does matter. I would like to ask if there is anything, in the android framework or around this sw layer, made with some change for it? If possible, fixing the earphone problem might be a nice alternative too.

I believe that might happened commonly in phone with single speaker. So please be noted.

Thanks in advance.

99degree commented 3 years ago

btw, I can mute the playback but the system event sound is still there, so i believe multimedia playback and system event sound are using different channel. so hope this clear up above mystery a bit.

99degree commented 3 years ago

have improved situation, by setting "misc feature"->"disable audio effect", the distorted sound syndrome is disappeared.

99degree commented 3 years ago

Ah, a nice findings from xda to fix earphone issue, mentioned by MerlinTop1 and credited to pvdeejay :

just download any terminal app on your phone and run the following: su setprop persist.sys.overlay.devinputjack true reboot

Tested/verified working.

https://forum.xda-developers.com/t/gsi-aosp-10-0-phh-treble-system-quack-arm64-a-b-redmi-note-9.4166641/#post-83568309

99degree commented 3 years ago

phhgsi_arm64_ab:/ $ getprop ro.hardware |grep -qiE -e qcom -e judyln -e judypn phhgsi_arm64_ab:/ $ phhgsi_arm64_ab:/ $ getprop ro.hardware |grep -e qcom -e judyln -e judypn qcom phhgsi_arm64_ab:/ $ phhgsi_arm64_ab:/ $ getprop ro.hardware |grep -q -e qcom -e judyln -e judypn phhgsi_arm64_ab:/ $ phhgsi_arm64_ab:/ $ getprop ro.hardware |grep -qi -e qcom -e judyln -e judypn phhgsi_arm64_ab:/ $ phhgsi_arm64_ab:/ $ getprop ro.hardware |grep -i -e qcom -e judyln -e judypn qcom phhgsi_arm64_ab:/ $ phhgsi_arm64_ab:/ $ getprop ro.hardware |grep -iE -e qcom -e judyln -e judypn qcom phhgsi_arm64_ab:/ $