aarch64-laptops / build

Build an Linux OS based image
221 stars 47 forks source link

yoga c630 5.17-rc3 kills sound #77

Open bm16ton opened 2 years ago

bm16ton commented 2 years ago

5.17-rc3 would alternate between card not being brought up ot being brought up and simply not working, i restored sound/soc/codecs sound/soc/qcom/qdsp6/q6apm-dai.c sound/soc/soc-ops.c sound/soc/soc-pcm.c to the rc2 versions recompiled and all worked again. I guess rc's dont have changelog so no easy way to let the dev know, ill google for it and hopefully email the dev and let them know

rigoorozco commented 2 years ago

Hi bm16ton, which version of alsa-ucm-conf are you on? I can't get sound to work with either 5.17rc5 or rolling back the files you listed.

I'm trying to use this version (1.2.6.3 at time of this post): https://salsa.debian.org/steev/alsa-ucm-conf

bm16ton commented 2 years ago

Hello, so i recently did a new install and discovered i needed newer ucm files.and in the end i believe i grabbed them from one of these https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/C630 https://git.linaro.org/people/srinivas.kandagatla/alsa-ucm-conf.git

Changes have been made seperating parts of the sound system i believe it seperated speakers from output jack and the new ucm was needed. Will also.need newer version of alsa lib depending on distro, IE ubuntu 20.04 required alsa updates compiled/installed manually. You will notice these files work but the volume bar in sound settings will list.like the first quarter inch as "unamplified" and this is the only part of the bar you can use anything above that over amps distorts and potentially damages things, also all sound seems to work accept the speaker test. Lol i know ironic. Also helpful hint the minimum volume is loud.on.newer kernels butnlower on older IE 5.12. If u have any further issues just ask, im.not very talented or knowledgable but i will try my best to help. Oh almost forgot On 5.17rc5 if i dont revert sound files itll work mostly.but if i pull volume bar all the way to lowest it kills sound and never comes back same for mute, so if i boot muted shell never work. That may have been my issue with rc3 i havent checked.

rigoorozco commented 2 years ago

Its kinda coming back to me. I think I had the first one you linked working on ubuntu 20.04 and had the same behavior you're describing.I've since switched over to Debian 11 (bullseye) which should actually match (ucm 1.2.4). So maybe I should try it again.

I guess there's a few things that go into this: kernel/dts, UCM configs, and the alsa/libsound2 version installed on your distro

bm16ton commented 2 years ago

heres my complete /usr/share/alsa folder https://github.com/bm16ton/yoga-c630-linux-kernel/tree/master/tools/16ton also that repo has my current kernel source. Unfortunately until the dpu encoder issue is fixed im stuck backk on 5.12. oh and libasound2 is version 1.2.6.1-1

rigoorozco commented 2 years ago

I upgraded my libasound2 to 1.2.6.1-2 (-1 wasn't available) and tried your ucm2 folder.

I'm getting this error when running "sudo alsactl init": alsa-lib main.c:761:(execute_sequence) unable to execute cset 'name='RX1 Digital Volume' 80'

I comment it out it in ucm2/codecs/wcd934x/init.conf and it proceeds to the next. Does this for RX2, RX7 and RX8. But I can only get headphones to work.

I looked through the &sound node in your dts and I think we've got the same thing

bm16ton commented 2 years ago

sorry never got an emall that responded. hrm ok next i guess ill post a copy of my /var/lib/alsa/asound.state wich has been a constant issue for sound in the past on my machine.

https://github.com/bm16ton/yoga-c630-linux-kernel/blob/master/tools/16ton/asound.state

itwill be over written at shutdown and possibly boot so id just sudo chattr +i /var/lib/alsa/alsa.state to stop it

bm16ton commented 2 years ago

also i believe the .jsn files that became a firmware requirement was for the sound (its been a while so could be remembering incorrectly). Do you have those? also i have the following firmware files included in my ram fs. qcom/LENOVO/81JL/qcdxkmsuc850.mbn qcom/LENOVO/81JL/qcdsp1v2850.mbn qcom/LENOVO/81JL/qcdsp2850.mbn qcom/LENOVO/81JL/qccdsp850.mbn qcom/LENOVO/81JL/qcadsp850.mbn

Just a possible helpful hint. Order of opperations during boot and timing are unbelievably critical on these machines not uncommon for changing a module to built-in or vice versa has fixed major issues in the past. For sound ty rebooting on each attempt not shutdown, so if something got enabled late it may stay enabled thru a reboot, Once you get sound working save he good workiing copy of /var/lib/alsa/asound.state and use sudo chattr +i if it gets replaced with a bad one over and over.

bm16ton commented 2 years ago

crap i also forgot out of 3 yogas all bough together all same specs one had a different sound card. it would show a diffname for the card (newer kernels mask this) and it required diff ucm files and hacks to work. The biggest hack was sound wouldnt work unless i switched the volume control from speakers to headphones once on headphones I would hafta do one of the following 2 things 1 play sound or 2 change volume, then switch back to speakers. If anythingtries to use the speakers before performing these steps sound would not work that boot. I ended up scripting the process. Directions are in the readme on git https://github.com/bm16ton/yoga-c630-linux-kernel . I have that yoga packed away sumwhere I have not tried the newer ucm files etc on it.But will look for it if you continue to have issues

rigoorozco commented 2 years ago

I upgraded to Debian Bookwork and the audio worked on the first boot, then stopped working on subsequent boots. Now, if I reinstall the alsa-ucm-conf package I get the same behavior. Though the configs that come alsa-ucm-conf 1.2.6.3-1 don't detect the headphone jack.

On boots when it does work alsactl says this (doing 'sudo alsactl init'): alsa-lib ucm_include.c:147:(compound_merge) compound type expected for the merged block alsa-lib parser.c:1737:(parse_verb_file) error: /Qualcomm/sdm845/HiFi-MM1.conf failed to parse device alsa-lib main.c:1412:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -22 Found hardware: "sdm845" "" "" "" "" Hardware is initialized using a generic method

I tried using the 'sudo chattr +i' command but I couldn't get it to work following a reboot.

As far as the firmware files go, I have all those listed included and the following jsn files: adspr.jsn, adspua.jsn, cdspr.jsn modemuw.jsn

Which module do you think is different? The WCD9341 or the WSA8815s?

bm16ton commented 2 years ago

ok im uploading the firmware i use to my repo now in case sum diference exists. I know sum firmware IE venus is signed for our devices specifically but dont think any are individual machine specific. heres the url; https://github.com/bm16ton/yoga-c630-linux-kernel/blob/master/tools/16ton/qcom-firmware.zip hopefully its useful. It working until reboot I wonder if between the time u run chattr and when the soundcard initialized the asound state file was changed, in essence keeping a bad copy. I know that same problem had come down to that file in the past. I do have that oddball c630 which required diff ucm files and hacks. Ill look for it today but its running older ucm files and required a lot of hacks to work. If sound works on a boot, can you disable any and all sounds that may play during login etc (so nothing gets sent to soundcard during boot/login) then switch the output from speakers to headphones and then either play a sound or adjust volume then switch back to speakers does it work? Do you notice a dramatic system speed decrease on boot where sound doesnt work nbut did on previous boot? On my oddball even tho I dont believe it would say so anywhere it was actually set for headphone jack out bu everything/where says speakers, switching to headphones playing sound/adjust volume then switching back would bring everything into alignment and work, but I recall the gui would run extremely slow (NO idea how thats related) until the hack had finished, so scripting it during boot/login was the only good option. Hrm maybe i should also postmy asound.state from a good boot for you to try. ok put it into the tools folder. https://github.com/bm16ton/yoga-c630-linux-kernel/tree/master/tools/16ton Hopefully these files shed some sorta light. Any alsa libs etc outside the usr/share/alsa folder I could share?

bm16ton commented 2 years ago

If non of these things help im curious what my kernel with my config would do. All else fails worth a try. Speaking of configs the kernel driver for sdm845 sound thats name is like lppsa or lpp(blah) you def DONT want enabled. I see patches have been added so machine wont crash if it accidently gets enabled but still issues. And who kernel/patchsets are you using? I would highly suggest steeves, he works closely with the devs, knows his stuff and coincidentally the only person who has been kind enuff to waiste time helping this old fool. Great guy heres his kernel source too (check branches) https://github.com/steev/linux/