From fc492264dc674d09fae0e36aef38115bf723357d Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Fri, 23 Feb 2024 12:31:09 -0500 Subject: [PATCH] alsa: add support for different sound cards --- recipes-multimedia/musicpd/mpd_%.bbappend | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/recipes-multimedia/musicpd/mpd_%.bbappend b/recipes-multimedia/musicpd/mpd_%.bbappend index 0bb6f27..a158eb0 100644 --- a/recipes-multimedia/musicpd/mpd_%.bbappend +++ b/recipes-multimedia/musicpd/mpd_%.bbappend @@ -7,13 +7,27 @@ SRC_URI:append = " \ file://classique.m3u \ " +do_install:append() { + ALSA_MIXER="PCM" +} + +do_install:append:wandboard() { + ALSA_DEVICE_NAME="imx6wandboardsg" +} + +do_install:append:rpi() { + # Internal sound card + ALSA_DEVICE_NAME="headphones" +} + do_install:append() { echo "zeroconf_enabled \"yes\"" >> ${D}/${sysconfdir}/mpd.conf echo "zeroconf_name \"Serveur Musique MPD\"" >> ${D}/${sysconfdir}/mpd.conf echo "audio_output {" >> ${D}/${sysconfdir}/mpd.conf echo " type \"alsa\"" >> ${D}/${sysconfdir}/mpd.conf - echo " name \"My ALSA Device\"" >> ${D}/${sysconfdir}/mpd.conf + echo " name \"${ALSA_DEVICE_NAME}\"" >> ${D}/${sysconfdir}/mpd.conf echo " device \"hw:${ALSA_DEVICE_ID},0\"" >> ${D}/${sysconfdir}/mpd.conf + echo " mixer_control \"${ALSA_MIXER}\"" >> ${D}/${sysconfdir}/mpd.conf echo "}" >> ${D}/${sysconfdir}/mpd.conf install -m 644 -o mpd -g audio ${WORKDIR}/*.m3u ${D}/${localstatedir}/lib/mpd/playlists/ -- 2.20.1