0

I posted a similar question earlier, but Kamil Maciorowski correctly & wisely pointed out that, as posted, it wasn't really the single problem it appeared to be, but an amalgam of 3. So I deleted the broken system and the question. I'm starting over with a fresh installation of Lubuntu, the current one. Out of the box, if I turn on bluetooth headphones sound plays through them and not the internal speakers. If I turn the headphones off, sound automatically plays through the speakers.

What I would prefer is to never have any sound sent to the speakers unless I explicitly direct the output of a specific command to them. Like, pseudocode: aplay /path/fire-alarm.wav -o speakers and have all other sounds played through the headphones if available, & otherwise simply not played at all.

If there is no direct provision for this sort of policy, I wonder if there is some way to trick the system into seeing /dev/null as an always-working & always-available audio sink that is second in line after the headphones and ahead of the internal speakers. That, in conjunction with a 'play this sound through the speakers' command should do it.

If neither of these is possible, commands to disable and enable the speakers without affecting headphone function & without re-logging would serve the purpose almost as well, provided something in the byzantine linux sound architecture doesn't spontaneously decide "Oh, your speakers are turned off, I'll fix that for you."

This is not the same as simply saying the bluetooth headphones should be the default. That is the way it is now. If I watch "Debbie Does Dubai" & the headphones get out of range, or run out of juice, or I just fumble finger them off trying to adjust their physical position, I don't want the sound to automatically shift to start coming out of the speakers.

What I'm after is a policy that sends nothing to the speakers unless I explicitly tell it to send a particular stream there, and then sends only that, or failing that, a scriptable way to disable and enable speakers without re-logging.

0

PULSE_SINK=<sink_name> someprogram

You can get a list of the available "sink_name"s from:

LANG=C pactl list | grep -A2 'Sink #' | grep Name: | cut -d" " -f2
| improve this answer | |
  • Great. Meanwhile, I found commands to mute and unmute just the speakers: pactl set-sink-mute 0 1 & pactl set-sink-mute 0 0. I'll mute them in a start up script & in the script I want to play thru spkrs, I'll unmute, use your command, and remute. Not exactly what I was looking for, but near enough. In my actual use case the difference will rarely matter. Thanks. – palidin Apr 16 '18 at 6:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.