Author Topic: Automatic Headphone Audio Switching?  (Read 1613 times)

teh.sean

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • http://
Automatic Headphone Audio Switching?
« on: September 25, 2018, 11:51:14 pm »
Does anybody have automatic headphone audio switching working under the Planet Computers provided Debian TP2 environment?

I can switch audio manually using the 'PulseAudio Volume Control' application (pavucontrol?), but I've yet to find a way to set PulseAudio to automatically switch output from the built in speakers to headphones when I plug into the 3.5mm audio jack.

Thanks!

ArchiMark

  • Administrator
  • Hero Member
  • *****
  • Posts: 1799
    • View Profile
Automatic Headphone Audio Switching?
« Reply #1 on: September 26, 2018, 12:54:17 am »
Hey there, teh.sean....

Ol' ArchiMark here....been awhile...

Glad to see you took the plunge and got a Gemini...

Sorry, but haven't tried headphones yet....if I do, I'll report back...

Mark
Silicon Valley Digerati - * Please see my Mini Laptops For Sale Listing *
Cosmo Communicator / One-Netbook One Mix Yoga 3S (Win 10/Manjaro 18)
Banana Pi Zero UMPC/Armbian
MacBookPro
Sold: C3200/N900/OQO/N5/Dell Mini9/Netwalker/UMID M1/

teh.sean

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • http://
Automatic Headphone Audio Switching?
« Reply #2 on: September 26, 2018, 07:57:30 am »
Yo! Long time no see! Yeah, I've been lurking for a while after getting the Gemini. How are you doing?

So far the Gemini is pretty nice; I'm waiting for a keymat replacement to come in the mail (I have the dreaded floppy keys issue).

ArchiMark

  • Administrator
  • Hero Member
  • *****
  • Posts: 1799
    • View Profile
Automatic Headphone Audio Switching?
« Reply #3 on: September 26, 2018, 09:07:37 am »
Doin' OK....but been crazy busy at work the past 3 months, as I was asked by my boss to take on the same job temporarily at another location about 20 miles away on top of my current job. And then two weeks after I started doing that, one of the team members left, so, I had to pick up his work temporarily......but other than that......

Main point is I haven't had much time to play with Gemini as I had expected.

As a pocketable device, it's pretty cool. Although linux on it, is still a work in progress....

Sorry to hear you have the keyboard issue, but hopefully, that will be resolved soon for you.

Best,

Mark
Silicon Valley Digerati - * Please see my Mini Laptops For Sale Listing *
Cosmo Communicator / One-Netbook One Mix Yoga 3S (Win 10/Manjaro 18)
Banana Pi Zero UMPC/Armbian
MacBookPro
Sold: C3200/N900/OQO/N5/Dell Mini9/Netwalker/UMID M1/

Mithren Ithil

  • Newbie
  • *
  • Posts: 13
    • View Profile
Automatic Headphone Audio Switching?
« Reply #4 on: September 27, 2018, 08:00:31 am »
I don't have Debs on my Gemini, but if it is PulseAudio switching outputs on connect you can try on the command line (as your session user):

pacmd load-module module-switch-on-connect

If that works then to make it load on boot hunt down the default.pa, normally at:

/etc/pulse/default.pa

and add:

load-module module-switch-on-connect

Also check if you have a user specific one:

~/.config/pulse/default.pa
« Last Edit: September 27, 2018, 08:04:38 am by Mithren Ithil »

teh.sean

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • http://
Automatic Headphone Audio Switching?
« Reply #5 on: September 28, 2018, 07:59:54 am »
Thanks for the information!

I was able to load the module using pacmd, confirmed with pactl list, but no luck. I also rebooted and added it to the default pulseaudio configuration and had the same result; sound comes out of both the headphones and the speaker, and listing the sink / source info after plugging in headphones shows no change.

My next step is to confirm that the headphone jack actually sends an event to the pulseaudio server. I'm guessing that would be some sort of ACPI event, but I'm not sure. (Further research necessary!)

Quote from: Mithren Ithil
I don't have Debs on my Gemini, but if it is PulseAudio switching outputs on connect you can try on the command line (as your session user):

pacmd load-module module-switch-on-connect

If that works then to make it load on boot hunt down the default.pa, normally at:

/etc/pulse/default.pa

and add:

load-module module-switch-on-connect

Also check if you have a user specific one:

~/.config/pulse/default.pa

Mithren Ithil

  • Newbie
  • *
  • Posts: 13
    • View Profile
Automatic Headphone Audio Switching?
« Reply #6 on: September 28, 2018, 09:57:31 am »
Hmm thinking about it, is the speakers and headphone jack treated as a single output device with 2 ports?

I believe that the module-switch-on-connect will switch when another output device connects, you will need this to auto switch for a bluetooth headset (which is what I use it for).

If it is a single device with 2 ports then you might need:

module-switch-on-port-available

You can check if its already loaded with:

pacmd list-modules | grep switch

It was already part of my default.pa on Debian 9 on my lappy.

### EDIT

I had a quick Google and someone suggested checking that Auto-Mute is enabled in alsamixer:

https://askubuntu.com/questions/150887/soun...es-and-speakers

Open Terminal (Ctrl+Alt+T)
Type: alsamixer and press Enter/Return
Select the correct sound device by pressing F6
Navigate to the right with → (Right Arrow key) until you highlight Auto-Mute
Press ↑ (Up Arrow key) and select Enabled (or Line Out)
Press Esc to exit
« Last Edit: September 28, 2018, 10:15:43 am by Mithren Ithil »