From 07dc49259ac8c16e44f730003021cc15d19d7bd3 Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Tue, 18 Aug 2020 23:30:21 +0100 Subject: [PATCH] remove "-c 1" and also protect with test for older kernel / alsa 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 https://github.com/respeaker/seeed-voicecard/issues/240 --- seeed-voicecard | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/seeed-voicecard b/seeed-voicecard index f693ed3..f8c3986 100755 --- a/seeed-voicecard +++ b/seeed-voicecard @@ -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