Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ucm2: HDA: Use Master volume control for dual speakers #410

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tuxedoxt
Copy link

This PR extends the existing 'activate Bass Speaker' case with additional configuration

  • Use Master mixer for volume control (instead of only using Speaker)
  • Configure Speaker Volume and Bass Speaker volume to max since Master volume regulation is used

It fixes a case where only the first speaker volume is changed using the system volume control.

This patch extends the existing 'activate Bass Speaker' case
with additional configuration

- Use Master mixer for volume control
- Configure Speaker Volume and Bass Speaker volume to max since
  Master volume regulation is used

This fixes a case where only the first speaker volume is changed
using the system volume control.

Signed-off-by: Christoffer Sandberg <[email protected]>
@tuxedoxt
Copy link
Author

Alternative solution suggestions are also appreciated.

@tuxedoxt
Copy link
Author

Bump, is it feasible to get this included or is an alternative way preferred?

@GERJanB
Copy link

GERJanB commented Sep 16, 2024

Is there any update on this when this will be merged?

@Prunkles
Copy link

Prunkles commented Oct 7, 2024

This does not work on my Tuxedo Sirius 16 Gen1 under NixOS. I applied this patch using the ALSA_CONFIG_UCM2 environment variable like described here (and have a patched kernel with this) but with the patch from this PR sound just disappears entirely.
If there is anything I can provide for troubleshooting, I will do so.

@tuxedoxt
Copy link
Author

tuxedoxt commented Oct 8, 2024

@Prunkles

This does not work on my Tuxedo Sirius 16 Gen1 under NixOS. I applied this patch using the ALSA_CONFIG_UCM2 environment variable like described here (and have a patched kernel with this) but with the patch from this PR sound just disappears entirely. If there is anything I can provide for troubleshooting, I will do so.

  1. Check that alsamixer provides two volume knobs, that is "Bass speakers" in addition to the normal speakers entry for codec "Conexant CX11970" (probably alsamixer -c 2), and that the volume knobs regulate the sound of the individual speakers.
  2. Providing the speaker knobs are there and works, this PR means to set both at max, and using the system volume control should regulate the master volume knob seen in alsamixer while the two speaker knobs stay at max.

If (1) doesn't work the kernel patch did not apply. If (2) doesn't work this ucm2 config change didn't apply.

@perexg
Copy link
Member

perexg commented Oct 8, 2024

Could you both attach output from amixer -c sofhdadsp contents command? If this command does not work, replace sofhdadsp string with card number. Thanks.

@tuxedoxt
Copy link
Author

tuxedoxt commented Oct 8, 2024

Could you both attach output from amixer -c sofhdadsp contents command? If this command does not work, replace sofhdadsp string with card number. Thanks.

Here's from the devices of the original issue. Both use same card and double speaker pairs (sides+top speaker combo in a laptop for context).

amixer-contents-sirius-gen1.txt
amixer-contents-sirius-gen2.txt

@Prunkles
Copy link

Prunkles commented Oct 8, 2024

@perexg
I actually didn't mention that there is no sound anyway on system startup, until I restart wireplumber and pipewire.

Without this patch, right after the system is started (no sound): amixer_no-ucm-patch_pre-pw-retart.out.txt
Without this patch, after pipewire/wireplumber are restarted (is sound): amixer_no-ucm-patch_post-pw-restart.out.txt
With this patch, right after the system is started (no sound): amixer_ucm-patch_pre-pw-restart.out.txt
With this patch, after pipewire/wireplumber are restarted (no sound) (the output is the same by the way): amixer_ucm-patch_post-pw-retart.out.txt

So I guess it may be a pipewire/wireplumber issue, but I am not sure how to deal with it either

@Prunkles
Copy link

Prunkles commented Oct 8, 2024

@Prunkles

This does not work on my Tuxedo Sirius 16 Gen1 under NixOS. I applied this patch using the ALSA_CONFIG_UCM2 environment variable like described here (and have a patched kernel with this) but with the patch from this PR sound just disappears entirely. If there is anything I can provide for troubleshooting, I will do so.

1. Check that alsamixer provides two volume knobs, that is "Bass speakers" in addition to the normal speakers entry for codec "Conexant CX11970" (probably `alsamixer -c 2`), and that the volume knobs regulate the sound of the individual speakers.

2. Providing the speaker knobs are there and works, this PR means to set both at max, and using the system volume control should regulate the master volume knob seen in alsamixer while the two speaker knobs stay at max.

If (1) doesn't work the kernel patch did not apply. If (2) doesn't work this ucm2 config change didn't apply.

There is the "Bass speakers" knob: with or without this PR, 100%-ed, but it doesn't do anything.

@tuxedoxt
Copy link
Author

tuxedoxt commented Oct 8, 2024

There is the "Bass speakers" knob: with or without this PR, 100%-ed, but it doesn't do anything.

For you it sounds like there's a problem unrelated to this PR then to solve first. To debug. Be sure to turn the other speaker off to hear any difference with the "bass speaker" knob. And of course make sure that it's not muted.

@Prunkles
Copy link

@tuxedoxt

For you it sounds like there's a problem unrelated to this PR then to solve first. To debug. Be sure to turn the other speaker off to hear any difference with the "bass speaker" knob. And of course make sure that it's not muted.

Ooh I see. I didn't know you can mute stuff in alsamixer. It solves the entire system mute, but "Bass speakers" still doesn't affect anything

The thing is, I actually once managed to make bass speakers work a long time ago, when I installed the patched tuxedo kernel. And I was able to change volumes of bass and side speakers separately in alsamixer, but when I changed the master knob the other two were changing in a strange manner, so I guess this PR is addressed to exactly this issue.
But when I once tried to plug in and then out headphones, bass speakers stopped to work, and even reboot didn't help. I'm still trying to understand why it stopped working entirely, but I think this is beyond the scope of this PR

@perexg
Copy link
Member

perexg commented Oct 14, 2024

Those controls exist in all alsa-info dumps:

numid=3,iface=MIXER,name='Speaker Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=74,step=0
  : values=74,74
  | dBscale-min=-74.00dB,step=1.00dB,mute=0
numid=5,iface=MIXER,name='Bass Speaker Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=74,step=0
  : values=74,74
  | dBscale-min=-74.00dB,step=1.00dB,mute=0

I don't like the master volume misuse solution because it may affect also different use-cases (like separate output from Headphones) in future. The goal may be to create a "virtual" control using alsa-lib which maps the Speaker Volume to Bass Speaker Volume. The question is if 1:1 mapping is sufficient to make the implementation easier for the first code shot. Is 1:1 mapping okay or we need to deal with a more complex mapping (level shifting etc.)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants