You are not logged in.
This is a situation that often occurs with my laptop; I've got multiple possible audio outputs and the system has defaulted to the laptop speaker.
I've got an HDMI output via the attached monitor, and a stereo is plugged into the monitor, that's my preferred choice.
I can switch the fallback in pavucontrol, no problem, but the keyboard volume controls remain controlling the laptop speaker output. I have to go into pavucontrol to change the volume to the HDMI output and it's associated stereo.
In this case it's happened from a power up.
I think if I log out and log back in again, I can get it to 'capture' the HDMI output first in terms of volume control of the keyboard controls, but that seems like a brute-force solution.
Is there a way to get not just pavucontrol to control the feedback, but somehow reset the volume control (not the keyboard shortcuts) so that the keyboard controls are focused on the right output?
(I have tried restarting xbindkeys)
Fortune favours the bold.
ThinkPad T15 Gen 2i
Offline
This might be a solution (the last comment): I'm going to keep exploring it but I'm not sure what keys to bind it to: xev isn't giving me a clear indication as to what the code is for the buttons being used in the keyboard volume controls.
https://forums.debian.net/viewtopic.php?t=126267
Last edited by JasonMehmel (2024-08-08 17:57:08)
Fortune favours the bold.
ThinkPad T15 Gen 2i
Offline
xev isn't giving me a clear indication as to what the code is for the buttons being used in the keyboard volume controls.
What is the output from xev?
You must unlearn what you have learned.
-- yoda
Offline
This is a situation that often occurs with my laptop; I've got multiple possible audio outputs and the system has defaulted to the laptop speaker.
I've got an HDMI output via the attached monitor, and a stereo is plugged into the monitor, that's my preferred choice.
I can switch the fallback in pavucontrol, no problem, but the keyboard volume controls remain controlling the laptop speaker output. I have to go into pavucontrol to change the volume to the HDMI output and it's associated stereo.
You can prioritize the sound device for pulseaudio.
Do a search along the lines of "prioritize sound device pulseaudio" and you'll get a bunch of hits like this - https://www.shallowsky.com/linux/pulsea … -line.html
I had a similar issue, and ended creating a file in /etc/modprobe.d, but that may be alsa specific.
You must unlearn what you have learned.
-- yoda
Offline
JasonMehmel wrote:xev isn't giving me a clear indication as to what the code is for the buttons being used in the keyboard volume controls.
What is the output from xev?
Here's the output!
FocusOut event, serial 49, synthetic NO, window 0x5800001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 49, synthetic NO, window 0x5800001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 49, synthetic NO, window 0x0,
keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Fortune favours the bold.
ThinkPad T15 Gen 2i
Offline
xbindkeys still running?
Disable it and check the output again. You may need to comment it out in the autostart then logout/login.
You must unlearn what you have learned.
-- yoda
Offline
Doing a bit of digging, I might be able to use XF86 listings to control the volume.
I found this in a reddit post: https://www.reddit.com/r/bspwm/comments … trol_keys/
XF86AudioLowerVolume
amixer set Master 5%-
XF86AudioRaiseVolume
amixer set Master 5%+
The amixer command is changing the Master volume, which is probably for the best anyway, that will manage whichever output is active.
Now, the amixer commands work at the terminal level, and if XF86AudioLowerVolume is recognized (it is recognized for the play/pause commands I've already got as keybinds) then maybe I can solve it that way, but it does make me wonder: am I also going to cause confusion in the channels?
The volume control IS working, it's just changing the wrong output channel.
So even if these work, I should probably then find a way to remove whatever connection is already being made with the volume controls? I'm thinking that even if I got these working for the volume control via amixer, it would ALSO be changing the volume for a specific channel.
Fortune favours the bold.
ThinkPad T15 Gen 2i
Offline
xbindkeys still running?
Disable it and check the output again. You may need to comment it out in the autostart then logout/login.
I did do a killall of kbindkeys, and got a similar output:
FocusOut event, serial 61, synthetic NO, window 0x5800001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 61, synthetic NO, window 0x5800001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 61, synthetic NO, window 0x0,
keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
I haven't tried commenting it out and then doing the logout-in, just because I'm also working, but I'll try that later if no other tweaking headway becomes apparent.
Fortune favours the bold.
ThinkPad T15 Gen 2i
Offline
I use the XF86 listing for my volume (and brightness) control. But xev shows those keys as XF86AudioRaiseVolme etc ...
You must unlearn what you have learned.
-- yoda
Offline
I just tried logging out and logging back in...
The output defaulted to the laptop speakers, but when I selected the HDMI output as fallback the output shifted there. Now the keyboard controls work! It's annoying that a logout was required, but there you go.
However, before rebooting I did add the following to my .xbindkeysrc
#volume
"amixer set Master 5%-"
XF86AudioLowerVolume
"amixer set Master 5%+"
XF86AudioRaiseVolume
And after the reboot I got an error window:
Could not grab the following HotKeys:
Mute/Unmute
Volume Up
Volume Down
I just commented out those listings in .xbindkeysrc, will try logging out and in again to see if it fixes itself!
Fortune favours the bold.
ThinkPad T15 Gen 2i
Offline
Commented out, no error now. Not sure what caused the slipped focus in the first place, or why XF86AudioRaiseVolume would cause any errors, as I've got XF86AudioPlay/Pause in my .xbindkeys already!
I also wonder if this is a ThinkPad problem? It came up a few times when I started googling for XF86AudioRaiseVolume problems.
Currently, I've got a brute-force solution but I'd love to figure out the scalpel solution!
Fortune favours the bold.
ThinkPad T15 Gen 2i
Offline
In case anyone comes across this thread: my current solution is to right click on the PNMixer Widget in the system tray, and click on the 'Reload Sound' option. That consistently shifts the volume control to whatever is the 'active' sound output, be that the laptop speakers, HDMI-connected speakers, or headphones.
Fortune favours the bold.
ThinkPad T15 Gen 2i
Offline