From: Hugo Villeneuve Date: Fri, 23 Feb 2024 17:31:09 +0000 (-0500) Subject: alsa: add support for different sound cards X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=fc492264dc674d09fae0e36aef38115bf723357d;p=yocto%2Fmeta-hvmpd.git alsa: add support for different sound cards --- 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/