From: Hugo Villeneuve Date: Fri, 1 Mar 2024 17:57:57 +0000 (-0500) Subject: rpi: enable IQaudio sound card X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=eef50fc0ce63d6f4becb139f6617211f2f8a7098;p=yocto%2Fmeta-hvmpd.git rpi: enable IQaudio sound card --- diff --git a/conf/distro/hvmpd.conf b/conf/distro/hvmpd.conf index d9dcc41..d475776 100644 --- a/conf/distro/hvmpd.conf +++ b/conf/distro/hvmpd.conf @@ -44,3 +44,4 @@ IMAGE_LINGUAS = "en-us en-ca" WIC_CREATE_EXTRA_ARGS:append = " --no-fstab-update" ALSA_DEVICE_ID ?= "0" +SOUND_CARD ?= "default" diff --git a/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend b/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend index ea3c6d4..585ac66 100644 --- a/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend +++ b/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend @@ -1,6 +1,17 @@ do_deploy:append() { - # Enable Pi’s on-board sound card (load snd_bcm2835): - sed -i 's/^#\(dtparam=audio=\).*/\1on/' $CONFIG + if [ "${SOUND_CARD}" = "iqaudiodac" ]; then + # Disable Pi’s on-board sound card (snd_bcm2835): + sed -i 's/^#\(dtparam=audio=\).*/\1off/' $CONFIG + + # Enable IQaudio sound card: + echo "dtoverlay=iqaudio-dacplus" >> $CONFIG + + # Enable I2S mode: + sed -i 's/^#\(dtparam=i2s=\).*/\1on/' $CONFIG + else + # Enable Pi’s on-board sound card (load snd_bcm2835): + sed -i 's/^#\(dtparam=audio=\).*/\1on/' $CONFIG + fi # Pretends all audio formats are unsupported by display. This # forces ALSA to use analogue output: diff --git a/recipes-multimedia/musicpd/mpd_%.bbappend b/recipes-multimedia/musicpd/mpd_%.bbappend index a158eb0..8e65fd0 100644 --- a/recipes-multimedia/musicpd/mpd_%.bbappend +++ b/recipes-multimedia/musicpd/mpd_%.bbappend @@ -7,6 +7,8 @@ SRC_URI:append = " \ file://classique.m3u \ " +SOUND_CARD ?= "default" + do_install:append() { ALSA_MIXER="PCM" } @@ -16,8 +18,13 @@ do_install:append:wandboard() { } do_install:append:rpi() { - # Internal sound card - ALSA_DEVICE_NAME="headphones" + if [ "${SOUND_CARD}" = "iqaudiodac" ]; then + ALSA_DEVICE_NAME="IQaudIODAC" + ALSA_MIXER="Digital" + else + # Internal sound card + ALSA_DEVICE_NAME="headphones" + fi } do_install:append() {