sonyxperiadev / bug_tracker

Empty repository that is used as a bugtracker for Open Devices project
52 stars 13 forks source link

[4.14][10][YOSHINO][LILAC] No audio at all #564

Closed AlbertBackenhof closed 4 years ago

AlbertBackenhof commented 4 years ago

Platform: Yoshino Device: Lilac Kernel version: 4.14.172 Android version: 10 Software binaries version: v5a

Description Device is unable to play any type of audio. Nothing.

How to reproduce Build, flash and start Android 10 according to Xperia AOSP Guide.

dmesg_aosp10_no_audio.log logcat_aosp10_no_audio.log

This is basically the same as issue #556 but updated for latest vendor, device and more alarming title.

MarijnS95 commented 4 years ago

Duplicate of #556. Please don't recreate issues when debugging info is already available in the original, which is left out completely in your comment. Ask the author or someone with write access to update the title. Re "updated for device": your title mentions Lilac specifically, as if this issue is not present on Poplar anymore. At least mention both, or leave the device out entirely as this seems platform-wide.

Note that this is a kernel issue, software binaries will do nothing to fix this.

AlbertBackenhof commented 4 years ago

Yes of course. However, since there was no update on the other issue and since I am unable to confirm whether it is still the same issue and if it affects Poplar I didn't want to add information that could harm the investigation done by someone with more knowledge than myself.

If the info in this issue does not add any extra help I'll happily close it.

MarijnS95 commented 4 years ago

@AlbertBackenhof It is indeed the exact same issue.

I have a feeling missing audio has all to do with the failing WCD Codec probe:

[    2.701871] wcd-dsp-glink soc:qcom,wcd-dsp-glink: wdsp_register_rpmsg: channel name parse error -22
[    2.701975] wcd-dsp-glink soc:qcom,wcd-dsp-glink: wdsp_glink_probe: Failed to register with rpmsg, err = -22
[    2.702141] wcd-dsp-glink: probe of soc:qcom,wcd-dsp-glink failed with error -22

Looking into this the driver has been converted to rpmsg, but the glink channel names were never specified in the DT. Since I am no expert on any of these subsystems I'll get my guesses checked with someone who does. I wouldn't be surprised if the channels can be copied verbatim from other platforms, as these are available to msm8998.dtsi as well.

Would you mind applying https://github.com/MarijnS95/kernel/commit/bce4711f6487bcf64da40d3a60d402a6645d9f1e and testing whether that resolves the issue?

AlbertBackenhof commented 4 years ago

@MarijnS95 I've been trying today to build a new kernel with the patch you linked, but both the automatic and the manual way in the guide doesn't work for me. I've will try to look into it when I find the time.

MarijnS95 commented 4 years ago

@AlbertBackenhof The build guides there are outdated last I checked. The easiest is to navigate to kernel/sony/msm-4.14/kernel, cherry-pick my commit, then go into kernel/sony/msm-4.14/common-kernel, edit the build script to only build for your device (eg. add PLATFORM=yoshino and YOSHINO=lilac, then run ./build-kernel-clang.sh. That'll regenerate the prebuilts.

EDIT: The problem here is that AOSP is heavily cutting down on invocation of external tools (for the better: more reproducible builds, speed etc...) but does not easily allow us to rebuild the kernel with in the tree. @ix5 has been working on that but I don't know the status nor whether it remains compatible with Android 11. Manually rebuilding the "prebuilts" outside of the AOSP build system is the easiest to overcome this limitation.

AlbertBackenhof commented 4 years ago

@MarijnS95 thanks for the instructions. I believe I managed to compile a new kernel and just tried the new build on the device. Sadly the audio still doesn't work. I've included the logs. dmesg_aosp10_still_no_audio.log logcat_aosp10_still_no_audio.log

MarijnS95 commented 4 years ago

@AlbertBackenhof Great, the wcd-dsp-glink errors are gone, but the errors resulting from that:

[    5.895046] wcd-slim tasha-slim-pgd: wcd9335_bring_up: wcd9335 codec version is v2.0
[    5.895806] wcd-slim tasha-slim-pgd: wcd9335_get_cdc_info: wcd9xxx chip id major 0x107, minor 0x1
[    5.909900] tasha_codec tasha_codec: tasha_probe: Tasha driver probe done
[    5.910130] wcd-slim tavil-slim-pgd: msm_cdc_dt_parse_vreg_info: cdc-vdd-buck: vol=[1800000 1800000]uV, curr=[650000]uA, ond 0
[    5.910137] wcd-slim tavil-slim-pgd: msm_cdc_dt_parse_vreg_info: cdc-buck-sido: vol=[1800000 1800000]uV, curr=[250000]uA, ond 0
[    5.910142] wcd-slim tavil-slim-pgd: msm_cdc_dt_parse_vreg_info: cdc-vdd-tx-h: vol=[1800000 1800000]uV, curr=[25000]uA, ond 0
[    5.910148] wcd-slim tavil-slim-pgd: msm_cdc_dt_parse_vreg_info: cdc-vdd-rx-h: vol=[1800000 1800000]uV, curr=[25000]uA, ond 0
[    5.910154] wcd-slim tavil-slim-pgd: msm_cdc_dt_parse_vreg_info: cdc-vddpx-1: vol=[1800000 1800000]uV, curr=[10000]uA, ond 0
[    5.910186] wcd-slim tavil-slim-pgd: wcd9xxx_slim_probe: probing for wcd type: 4, name: tavil-slim-pgd
[    5.911073] swr-wcd tasha_swr_ctrl: swrm_get_logical_dev_num: device 0x20170211 is not ready
[    5.911182] swr_get_logical_dev_num: Error -22 to get logical addr for device 20170211
[    5.912664] wsa881x: probe of wsa881x.20170211 failed with error -22
[    5.919202] swr-wcd tasha_swr_ctrl: swrm_get_logical_dev_num: device 0x20170212 is not ready
[    5.919307] swr_get_logical_dev_num: Error -22 to get logical addr for device 20170212
[    5.919565] wsa881x: probe of wsa881x.20170212 failed with error -22

Have been replaced with different trouble:

[   18.795780] wcd-slim tasha-slim-pgd: wcd9335_bring_up: wcd9335 codec version is v2.0
[   18.820684] wcd-slim tasha-slim-pgd: wcd9335_get_cdc_info: wcd9xxx chip id major 0x107, minor 0x1
[   18.925439] wcd-slim tasha-slim-pgd: tasha_probe: clk get wcd_ext_clk failed
[   18.949506] Q6 Core is not ready, delaying WCD probe
[   19.351120] q6core_audio soc:qcom,msm-audio-apr:q6core: Q6 Core driver is up
[   19.362283] wcd-slim tavil-slim-pgd: msm_cdc_dt_parse_vreg_info: cdc-vdd-buck: vol=[1800000 1800000]uV, curr=[650000]uA, ond 0
[   19.372208] wcd-slim tavil-slim-pgd: msm_cdc_dt_parse_vreg_info: cdc-buck-sido: vol=[1800000 1800000]uV, curr=[250000]uA, ond 0
[   19.374531] wcd-slim tavil-slim-pgd: msm_cdc_dt_parse_vreg_info: cdc-vdd-tx-h: vol=[1800000 1800000]uV, curr=[25000]uA, ond 0
[   19.376228] wcd-slim tavil-slim-pgd: msm_cdc_dt_parse_vreg_info: cdc-vdd-rx-h: vol=[1800000 1800000]uV, curr=[25000]uA, ond 0
[   19.389456] wcd-slim tavil-slim-pgd: msm_cdc_dt_parse_vreg_info: cdc-vddpx-1: vol=[1800000 1800000]uV, curr=[10000]uA, ond 0
[   19.392394] wcd-slim tavil-slim-pgd: wcd9xxx_slim_probe: probing for wcd type: 4, name: tavil-slim-pgd
[   19.416786] iommu: Adding device soc:qcom,msm-audio-apr:qcom,msm-audio-ion to group 26
[   19.420248] msm-audio-ion soc:qcom,msm-audio-apr:qcom,msm-audio-ion: msm_audio_ion_probe: qcom,smmu-sid-mask missing in DT node, using default
[   19.422169] msm_audio_ion sid bit is 0x1
[   19.531878] wcd-slim tavil-slim-pgd: wcd9xxx_slim_probe: failed to get slimbus tavil-slim-pgd logical address: -6

Tasha randomly started missing a clock: tasha_probe: clk get wcd_ext_clk failed. This was fine in previous logs. Did anything else change in the tree? I doubt the wcd-dsp-glink probe caused a clk_get to fail, but we have no way to be sure. Let's print the failure reason: https://github.com/MarijnS95/kernel-techpack-audio/commit/b512bda336e0e36250b33ad24e6417a7454669d4 (Note: this goes in techpack/audio within the kernel folder). We'll chase what is up with tavil after. EDIT: Apparently Tavil is unused on Yoshino but the node is never explicitly disabled. I'm consulting why...

AlbertBackenhof commented 4 years ago

@MarijnS95 well I did repo sync before building again. I have not done that this time and after adding the additional log it says: [ 6.365823] wcd-slim tasha-slim-pgd: tasha_probe: clk get wcd_ext_clk failed -517

dmesg_aosp10_extra_log.log logcat_aosp10_extra_log.log

MarijnS95 commented 4 years ago

@AlbertBackenhof Great, a probe deferral (means the clock is not ready/available yet). Which is interesting given that the clock was available in the first example at about 5 seconds, but not at 19 seconds in the second one.

I have been told that there are mindbending, broken dependencies in the audio driver and that all our devices operate on some sort of race condition to get the audio system up.

The weird thing here is that no error is ever returned by the driver (see return ret; in the error codepath, with int ret = 0; at the top). If the deferral is returned instead, the probe fails but will be retried at a later time. Apply the reworked commit https://github.com/MarijnS95/kernel-techpack-audio/commit/35127ccf493a8d7fd624774f32edb98052fccb41 to do so. I doubt this fixes anything though, the clock likely never comes up.

AlbertBackenhof commented 4 years ago

@MarijnS95 you were right it didn't fix it :P dmesg_aosp10_no_audio.log logcat_aosp10_no_audio.log

AlbertBackenhof commented 4 years ago

But I'm not sure, I don't see the "tasha_probe: clk get wcd_ext_clk failed" anymore. No audio though.

MarijnS95 commented 4 years ago

@AlbertBackenhof Looks like it decided to probe "early" again at 6s instead of 18, with the clock not lost yet. I guess/hope this was a fluke, let's go after the swrm trouble first.

kholk commented 4 years ago

Audio issues on Yoshino are solved with the latest kernel, I've tested it on Yoshino Maple.

Please report back.

stefanhh0 commented 4 years ago

Confirming that audio works now, verified on:

Platform: Yoshino Device: Lilac Kernel version: 4.14.176-g1fa7ff7f9100:

Android version: android-10.0.0_r36 Software binaries version: SW_binaries_for_Xperia_Android_10.0.7.1_r1_v6_yoshino.img Version baseband: 1307-7511_47.2.A.11.228 Build: aosp_g8441-userdebug 10 QQ2A.200501.001.B3 eng.stefan.20200510.170705

@AlbertBackenhof @jerpelea One of you please close the issue.