Mute speakers when headset is plugged in
#1
Somehow when I plug in a headset sound is played through it but the speakers don't mute and still play sound still.
I like to have the behavior to mute the speakers if I plug in my headphones or headset.
I guess I  need to enable some switch in alsamixer to make it work.
  Reply
#2
(08-16-2017, 02:25 PM)leszek Wrote: Somehow when I plug in a headset sound is played through it but the speakers don't mute and still play sound still.
I like to have the behavior to mute the speakers if I plug in my headphones or headset.
I guess I  need to enable some switch in alsamixer to make it work.

Witaj ;Wink

This is a known problem - I believe that anarsoul was looking into it sometime ago. So for now, you will need to manually mute speakers in alsamixer.
You can find me on IRC, Discord and Twitter


  Reply
#3
(08-16-2017, 03:07 PM)Luke Wrote:
(08-16-2017, 02:25 PM)leszek Wrote: Somehow when I plug in a headset sound is played through it but the speakers don't mute and still play sound still.
I like to have the behavior to mute the speakers if I plug in my headphones or headset.
I guess I  need to enable some switch in alsamixer to make it work.

Witaj ;Wink

This is a known problem - I believe that anarsoul was looking into it sometime ago. So for now, you will need to manually mute speakers in alsamixer.

Hi Luke,

In case the issue has not fixed yet, I wrote a simple patch using acpi_listen to automatically mute/unmute when audio jack plugs in/out.
https://github.com/kasramp/PinebookScrip...dphone_fix

Let me know if you have any question.
  Reply
#4
(08-20-2017, 03:38 AM)k_mp Wrote:
(08-16-2017, 03:07 PM)Luke Wrote:
(08-16-2017, 02:25 PM)leszek Wrote: Somehow when I plug in a headset sound is played through it but the speakers don't mute and still play sound still.
I like to have the behavior to mute the speakers if I plug in my headphones or headset.
I guess I  need to enable some switch in alsamixer to make it work.

Witaj ;Wink

This is a known problem - I believe that anarsoul was looking into it sometime ago. So for now, you will need to manually mute speakers in alsamixer.

Hi Luke,

In case the issue has not fixed yet, I wrote a simple patch using acpi_listen to automatically mute/unmute when audio jack plugs in/out.
https://github.com/kasramp/PinebookScrip...dphone_fix

Let me know if you have any question.

Very good job! seems to work perfectly. Will make sure to have ayufan see this so it can be included in future images Smile
You can find me on IRC, Discord and Twitter


  Reply
#5
Thank you, this is very usefull ! Smile

Below it showed that the range for 'headphone volume' is from 0-63, and for ' speaker volume' 0-31.

Code:
[email protected]:/etc/acpi# amixer -c 1 sset 'headphone volume' 35
Simple mixer control 'headphone volume',0
 Capabilities: volume volume-joined
 Playback channels: Mono
 Capture channels: Mono
 Limits: 0 - 63
 Mono: 35 [56%]
[email protected]:/etc/acpi# amixer -c 1 sset 'speaker volume' 35
Simple mixer control 'speaker volume',0
 Capabilities: volume volume-joined
 Playback channels: Mono
 Capture channels: Mono
 Limits: 0 - 31
 Mono: 31 [100%]

On my PB I've changed the values as below. Further I had to add the -c 1 option for selecting the right card.

Code:
#!/bin/bash

case "$1" in
   jack/headphone)
       case "$3" in
           plug)
               amixer -c 1 sset 'speaker volume' 0
               # amixer -D pulse sset Master 50% not working yet
               amixer -c 1 sset 'headphone volume' 35
           ;;
           unplug)
               amixer -c 1 sset 'headphone volume' 0
               # amixer -D pulse sset Master 50% not working yet
               amixer -c 1 sset 'speaker volume' 31
           ;;
       esac
   ;;
esac

p.s. I really recommend to NOT set 'headphone volume' to the maximum of 63, it will probably will be way to loud! (i tried till 51, too loud alread! Wink
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)