diff options
author | Darren Hart <dvhart@linux.intel.com> | 2011-06-17 14:42:32 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-22 17:02:55 +0100 |
commit | 489fe5d4406410e7eae35ca7ee7be911fac938ec (patch) | |
tree | 86e11cc1bc9ecd69f6e28c9204d21ec049a39c8a /meta-yocto/recipes-bsp/beagleboard-audio | |
parent | 0363835985a264458fb9432aab1f6345bb2bd424 (diff) | |
download | poky-489fe5d4406410e7eae35ca7ee7be911fac938ec.tar.gz |
beagleboard: add basic audio mixer defaults
We need a generic alsa based mechanism that we can use a bbappend to save
default mixer controls per bsp. Until that is ready, this ensures the Audio Out
on the Beagleboard is enabled out of the box.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'meta-yocto/recipes-bsp/beagleboard-audio')
-rw-r--r-- | meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio.bb | 30 | ||||
-rw-r--r-- | meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio/beagleboard-audio | 44 |
2 files changed, 74 insertions, 0 deletions
diff --git a/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio.bb b/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio.bb new file mode 100644 index 0000000000..b0c2cd708b --- /dev/null +++ b/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio.bb | |||
@@ -0,0 +1,30 @@ | |||
1 | SUMMARY = "Provide a basic init script to enable audio" | ||
2 | DESCRIPTION = "Set the volume and unmute the Front mixer setting during boot." | ||
3 | SECTION = "base" | ||
4 | LICENSE = "MIT" | ||
5 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" | ||
6 | |||
7 | PR = "r4" | ||
8 | |||
9 | inherit update-rc.d | ||
10 | |||
11 | RDEPENDS = "alsa-utils-amixer" | ||
12 | |||
13 | SRC_URI = "file://beagleboard-audio" | ||
14 | |||
15 | INITSCRIPT_NAME = "beagleboard-audio" | ||
16 | INITSCRIPT_PARAMS = "defaults 90" | ||
17 | |||
18 | do_install() { | ||
19 | install -d ${D}${sysconfdir} \ | ||
20 | ${D}${sysconfdir}/init.d | ||
21 | install -m 0755 ${WORKDIR}/beagleboard-audio ${D}${sysconfdir}/init.d | ||
22 | cat ${WORKDIR}/${INITSCRIPT_NAME} | \ | ||
23 | sed -e 's,/etc,${sysconfdir},g' \ | ||
24 | -e 's,/usr/sbin,${sbindir},g' \ | ||
25 | -e 's,/var,${localstatedir},g' \ | ||
26 | -e 's,/usr/bin,${bindir},g' \ | ||
27 | -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME} | ||
28 | chmod 755 ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME} | ||
29 | } | ||
30 | |||
diff --git a/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio/beagleboard-audio b/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio/beagleboard-audio new file mode 100644 index 0000000000..ed2bd50f8b --- /dev/null +++ b/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio/beagleboard-audio | |||
@@ -0,0 +1,44 @@ | |||
1 | #!/bin/sh | ||
2 | ### BEGIN INIT INFO | ||
3 | # Provides: beagleboard mixer setup | ||
4 | # Required-Start: $syslog | ||
5 | # Required-Stop: $syslog | ||
6 | # Default-Start: 2 3 4 5 | ||
7 | # Default-Stop: 0 1 6 | ||
8 | # Short-Description: Initialize the beagleboard audio mixer | ||
9 | # Description: Unmute FRONT and set volume to ~70%. | ||
10 | ### END INIT INFO | ||
11 | |||
12 | # Author: Darren Hart <dvhart@linux.intel.com> | ||
13 | # Based on /etc/init.d/skeleton | ||
14 | |||
15 | PATH=/sbin:/usr/sbin:/bin:/usr/bin | ||
16 | DESC="Audio mixer settings" | ||
17 | NAME=beagleboard-audio | ||
18 | AMIXER=`which amixer` | ||
19 | SCRIPTNAME=/etc/init.d/$NAME | ||
20 | |||
21 | # Exit if amixer is not installed | ||
22 | [ -x "$AMIXER" ] || exit 0 | ||
23 | |||
24 | do_start() { | ||
25 | # Enable the Headset (Audio Out) | ||
26 | $AMIXER sset "Headset" 2 > /dev/null | ||
27 | $AMIXER sset "HeadsetL Mixer AudioL1" on > /dev/null | ||
28 | $AMIXER sset "HeadsetR Mixer AudioR1" on > /dev/null | ||
29 | } | ||
30 | |||
31 | case "$1" in | ||
32 | start) | ||
33 | echo "$NAME: setting default mixer settings." | ||
34 | do_start | ||
35 | ;; | ||
36 | stop) | ||
37 | ;; | ||
38 | *) | ||
39 | echo "Usage: $SCRIPTNAME {start|stop}" >&2 | ||
40 | exit 3 | ||
41 | ;; | ||
42 | esac | ||
43 | |||
44 | exit 0 | ||