Note: asound.conf needs to be generated in alsa-state recipe. If not,
the following warniong will occur when creating the final image:
check_data_file_clashes: Package alsa-utils wants to install file
...image-hvmpd-dev/1.0-r0/rootfs/etc/asound.conf
But that file is already provided by package * alsa-state
# the rootfs image, and not the WIC image, which would lead to differences
# between the two images.
WIC_CREATE_EXTRA_ARGS:append = " --no-fstab-update"
+
+ALSA_DEVICE_ID ?= "0"
file://asound.state \
"
-do_install:append:raspberrypi() {
- echo "defaults.pcm.card 1" >> ${D}${sysconfdir}/asound.conf
- echo "defaults.ctl.card 1" >> ${D}${sysconfdir}/asound.conf
+do_install:append() {
+ install -d ${D}${sysconfdir}
+ echo "defaults.pcm.card ${ALSA_DEVICE_ID}" >> ${D}${sysconfdir}/asound.conf
+ echo "defaults.ctl.card ${ALSA_DEVICE_ID}" >> ${D}${sysconfdir}/asound.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 " device \"hw:${ALSA_DEVICE_ID},0\"" >> ${D}/${sysconfdir}/mpd.conf
echo "}" >> ${D}/${sysconfdir}/mpd.conf
install -m 644 -o mpd -g audio ${WORKDIR}/*.m3u ${D}/${localstatedir}/lib/mpd/playlists/