Command to play sound through speakers when headphones on ?

Forum rules
Before you post please read how to get help
User avatar
MrEen
Level 13
Level 13
Posts: 4978
Joined: Mon Jun 12, 2017 8:39 pm

Re: Command to play sound through speakers when headphones on ?

Post by MrEen » Tue Mar 26, 2019 9:21 pm

bartszu wrote:
Tue Mar 26, 2019 9:06 pm
OMG I sorted it, it works :°)))))
Can you be more specific? Did you manage to get a sound going through the speakers while headphones were connected?

User avatar
bartszu
Level 4
Level 4
Posts: 332
Joined: Thu Aug 28, 2014 7:39 pm
Location: Eire

Re: Command to play sound through speakers when headphones on ?

Post by bartszu » Tue Mar 26, 2019 9:58 pm

1. alsamixer auto mute off
2. Connect headphones manually change output in Preferences to Headphones, this silence speakers.
3. Run

Code: Select all

pacmd set-sink-port 0 analog-output-speaker && audacious example.mp3
This plays tru Speakers and ............ Headphones.

Auto mute option in Alsa is one to detect that Headphones are in, and mute Speakers.
This is digged deeply in ALSA.
Turning this off, coz sound to play from both Headphones and Speakers in analog-output-speaker.
Connecting Headphones and changing to analog-output-headphones its just 3 clicks.
Actually

Code: Select all

pacmd set-sink-port 0 analog-output-headphones
can be a desktop launcher.

So I can go around with headphones, throw them away and in the morning Alarm will play thru Speakers.

User avatar
MrEen
Level 13
Level 13
Posts: 4978
Joined: Mon Jun 12, 2017 8:39 pm

Re: Command to play sound through speakers when headphones on ?

Post by MrEen » Tue Mar 26, 2019 10:05 pm

I see.

I was thinking you wanted to play something through the speakers ONLY, while you were listening to something else on the headphones.

I'm glad you got it figured out. Nice work! :D

User avatar
bartszu
Level 4
Level 4
Posts: 332
Joined: Thu Aug 28, 2014 7:39 pm
Location: Eire

Re: Command to play sound through speakers when headphones on ?

Post by bartszu » Tue Mar 26, 2019 10:11 pm

No I just wanted bloody Alarm to work as it should.
I often fall asleep with Headphones then in the morning I have no alarm.

Post Reply

Return to “Scripts & Bash”