alsa-project / alsa-lib

The Advanced Linux Sound Architecture (ALSA) - library
GNU Lesser General Public License v2.1
344 stars 173 forks source link

Speaker volume control doesn't work by default on Lenovo Yoga 7 (AMD 7840hs) #366

Closed smaug---- closed 5 months ago

smaug---- commented 7 months ago

(Not sure which alsa-repo is the correct one for this issue, or is this perhaps a Fedora issue) By default controlling headphone output volume works, but speaker output seems to be either muted or very loud.

The following tweak fixes the issue.

+++ /usr/share/alsa-card-profile/mixer/paths/analog-output-speaker.conf 2023-11-14 02:45:24.182339962 +0200 @@ -79,8 +79,6 @@ override-map.2 = all-left,all-right

[Element Master] -switch = mute -volume = merge override-map.1 = all override-map.2 = all-left,all-right

@@ -243,4 +241,8 @@ override-map.1 = all-center override-map.2 = all-center,lfe

+[Element Master] +switch = mute +volume = ignore + .include analog-output.conf.common

Gpinchon commented 7 months ago

Same here, adding these lines to the conf fix the issue but they're erased on every updates of alsa, pretty annoying. My model is : Lenovo Yoga Pro 7 14APH8 82Y8, here is the result of aplay --list-devices

**** Liste des périphériques matériels PLAYBACK ****
carte 0 : Generic [HD-Audio Generic], périphérique 3 : HDMI 0 [HDMI 0]
  Sous-périphériques : 1/1
  Sous-périphérique #0 : subdevice #0
carte 0 : Generic [HD-Audio Generic], périphérique 7 : HDMI 1 [HDMI 1]
  Sous-périphériques : 1/1
  Sous-périphérique #0 : subdevice #0
carte 1 : Generic_1 [HD-Audio Generic], périphérique 0 : ALC287 Analog [ALC287 Analog]
  Sous-périphériques : 1/1
  Sous-périphérique #0 : subdevice #0
Gpinchon commented 7 months ago

Omg, the latest update fucked up the volume again, this really needs to be addressed. The solution proposed by @smaug---- doesn't work for me, what works is

it should looke like something like this, for me EVERY UPDATE removes the Element Master part :

[Element Master]
switch = mute
volume = ignore

[Element PCM]
switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
AboveYou commented 6 months ago

Got the same problem and fixed it myself by automating the process, check it out here. @Gpinchon

I might submit a pull-request later.

then4p commented 6 months ago

I'm not quite sure if this is due to the kernel, but on 6.6 and 6.7 I don't need the fix anymore, also the tweeters work as well! Sadly, this breaks headphones. They're completely silent and have to be turned up in alsamixer.

Also mic volume with a headset connected controls mic boost instead of mic volume...

Is there an easy way to fix these paths, is it just an incorrect pinout? I found the HDA Analyzer but it's built for python 2 and I haven't set that up atm.

smaug---- commented 6 months ago

Yeah, the headphones issue is why I need to stay on kernel 6.6.6. I think 6.6.7 broke it, but I haven't had time to investigate which change exactly.

then4p commented 6 months ago

It's fixable on those newer kernels. After you've connected headphones, just go into alsamixer and up the volume for the 'rear speaker'. Afterwards you can control the headphone volume normally. If you disconnect and reconnect the headphones it's busted again.

I really want to know where these connections are stored, but I haven't had any luck in the documentation so far and there's too many conf files in /usr/share/alsa-card-profile/mixer/paths

Also, interesting that something is happening between kernel 6.5 and 6.6. I found a parallel issue in another repo: https://github.com/tomsom/yoga-linux/issues/3

smaug---- commented 6 months ago

Unfortunately I don't see anything for "rear speaker" in alsamixer.

soyersoyer commented 5 months ago

6.6.7 has this patch: https://patchwork.kernel.org/project/alsa-devel/patch/20231207182035.30248-1-tiwai@suse.de/

The ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN added with this patch: https://www.spinics.net/lists/alsa-devel/msg145801.html

perexg commented 5 months ago

This issue is not related to alsa-lib. Use the kernel discussion mailing list - linux-sound@vger.kernel.org - for the further discussion.

infoat commented 2 months ago

The workaround from Gpinchon works for my Lenovo Slim Pro 7 (14APH8) https://github.com/alsa-project/alsa-lib/issues/366#issuecomment-1832668734 - for me headphones in alsamixer show up as 'bass speaker.'