Use logic from raspi-config to determine if bcm2835 routing option exists or not

The snd_bcm2835.enable_compat_alsa option:

    enable_compat_alsa:Enables ALSA compatibility virtual audio device (bool)

is off these days, since the beginning of 2020 apparently.

Reference:

    raspi-config (20200120) buster; urgency=medium

      * Add audio switching for discrete internal ALSA devices

     -- Simon Long <simon@raspberrypi.org>  Mon, 20 Jan 2020 11:38:37 +0000
This commit is contained in:
Hin-Tak Leung 2020-09-09 03:25:19 +01:00 committed by turmary
parent 8c25d81890
commit 5ca9ab45df

View file

@ -150,6 +150,6 @@ fi
alsactl restore alsactl restore
#Force 3.5mm ('headphone') jack #Force 3.5mm ('headphone') jack
if [[ "$kernel_ver" =~ ^4\.*$ ]]; then if aplay -l | grep -q "bcm2835 ALSA"; then
amixer cset numid=3 1 || true amixer cset numid=3 1 || true
fi fi