Skip to content

Commit

Permalink
remove "-c 1" and also protect with test for older kernel / alsa
Browse files Browse the repository at this point in the history
The "-c 1" was simply wrong. The default (-c 0) sound device of
older kernel / alsa has a numid=3 selector for auto vs headphone vs hdmi .
Newer kernel simply has multiple devices. Also, headphone is -c 0 .

$ amixer contents
numid=2,iface=MIXER,name='Headphone Playback Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=1,iface=MIXER,name='Headphone Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
  : values=-2000
  | dBscale-min=-102.39dB,step=0.01dB,mute=1

TODO: For now, broadly dividing by kernel v4.x vs v5.x is good enough, but
it would be nice to find out when / which kernel /alsa this is relevant.

closes respeaker#240
  • Loading branch information
HinTak committed Aug 18, 2020
1 parent d8775cc commit 07dc492
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions seeed-voicecard
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,6 @@ fi
alsactl restore

#Force 3.5mm ('headphone') jack
amixer -c 1 cset numid=3 1 || true

if [[ "$kernel_ver" =~ ^4\.*$ ]]; then
amixer cset numid=3 1 || true
fi

0 comments on commit 07dc492

Please sign in to comment.