Help in creating a script that changes the target of the audio controller [LENOVO LAPTOP AUDIO CONTROLLER ISSUE] [SOLVED]

I have had a problem with my audio controller for about a month now(changes audio inconsistently, essentially an on and off switch), this seems to be a problem on all newer lenovo laptops as it uses a Dolby audio chipset that does not transfer well to linux drivers (I think).

No one yet has a solution. ( I looked through pipewire support and many have a similar problem to mine specifically on lenovo laptops, seems I can only fix this through a script. Some said it is a kernel issue.

I have gone through every non technical possible solution imaginable, cant list them all but I have messed with pavucontrol etc…

However… i noticed that when you modify the PCM directly on the card through alsamixer that it perfectly mimics the way an audio controller should behave.

Is there a way for me to write a script that directly targets that value of that PCM value to change audio volume by changing the pcm value rather than changing the master?

Im rather new to linux, using it only as a daily driver and only know the basics of using the console, so please explain to me where to look, or what part of the kernel should I edit it. Also apologies if I didn’t include any necessary info, as I am not sure what I should add in a thread like this one.

Thank you for any response!

It sounds like you are looking for the amixer command.

Excerpt:

amixer -c 1 set PCM 2dB+
will increase the PCM volume of the second card with 2dB. When both playback and capture volumes exist, this is applied to both volumes.

You might need to change -c 1 to a different number depending on the sound card you want to set the volume for (e.g. -c 0 would set the volume for the first sound card).

Use aplay -l to list your cards.

This is the solution! thank you so much,

binding these keys to f2 and f3 is a great fix that I can live with.

If anything I will probably leave it like this, since if I ever want to use bluetooth headphones it would mess with that.

You have no idea how many hours I spent on this thank you!

For anyone else with this issue, making a custom keyboard shortcut with these commands.

amixer -c 1 set PCM 2dB+
amixer -c 1 set PCM 2dB-

will give you a workable audio controller. Anyway, thanks again.