Bluetooth headphones: Is it possible for audio output to switch automatically on connection?  [Solved]

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
User avatar
CharlesV
Administrator
Posts: 8101
Joined: Sun Jul 07, 2019 5:11 pm

Re: Bluetooth headphones: Is it possible for audio output to switch automatically on connection?

#11 Post by CharlesV »

@davemx I requested this mod for future updates / versions and dolphin_oracle mentioned this...
to survive updates, probably put a copy of that .conf file under /etc/pipewire or ~/.config/pipewire.
You might want to make this adjustment.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

davemx
Posts: 320
Joined: Sun Aug 12, 2018 2:31 pm

Re: Bluetooth headphones: Is it possible for audio output to switch automatically on connection?

#12 Post by davemx »

In my current setup, the automatic change to Bluetooth sound output doesn't work any more, it's back to having to do it manually from the Volume control icon in the system tray. One little thing though, and I'm not sure whether this is a relevant change or whether I didn't notice it last time. But the section of the file pipewire-pulse.conf which contains the line that should ensure the switch is automatic, is now headed context.exec and not content.exec ???
Desktop: Mini-Box M350 with Asus H110i-plus motherboard, Pentium G4600 processor, 2TB SSD and 16Gb RAM DDR4-2133
Printer/Scanner: Brother MFC-J5335W
Laptop: Lenovo V15 ADA
Media Centre: Lenovo Q190

User avatar
CharlesV
Administrator
Posts: 8101
Joined: Sun Jul 07, 2019 5:11 pm

Re: Bluetooth headphones: Is it possible for audio output to switch automatically on connection?

#13 Post by CharlesV »

davemx wrote: Wed Jan 17, 2024 5:35 pm In my current setup, the automatic change to Bluetooth sound output doesn't work any more, it's back to having to do it manually from the Volume control icon in the system tray. One little thing though, and I'm not sure whether this is a relevant change or whether I didn't notice it last time. But the section of the file pipewire-pulse.conf which contains the line that should ensure the switch is automatic, is now headed context.exec and not content.exec ???
oh oh.

Yes, mine says:

Code: Select all

context.exec = [
{ path = "pactl" args = "load-module module-switch-on-connect" }
    #{ path = "pactl"        args = "load-module module-always-sink" }
    #{ path = "pactl"        args = "upload-sample my-sample.wav my-sample" }
    #{ path = "/usr/bin/sh"  args = "~/.config/pipewire/default.pw" }
]
I did move mine to the following file so it doesnt get overwritten by updates:

Code: Select all

~/.config/pipewire/pipewire-pulse.conf

*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

davemx
Posts: 320
Joined: Sun Aug 12, 2018 2:31 pm

Re: Bluetooth headphones: Is it possible for audio output to switch automatically on connection?

#14 Post by davemx »

Now that is the strangest thing. I've changed nothing since I wrote yesterday, there have been no updates, and now it's working!!

I'm a bit nervous about copying the file to /etc/pipewire/ or ~/.config/pipewire/ because if another, necessary, change was made to the file at /usr/share/pipewire it might prevent that change being effective.
Desktop: Mini-Box M350 with Asus H110i-plus motherboard, Pentium G4600 processor, 2TB SSD and 16Gb RAM DDR4-2133
Printer/Scanner: Brother MFC-J5335W
Laptop: Lenovo V15 ADA
Media Centre: Lenovo Q190

User avatar
CharlesV
Administrator
Posts: 8101
Joined: Sun Jul 07, 2019 5:11 pm

Re: Bluetooth headphones: Is it possible for audio output to switch automatically on connection?

#15 Post by CharlesV »

davemx wrote: Thu Jan 18, 2024 12:07 pm Now that is the strangest thing. I've changed nothing since I wrote yesterday, there have been no updates, and now it's working!!

I'm a bit nervous about copying the file to /etc/pipewire/ or ~/.config/pipewire/ because if another, necessary, change was made to the file at /usr/share/pipewire it might prevent that change being effective.
Yeah, that is always my concern too. As for working / not working.. all I can say is that I have found pipewire to be in some ways better than pulse... and in some ways pulse is better. Flaky are both at times - at least on my machines, with pulse seeming to be less flaky for me (on mx21 !)

However, I am right now trying to record some old tapes off of cassette and have found that on four machines, ( 2 mx21 and 2 mx 23 machines) I cannot get stable recording - however, one machine running mx23 it works perfectly. ( well... almost perfectly. I cannot hear what i am recording and have to do it blind and then go back and edit. ) And all three of my MX 23 machines are *the same load* too.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

davemx
Posts: 320
Joined: Sun Aug 12, 2018 2:31 pm

Re: Bluetooth headphones: Is it possible for audio output to switch automatically on connection?

#16 Post by davemx »

CharlesV wrote: Thu Jan 18, 2024 12:45 pm
Yeah, that is always my concern too. As for working / not working.. all I can say is that I have found pipewire to be in some ways better than pulse... and in some ways pulse is better. Flaky are both at times - at least on my machines, with pulse seeming to be less flaky for me (on mx21 !)

However, I am right now trying to record some old tapes off of cassette and have found that on four machines, ( 2 mx21 and 2 mx 23 machines) I cannot get stable recording - however, one machine running mx23 it works perfectly. ( well... almost perfectly. I cannot hear what i am recording and have to do it blind and then go back and edit. ) And all three of my MX 23 machines are *the same load* too.
Now it's not automatically switching! Very strange!
Desktop: Mini-Box M350 with Asus H110i-plus motherboard, Pentium G4600 processor, 2TB SSD and 16Gb RAM DDR4-2133
Printer/Scanner: Brother MFC-J5335W
Laptop: Lenovo V15 ADA
Media Centre: Lenovo Q190

Post Reply

Return to “MX Help”