You are not logged in.
Pages: 1
So, I have a usb speaker on my desktop. I use it most of the time, but then when I plug in headphones, pulseaudio will not switch automatically. The switch on connect module is loaded, and I believe I know what the problem is, just not how to solve it. So, I can switch manually just fine using pulsemixer, but the problem lies in the fact that headphone are considered to be a port in the build in analogue output sink, while the speaker is its own sink entirely. Because the headphones do not make a new sink appear, and only connect a device to a port that is already present, pulseaudio keeps playing on the speaker when I plug in the headphones. I do not have the cord necessary to use the line out port like I really should, and that presents other problems that I don't want to deal with.
This makes the problem detecting when the headphones are plugged in, and then switching audio output to a different sink that is already present. Does anyone know how to do this?
Last edited by sirplatypus (2018-05-02 21:25:49)
Learning Dvorak was entirely worth it, solely because of the looks on people’s faces when they borrow my computers.
Offline
You can manually script this by reacting to the ACPI event your headphone jack generates, see this for some general pointer: https://bbs.archlinux.org/viewtopic.php … 4#p1646244
You don't want to simply switch the sourceport though, but move all the streams from pacmd list-sink-inputs output over to the correct sink. That shouldn't be too hard to find out though.
Offline
Thank you, I will try this. By any chance could you tell me how the automatic port switching is supposed to work usually? I haven't ever seen it work, and my hardware is about as generic as it gets.
Learning Dvorak was entirely worth it, solely because of the looks on people’s faces when they borrow my computers.
Offline
Port switching is sometimes a hit and miss depending on the general hardware. On my laptop at least it works alright. It might even work correctly on your system, however as you've already noticed port and sink switch aren't the same. If you had/have analog speakers as well, these should get muted on plugging in a analog headset (however the "muting" part usually comes from the driver, check
alsamixer -c$cardindex of your card from aplay -lfor an Auto-Mute control) and pulseaudio's port switch should switch to a new distinct master volume e.g. on my laptop, my speakers are muted nearly all the time because I don't want stuff to ding during a lecture, however if I plug in my headphones that gets automatically enabled to the last volume I had them on.
Offline
Pages: 1