* [PATCH 0/3] Add alsa-state from OE Classic v2
@ 2012-01-10 17:39 Joshua Lock
2012-01-10 17:39 ` [PATCH 1/3] alsa-state: add alsa-state from oe classic Joshua Lock
` (3 more replies)
0 siblings, 4 replies; 16+ messages in thread
From: Joshua Lock @ 2012-01-10 17:39 UTC (permalink / raw)
To: openembedded-core
The small series following introduces the alsa-state recipe from oe-classic.
The reason for doing so is to remove the requirement for recipes like the
beagleboard-audio recipe in meta-yocto, which ensures the beagleboards sound
device has the volume turned up.
Long term I'd like to implement something more generic for handling device
quirks, but alsa-state is a simple fix for an immediate need that should
standardise how alsa configuration is handled in layers.
Since v1 I've added an extra commit which:
a) defaults to /var/lib/alsa/ for state files, as this is the directory
alsactl writes to by default.
b) sed's the path to the state files into the init script, rather than hard
codes them.
The following changes since commit fff18970706913e7fd7f4a119d798dddb44b388a:
base-files: filesystems: fix mount order (2012-01-06 14:41:19 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib josh/devices
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=josh/devices
Joshua Lock (3):
alsa-state: add alsa-state from oe classic
alsa-state: move state files to localstatedir
task-base: add alsa-state to task-base-alsa
meta/recipes-bsp/alsa-state/alsa-state.bb | 59 ++++++++++++++++++++
meta/recipes-bsp/alsa-state/alsa-state/alsa-state | 29 ++++++++++
meta/recipes-bsp/alsa-state/alsa-state/asound.conf | 12 ++++
.../recipes-bsp/alsa-state/alsa-state/asound.state | 1 +
meta/recipes-core/tasks/task-base.bb | 5 +-
5 files changed, 104 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-bsp/alsa-state/alsa-state.bb
create mode 100755 meta/recipes-bsp/alsa-state/alsa-state/alsa-state
create mode 100644 meta/recipes-bsp/alsa-state/alsa-state/asound.conf
create mode 100644 meta/recipes-bsp/alsa-state/alsa-state/asound.state
--
1.7.7.5
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/3] alsa-state: add alsa-state from oe classic
2012-01-10 17:39 [PATCH 0/3] Add alsa-state from OE Classic v2 Joshua Lock
@ 2012-01-10 17:39 ` Joshua Lock
2012-01-10 19:30 ` Otavio Salvador
2012-01-12 16:22 ` Darren Hart
2012-01-10 17:39 ` [PATCH 2/3] alsa-state: move state files to localstatedir Joshua Lock
` (2 subsequent siblings)
3 siblings, 2 replies; 16+ messages in thread
From: Joshua Lock @ 2012-01-10 17:39 UTC (permalink / raw)
To: openembedded-core
alsa-state adds an init script and configuration files to enable a
consistent and centralised mechanism for setting and restoring alsa
configuration.
Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
meta/recipes-bsp/alsa-state/alsa-state.bb | 57 ++++++++++++++++++++
meta/recipes-bsp/alsa-state/alsa-state/alsa-state | 29 ++++++++++
meta/recipes-bsp/alsa-state/alsa-state/asound.conf | 12 ++++
.../recipes-bsp/alsa-state/alsa-state/asound.state | 1 +
4 files changed, 99 insertions(+), 0 deletions(-)
create mode 100644 meta/recipes-bsp/alsa-state/alsa-state.bb
create mode 100755 meta/recipes-bsp/alsa-state/alsa-state/alsa-state
create mode 100644 meta/recipes-bsp/alsa-state/alsa-state/asound.conf
create mode 100644 meta/recipes-bsp/alsa-state/alsa-state/asound.state
diff --git a/meta/recipes-bsp/alsa-state/alsa-state.bb b/meta/recipes-bsp/alsa-state/alsa-state.bb
new file mode 100644
index 0000000..ecfa975
--- /dev/null
+++ b/meta/recipes-bsp/alsa-state/alsa-state.bb
@@ -0,0 +1,57 @@
+# Copyright Matthias Hentges <devel@hentges.net> (c) 2007
+# License: MIT (see http://www.opensource.org/licenses/mit-license.php
+# for a copy of the license)
+#
+# Filename: alsa-state.bb
+
+SUMMARY = "Alsa scenario files to enable alsa state restoration."
+DESCRIPTION = "Alsa Scenario Files - an init script and state files to restore \
+sound state at system boot and save it at system shut down."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+PV = "0.2.0"
+PR = "r0"
+
+SRC_URI = "\
+ file://asound.conf \
+ file://asound.state \
+ file://alsa-state \
+"
+
+RDEPENDS = "alsa-utils-alsactl"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "alsa-state"
+INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
+
+do_install() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/alsa-state ${D}${sysconfdir}/init.d
+
+ install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/*.state ${D}${sysconfdir}
+}
+
+PACKAGES += "alsa-states"
+
+RRECOMMENDS_alsa-state = "alsa-states"
+
+FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf"
+CONFFILES_${PN} = "${sysconfdir}/asound.conf"
+
+FILES_alsa-states = "${sysconfdir}/*.state"
+
+pkg_postinst_${PN}() {
+ if test -z "$D"
+ then
+ if test -x /usr/sbin/alsactl
+ then
+ /usr/sbin/alsactl -f ${sysconfdir}/asound.state restore
+ fi
+ # INITSCRIPT_PARAMS changed, so remove the old and
+ # install the new setting.
+ update-rc.d -f ${INITSCRIPT_NAME} remove
+ update-rc.d ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
+ fi
+}
diff --git a/meta/recipes-bsp/alsa-state/alsa-state/alsa-state b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state
new file mode 100755
index 0000000..84cdf03
--- /dev/null
+++ b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state
@@ -0,0 +1,29 @@
+#! /bin/sh
+#
+# Copyright Matthias Hentges <devel@hentges.net> (c) 2007
+# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
+#
+# Filename: alsa-state
+# Date: 20070308 (YMD)
+
+
+asound_restore(){
+ echo "ALSA: Restoring mixer settings..."
+ if test -x /usr/sbin/alsactl -a -e /etc/asound.state
+ then
+ /usr/sbin/alsactl -f /etc/asound.state restore &
+ fi
+}
+
+asound_store(){
+ echo "ALSA: Storing mixer settings..."
+ if test -x /usr/sbin/alsactl
+ then
+ /usr/sbin/alsactl -f /etc/asound.state store
+ fi
+}
+
+case "$1" in
+start) asound_restore ;;
+stop) asound_store ;;
+esac
diff --git a/meta/recipes-bsp/alsa-state/alsa-state/asound.conf b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
new file mode 100644
index 0000000..6be0242
--- /dev/null
+++ b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
@@ -0,0 +1,12 @@
+# default dmix configuration
+
+pcm.!default {
+ type plug
+ slave.pcm "dmix"
+}
+
+ctl.mixer0 {
+ type hw
+ card 0
+}
+
diff --git a/meta/recipes-bsp/alsa-state/alsa-state/asound.state b/meta/recipes-bsp/alsa-state/alsa-state/asound.state
new file mode 100644
index 0000000..88b0d02
--- /dev/null
+++ b/meta/recipes-bsp/alsa-state/alsa-state/asound.state
@@ -0,0 +1 @@
+# Dummy file, do not delete
\ No newline at end of file
--
1.7.7.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 2/3] alsa-state: move state files to localstatedir
2012-01-10 17:39 [PATCH 0/3] Add alsa-state from OE Classic v2 Joshua Lock
2012-01-10 17:39 ` [PATCH 1/3] alsa-state: add alsa-state from oe classic Joshua Lock
@ 2012-01-10 17:39 ` Joshua Lock
2012-01-12 16:23 ` Darren Hart
2012-01-10 17:39 ` [PATCH 3/3] task-base: add alsa-state to task-base-alsa Joshua Lock
2012-01-10 19:34 ` [PATCH 0/3] Add alsa-state from OE Classic v2 Otavio Salvador
3 siblings, 1 reply; 16+ messages in thread
From: Joshua Lock @ 2012-01-10 17:39 UTC (permalink / raw)
To: openembedded-core
alsactl creates the state files in /var/lib/alsa by default so switch
alsa-state to use files in that location.
Further, update the alsa-state init script to have the location of the
state files sed'ed into the script at do_install time (so as to remove
hard coding of directory paths).
Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
meta/recipes-bsp/alsa-state/alsa-state.bb | 8 +++++---
meta/recipes-bsp/alsa-state/alsa-state/alsa-state | 6 +++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/meta/recipes-bsp/alsa-state/alsa-state.bb b/meta/recipes-bsp/alsa-state/alsa-state.bb
index ecfa975..bc17b25 100644
--- a/meta/recipes-bsp/alsa-state/alsa-state.bb
+++ b/meta/recipes-bsp/alsa-state/alsa-state.bb
@@ -26,11 +26,13 @@ INITSCRIPT_NAME = "alsa-state"
INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
do_install() {
+ sed -i -e "s:#STATEDIR#:${localstatedir}/lib/alsa:g" ${WORKDIR}/alsa-state
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/alsa-state ${D}${sysconfdir}/init.d
+ install -d ${D}/${localstatedir}/lib/alsa
install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}
- install -m 0644 ${WORKDIR}/*.state ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/*.state ${D}${localstatedir}/lib/alsa
}
PACKAGES += "alsa-states"
@@ -40,14 +42,14 @@ RRECOMMENDS_alsa-state = "alsa-states"
FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf"
CONFFILES_${PN} = "${sysconfdir}/asound.conf"
-FILES_alsa-states = "${sysconfdir}/*.state"
+FILES_alsa-states = "${localstatedir}/lib/alsa/*.state"
pkg_postinst_${PN}() {
if test -z "$D"
then
if test -x /usr/sbin/alsactl
then
- /usr/sbin/alsactl -f ${sysconfdir}/asound.state restore
+ /usr/sbin/alsactl -f ${localstatedir}/lib/alsa/asound.state restore
fi
# INITSCRIPT_PARAMS changed, so remove the old and
# install the new setting.
diff --git a/meta/recipes-bsp/alsa-state/alsa-state/alsa-state b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state
index 84cdf03..9850791 100755
--- a/meta/recipes-bsp/alsa-state/alsa-state/alsa-state
+++ b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state
@@ -9,9 +9,9 @@
asound_restore(){
echo "ALSA: Restoring mixer settings..."
- if test -x /usr/sbin/alsactl -a -e /etc/asound.state
+ if test -x /usr/sbin/alsactl -a -e #STATEDIR#/asound.state
then
- /usr/sbin/alsactl -f /etc/asound.state restore &
+ /usr/sbin/alsactl -f #STATEDIR#/asound.state restore &
fi
}
@@ -19,7 +19,7 @@ asound_store(){
echo "ALSA: Storing mixer settings..."
if test -x /usr/sbin/alsactl
then
- /usr/sbin/alsactl -f /etc/asound.state store
+ /usr/sbin/alsactl -f #STATEDIR#/asound.state store
fi
}
--
1.7.7.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 3/3] task-base: add alsa-state to task-base-alsa
2012-01-10 17:39 [PATCH 0/3] Add alsa-state from OE Classic v2 Joshua Lock
2012-01-10 17:39 ` [PATCH 1/3] alsa-state: add alsa-state from oe classic Joshua Lock
2012-01-10 17:39 ` [PATCH 2/3] alsa-state: move state files to localstatedir Joshua Lock
@ 2012-01-10 17:39 ` Joshua Lock
2012-01-12 16:23 ` Darren Hart
2012-01-10 19:34 ` [PATCH 0/3] Add alsa-state from OE Classic v2 Otavio Salvador
3 siblings, 1 reply; 16+ messages in thread
From: Joshua Lock @ 2012-01-10 17:39 UTC (permalink / raw)
To: openembedded-core
This enables automatic configuration setting and restoration on systems
with alsa.
Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
meta/recipes-core/tasks/task-base.bb | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-core/tasks/task-base.bb b/meta/recipes-core/tasks/task-base.bb
index e0960b5..7460be4 100644
--- a/meta/recipes-core/tasks/task-base.bb
+++ b/meta/recipes-core/tasks/task-base.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "Merge machine and distro options to create a basic machine task/p
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-PR = "r72"
+PR = "r73"
inherit task
@@ -183,7 +183,8 @@ RRECOMMENDS_task-base-vfat = "\
RDEPENDS_task-base-alsa = "\
alsa-utils-alsactl \
- alsa-utils-alsamixer"
+ alsa-utils-alsamixer \
+ alsa-state"
RRECOMMENDS_task-base-alsa = "\
kernel-module-snd-mixer-oss \
--
1.7.7.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 1/3] alsa-state: add alsa-state from oe classic
2012-01-10 17:39 ` [PATCH 1/3] alsa-state: add alsa-state from oe classic Joshua Lock
@ 2012-01-10 19:30 ` Otavio Salvador
2012-01-10 19:44 ` Joshua Lock
2012-01-12 16:22 ` Darren Hart
1 sibling, 1 reply; 16+ messages in thread
From: Otavio Salvador @ 2012-01-10 19:30 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 446 bytes --]
On Tue, Jan 10, 2012 at 15:39, Joshua Lock <josh@linux.intel.com> wrote:
> ...
+++ b/meta/recipes-bsp/alsa-state/alsa-state/asound.state
> @@ -0,0 +1 @@
> +# Dummy file, do not delete
> \ No newline at end of file
>
^ please fix it.
--
Otavio Salvador O.S. Systems
E-mail: otavio@ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
[-- Attachment #2: Type: text/html, Size: 1010 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 0/3] Add alsa-state from OE Classic v2
2012-01-10 17:39 [PATCH 0/3] Add alsa-state from OE Classic v2 Joshua Lock
` (2 preceding siblings ...)
2012-01-10 17:39 ` [PATCH 3/3] task-base: add alsa-state to task-base-alsa Joshua Lock
@ 2012-01-10 19:34 ` Otavio Salvador
2012-01-10 19:45 ` Joshua Lock
2012-01-24 23:37 ` Joshua Lock
3 siblings, 2 replies; 16+ messages in thread
From: Otavio Salvador @ 2012-01-10 19:34 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 749 bytes --]
On Tue, Jan 10, 2012 at 15:39, Joshua Lock <josh@linux.intel.com> wrote:
> The small series following introduces the alsa-state recipe from
> oe-classic.
> The reason for doing so is to remove the requirement for recipes like the
> beagleboard-audio recipe in meta-yocto, which ensures the beagleboards
> sound
> device has the volume turned up.
>
If you're on the mood please also prepare a patch for meta-oe to add
support to systemd. It ought to be quite trivial to add and allow for easy
use for people using systemd based images.
--
Otavio Salvador O.S. Systems
E-mail: otavio@ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
[-- Attachment #2: Type: text/html, Size: 1199 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/3] alsa-state: add alsa-state from oe classic
2012-01-10 19:30 ` Otavio Salvador
@ 2012-01-10 19:44 ` Joshua Lock
0 siblings, 0 replies; 16+ messages in thread
From: Joshua Lock @ 2012-01-10 19:44 UTC (permalink / raw)
To: openembedded-core
On 10/01/12 11:30, Otavio Salvador wrote:
> On Tue, Jan 10, 2012 at 15:39, Joshua Lock <josh@linux.intel.com
> <mailto:josh@linux.intel.com>> wrote:
>
> ...
>
> +++ b/meta/recipes-bsp/alsa-state/alsa-state/asound.state
> @@ -0,0 +1 @@
> +# Dummy file, do not delete
> \ No newline at end of file
>
>
> ^ please fix it.
Pushed to the branch.
Joshua
--
Joshua Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 0/3] Add alsa-state from OE Classic v2
2012-01-10 19:34 ` [PATCH 0/3] Add alsa-state from OE Classic v2 Otavio Salvador
@ 2012-01-10 19:45 ` Joshua Lock
2012-01-10 19:48 ` Otavio Salvador
2012-01-24 23:37 ` Joshua Lock
1 sibling, 1 reply; 16+ messages in thread
From: Joshua Lock @ 2012-01-10 19:45 UTC (permalink / raw)
To: openembedded-core
On 10/01/12 11:34, Otavio Salvador wrote:
> On Tue, Jan 10, 2012 at 15:39, Joshua Lock <josh@linux.intel.com
> <mailto:josh@linux.intel.com>> wrote:
>
> The small series following introduces the alsa-state recipe from
> oe-classic.
> The reason for doing so is to remove the requirement for recipes
> like the
> beagleboard-audio recipe in meta-yocto, which ensures the
> beagleboards sound
> device has the volume turned up.
>
>
> If you're on the mood please also prepare a patch for meta-oe to add
> support to systemd. It ought to be quite trivial to add and allow for
> easy use for people using systemd based images.
I haven't done *anything* with systemd yet but I'd like to check it out
so I'll add this to my list.
Expect it to take a few days.
Joshua
--
Joshua Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 0/3] Add alsa-state from OE Classic v2
2012-01-10 19:45 ` Joshua Lock
@ 2012-01-10 19:48 ` Otavio Salvador
0 siblings, 0 replies; 16+ messages in thread
From: Otavio Salvador @ 2012-01-10 19:48 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 709 bytes --]
On Tue, Jan 10, 2012 at 17:45, Joshua Lock <josh@linux.intel.com> wrote:
> On 10/01/12 11:34, Otavio Salvador wrote:
>
>> If you're on the mood please also prepare a patch for meta-oe to add
>> support to systemd. It ought to be quite trivial to add and allow for
>> easy use for people using systemd based images.
>>
>
> I haven't done *anything* with systemd yet but I'd like to check it out so
> I'll add this to my list.
>
> Expect it to take a few days.
If you need some help, ping me.
--
Otavio Salvador O.S. Systems
E-mail: otavio@ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
[-- Attachment #2: Type: text/html, Size: 1354 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/3] alsa-state: add alsa-state from oe classic
2012-01-10 17:39 ` [PATCH 1/3] alsa-state: add alsa-state from oe classic Joshua Lock
2012-01-10 19:30 ` Otavio Salvador
@ 2012-01-12 16:22 ` Darren Hart
1 sibling, 0 replies; 16+ messages in thread
From: Darren Hart @ 2012-01-12 16:22 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On 01/10/2012 09:39 AM, Joshua Lock wrote:
> alsa-state adds an init script and configuration files to enable a
> consistent and centralised mechanism for setting and restoring alsa
> configuration.
>
> Signed-off-by: Joshua Lock <josh@linux.intel.com>
Acked-by: Darren Hart <dvhart@linux.intel.com>
> ---
> meta/recipes-bsp/alsa-state/alsa-state.bb | 57 ++++++++++++++++++++
> meta/recipes-bsp/alsa-state/alsa-state/alsa-state | 29 ++++++++++
> meta/recipes-bsp/alsa-state/alsa-state/asound.conf | 12 ++++
> .../recipes-bsp/alsa-state/alsa-state/asound.state | 1 +
> 4 files changed, 99 insertions(+), 0 deletions(-)
> create mode 100644 meta/recipes-bsp/alsa-state/alsa-state.bb
> create mode 100755 meta/recipes-bsp/alsa-state/alsa-state/alsa-state
> create mode 100644 meta/recipes-bsp/alsa-state/alsa-state/asound.conf
> create mode 100644 meta/recipes-bsp/alsa-state/alsa-state/asound.state
>
> diff --git a/meta/recipes-bsp/alsa-state/alsa-state.bb b/meta/recipes-bsp/alsa-state/alsa-state.bb
> new file mode 100644
> index 0000000..ecfa975
> --- /dev/null
> +++ b/meta/recipes-bsp/alsa-state/alsa-state.bb
> @@ -0,0 +1,57 @@
> +# Copyright Matthias Hentges <devel@hentges.net> (c) 2007
> +# License: MIT (see http://www.opensource.org/licenses/mit-license.php
> +# for a copy of the license)
> +#
> +# Filename: alsa-state.bb
> +
> +SUMMARY = "Alsa scenario files to enable alsa state restoration."
> +DESCRIPTION = "Alsa Scenario Files - an init script and state files to restore \
> +sound state at system boot and save it at system shut down."
> +LICENSE = "MIT"
> +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
> +PV = "0.2.0"
> +PR = "r0"
> +
> +SRC_URI = "\
> + file://asound.conf \
> + file://asound.state \
> + file://alsa-state \
> +"
> +
> +RDEPENDS = "alsa-utils-alsactl"
> +
> +inherit update-rc.d
> +
> +INITSCRIPT_NAME = "alsa-state"
> +INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
> +
> +do_install() {
> + install -d ${D}${sysconfdir}/init.d
> + install -m 0755 ${WORKDIR}/alsa-state ${D}${sysconfdir}/init.d
> +
> + install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}
> + install -m 0644 ${WORKDIR}/*.state ${D}${sysconfdir}
> +}
> +
> +PACKAGES += "alsa-states"
> +
> +RRECOMMENDS_alsa-state = "alsa-states"
> +
> +FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf"
> +CONFFILES_${PN} = "${sysconfdir}/asound.conf"
> +
> +FILES_alsa-states = "${sysconfdir}/*.state"
> +
> +pkg_postinst_${PN}() {
> + if test -z "$D"
> + then
> + if test -x /usr/sbin/alsactl
> + then
> + /usr/sbin/alsactl -f ${sysconfdir}/asound.state restore
> + fi
> + # INITSCRIPT_PARAMS changed, so remove the old and
> + # install the new setting.
> + update-rc.d -f ${INITSCRIPT_NAME} remove
> + update-rc.d ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
> + fi
> +}
> diff --git a/meta/recipes-bsp/alsa-state/alsa-state/alsa-state b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state
> new file mode 100755
> index 0000000..84cdf03
> --- /dev/null
> +++ b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state
> @@ -0,0 +1,29 @@
> +#! /bin/sh
> +#
> +# Copyright Matthias Hentges <devel@hentges.net> (c) 2007
> +# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
> +#
> +# Filename: alsa-state
> +# Date: 20070308 (YMD)
> +
> +
> +asound_restore(){
> + echo "ALSA: Restoring mixer settings..."
> + if test -x /usr/sbin/alsactl -a -e /etc/asound.state
> + then
> + /usr/sbin/alsactl -f /etc/asound.state restore &
> + fi
> +}
> +
> +asound_store(){
> + echo "ALSA: Storing mixer settings..."
> + if test -x /usr/sbin/alsactl
> + then
> + /usr/sbin/alsactl -f /etc/asound.state store
> + fi
> +}
> +
> +case "$1" in
> +start) asound_restore ;;
> +stop) asound_store ;;
> +esac
> diff --git a/meta/recipes-bsp/alsa-state/alsa-state/asound.conf b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
> new file mode 100644
> index 0000000..6be0242
> --- /dev/null
> +++ b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
> @@ -0,0 +1,12 @@
> +# default dmix configuration
> +
> +pcm.!default {
> + type plug
> + slave.pcm "dmix"
> +}
> +
> +ctl.mixer0 {
> + type hw
> + card 0
> +}
> +
> diff --git a/meta/recipes-bsp/alsa-state/alsa-state/asound.state b/meta/recipes-bsp/alsa-state/alsa-state/asound.state
> new file mode 100644
> index 0000000..88b0d02
> --- /dev/null
> +++ b/meta/recipes-bsp/alsa-state/alsa-state/asound.state
> @@ -0,0 +1 @@
> +# Dummy file, do not delete
> \ No newline at end of file
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/3] alsa-state: move state files to localstatedir
2012-01-10 17:39 ` [PATCH 2/3] alsa-state: move state files to localstatedir Joshua Lock
@ 2012-01-12 16:23 ` Darren Hart
0 siblings, 0 replies; 16+ messages in thread
From: Darren Hart @ 2012-01-12 16:23 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On 01/10/2012 09:39 AM, Joshua Lock wrote:
> alsactl creates the state files in /var/lib/alsa by default so switch
> alsa-state to use files in that location.
>
> Further, update the alsa-state init script to have the location of the
> state files sed'ed into the script at do_install time (so as to remove
> hard coding of directory paths).
>
> Signed-off-by: Joshua Lock <josh@linux.intel.com>
Acked-by: Darren Hart <dvhart@linux.intel.com>
> ---
> meta/recipes-bsp/alsa-state/alsa-state.bb | 8 +++++---
> meta/recipes-bsp/alsa-state/alsa-state/alsa-state | 6 +++---
> 2 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/meta/recipes-bsp/alsa-state/alsa-state.bb b/meta/recipes-bsp/alsa-state/alsa-state.bb
> index ecfa975..bc17b25 100644
> --- a/meta/recipes-bsp/alsa-state/alsa-state.bb
> +++ b/meta/recipes-bsp/alsa-state/alsa-state.bb
> @@ -26,11 +26,13 @@ INITSCRIPT_NAME = "alsa-state"
> INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
>
> do_install() {
> + sed -i -e "s:#STATEDIR#:${localstatedir}/lib/alsa:g" ${WORKDIR}/alsa-state
> install -d ${D}${sysconfdir}/init.d
> install -m 0755 ${WORKDIR}/alsa-state ${D}${sysconfdir}/init.d
>
> + install -d ${D}/${localstatedir}/lib/alsa
> install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}
> - install -m 0644 ${WORKDIR}/*.state ${D}${sysconfdir}
> + install -m 0644 ${WORKDIR}/*.state ${D}${localstatedir}/lib/alsa
> }
>
> PACKAGES += "alsa-states"
> @@ -40,14 +42,14 @@ RRECOMMENDS_alsa-state = "alsa-states"
> FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf"
> CONFFILES_${PN} = "${sysconfdir}/asound.conf"
>
> -FILES_alsa-states = "${sysconfdir}/*.state"
> +FILES_alsa-states = "${localstatedir}/lib/alsa/*.state"
>
> pkg_postinst_${PN}() {
> if test -z "$D"
> then
> if test -x /usr/sbin/alsactl
> then
> - /usr/sbin/alsactl -f ${sysconfdir}/asound.state restore
> + /usr/sbin/alsactl -f ${localstatedir}/lib/alsa/asound.state restore
> fi
> # INITSCRIPT_PARAMS changed, so remove the old and
> # install the new setting.
> diff --git a/meta/recipes-bsp/alsa-state/alsa-state/alsa-state b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state
> index 84cdf03..9850791 100755
> --- a/meta/recipes-bsp/alsa-state/alsa-state/alsa-state
> +++ b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state
> @@ -9,9 +9,9 @@
>
> asound_restore(){
> echo "ALSA: Restoring mixer settings..."
> - if test -x /usr/sbin/alsactl -a -e /etc/asound.state
> + if test -x /usr/sbin/alsactl -a -e #STATEDIR#/asound.state
> then
> - /usr/sbin/alsactl -f /etc/asound.state restore &
> + /usr/sbin/alsactl -f #STATEDIR#/asound.state restore &
> fi
> }
>
> @@ -19,7 +19,7 @@ asound_store(){
> echo "ALSA: Storing mixer settings..."
> if test -x /usr/sbin/alsactl
> then
> - /usr/sbin/alsactl -f /etc/asound.state store
> + /usr/sbin/alsactl -f #STATEDIR#/asound.state store
> fi
> }
>
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/3] task-base: add alsa-state to task-base-alsa
2012-01-10 17:39 ` [PATCH 3/3] task-base: add alsa-state to task-base-alsa Joshua Lock
@ 2012-01-12 16:23 ` Darren Hart
2012-01-12 16:31 ` Martin Jansa
0 siblings, 1 reply; 16+ messages in thread
From: Darren Hart @ 2012-01-12 16:23 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On 01/10/2012 09:39 AM, Joshua Lock wrote:
> This enables automatic configuration setting and restoration on systems
> with alsa.
>
> Signed-off-by: Joshua Lock <josh@linux.intel.com>
Acked-by: Darren Hart <dvhart@linux.intel.com>
> ---
> meta/recipes-core/tasks/task-base.bb | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/tasks/task-base.bb b/meta/recipes-core/tasks/task-base.bb
> index e0960b5..7460be4 100644
> --- a/meta/recipes-core/tasks/task-base.bb
> +++ b/meta/recipes-core/tasks/task-base.bb
> @@ -2,7 +2,7 @@ DESCRIPTION = "Merge machine and distro options to create a basic machine task/p
> LICENSE = "MIT"
> LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
> file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
> -PR = "r72"
> +PR = "r73"
>
> inherit task
>
> @@ -183,7 +183,8 @@ RRECOMMENDS_task-base-vfat = "\
>
> RDEPENDS_task-base-alsa = "\
> alsa-utils-alsactl \
> - alsa-utils-alsamixer"
> + alsa-utils-alsamixer \
> + alsa-state"
>
> RRECOMMENDS_task-base-alsa = "\
> kernel-module-snd-mixer-oss \
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/3] task-base: add alsa-state to task-base-alsa
2012-01-12 16:23 ` Darren Hart
@ 2012-01-12 16:31 ` Martin Jansa
2012-01-13 18:54 ` Joshua Lock
0 siblings, 1 reply; 16+ messages in thread
From: Martin Jansa @ 2012-01-12 16:31 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 1854 bytes --]
On Thu, Jan 12, 2012 at 08:23:16AM -0800, Darren Hart wrote:
>
>
> On 01/10/2012 09:39 AM, Joshua Lock wrote:
> > This enables automatic configuration setting and restoration on systems
> > with alsa.
> >
> > Signed-off-by: Joshua Lock <josh@linux.intel.com>
>
> Acked-by: Darren Hart <dvhart@linux.intel.com>
can we use VIRTUAL_RUNTIME for this, please?
for example in SHR we have alsa-state provided by fsoaudiod
Cheers,
>
> > ---
> > meta/recipes-core/tasks/task-base.bb | 5 +++--
> > 1 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta/recipes-core/tasks/task-base.bb b/meta/recipes-core/tasks/task-base.bb
> > index e0960b5..7460be4 100644
> > --- a/meta/recipes-core/tasks/task-base.bb
> > +++ b/meta/recipes-core/tasks/task-base.bb
> > @@ -2,7 +2,7 @@ DESCRIPTION = "Merge machine and distro options to create a basic machine task/p
> > LICENSE = "MIT"
> > LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
> > file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
> > -PR = "r72"
> > +PR = "r73"
> >
> > inherit task
> >
> > @@ -183,7 +183,8 @@ RRECOMMENDS_task-base-vfat = "\
> >
> > RDEPENDS_task-base-alsa = "\
> > alsa-utils-alsactl \
> > - alsa-utils-alsamixer"
> > + alsa-utils-alsamixer \
> > + alsa-state"
> >
> > RRECOMMENDS_task-base-alsa = "\
> > kernel-module-snd-mixer-oss \
>
> --
> Darren Hart
> Intel Open Source Technology Center
> Yocto Project - Linux Kernel
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/3] task-base: add alsa-state to task-base-alsa
2012-01-12 16:31 ` Martin Jansa
@ 2012-01-13 18:54 ` Joshua Lock
2012-01-13 18:58 ` Martin Jansa
0 siblings, 1 reply; 16+ messages in thread
From: Joshua Lock @ 2012-01-13 18:54 UTC (permalink / raw)
To: openembedded-core
On 12/01/12 08:31, Martin Jansa wrote:
> On Thu, Jan 12, 2012 at 08:23:16AM -0800, Darren Hart wrote:
>>
>>
>> On 01/10/2012 09:39 AM, Joshua Lock wrote:
>>> This enables automatic configuration setting and restoration on systems
>>> with alsa.
>>>
>>> Signed-off-by: Joshua Lock<josh@linux.intel.com>
>>
>> Acked-by: Darren Hart<dvhart@linux.intel.com>
>
> can we use VIRTUAL_RUNTIME for this, please?
>
> for example in SHR we have alsa-state provided by fsoaudiod
That's a fine idea. VIRTUAL-RUNTIME_alsa-state?
I'm testing a patch for it now.
Cheers,
Joshua
--
Joshua Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/3] task-base: add alsa-state to task-base-alsa
2012-01-13 18:54 ` Joshua Lock
@ 2012-01-13 18:58 ` Martin Jansa
0 siblings, 0 replies; 16+ messages in thread
From: Martin Jansa @ 2012-01-13 18:58 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 1113 bytes --]
On Fri, Jan 13, 2012 at 10:54:38AM -0800, Joshua Lock wrote:
>
>
> On 12/01/12 08:31, Martin Jansa wrote:
> > On Thu, Jan 12, 2012 at 08:23:16AM -0800, Darren Hart wrote:
> >>
> >>
> >> On 01/10/2012 09:39 AM, Joshua Lock wrote:
> >>> This enables automatic configuration setting and restoration on systems
> >>> with alsa.
> >>>
> >>> Signed-off-by: Joshua Lock<josh@linux.intel.com>
> >>
> >> Acked-by: Darren Hart<dvhart@linux.intel.com>
> >
> > can we use VIRTUAL_RUNTIME for this, please?
> >
> > for example in SHR we have alsa-state provided by fsoaudiod
>
> That's a fine idea. VIRTUAL-RUNTIME_alsa-state?
good for me.
> I'm testing a patch for it now.
Thanks!
>
> Cheers,
> Joshua
> --
> Joshua Lock
> Yocto Project "Johannes factotum"
> Intel Open Source Technology Centre
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 0/3] Add alsa-state from OE Classic v2
2012-01-10 19:34 ` [PATCH 0/3] Add alsa-state from OE Classic v2 Otavio Salvador
2012-01-10 19:45 ` Joshua Lock
@ 2012-01-24 23:37 ` Joshua Lock
1 sibling, 0 replies; 16+ messages in thread
From: Joshua Lock @ 2012-01-24 23:37 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On 10/01/12 11:34, Otavio Salvador wrote:
> On Tue, Jan 10, 2012 at 15:39, Joshua Lock <josh@linux.intel.com
> <mailto:josh@linux.intel.com>> wrote:
>
> The small series following introduces the alsa-state recipe from
> oe-classic.
> The reason for doing so is to remove the requirement for recipes
> like the
> beagleboard-audio recipe in meta-yocto, which ensures the
> beagleboards sound
> device has the volume turned up.
>
>
> If you're on the mood please also prepare a patch for meta-oe to add
> support to systemd. It ought to be quite trivial to add and allow for
> easy use for people using systemd based images.
As Koen pointed out, alsactl includes some systemd units to perform this
function.
Cheers,
Joshua
--
Joshua Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2012-01-24 23:45 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-10 17:39 [PATCH 0/3] Add alsa-state from OE Classic v2 Joshua Lock
2012-01-10 17:39 ` [PATCH 1/3] alsa-state: add alsa-state from oe classic Joshua Lock
2012-01-10 19:30 ` Otavio Salvador
2012-01-10 19:44 ` Joshua Lock
2012-01-12 16:22 ` Darren Hart
2012-01-10 17:39 ` [PATCH 2/3] alsa-state: move state files to localstatedir Joshua Lock
2012-01-12 16:23 ` Darren Hart
2012-01-10 17:39 ` [PATCH 3/3] task-base: add alsa-state to task-base-alsa Joshua Lock
2012-01-12 16:23 ` Darren Hart
2012-01-12 16:31 ` Martin Jansa
2012-01-13 18:54 ` Joshua Lock
2012-01-13 18:58 ` Martin Jansa
2012-01-10 19:34 ` [PATCH 0/3] Add alsa-state from OE Classic v2 Otavio Salvador
2012-01-10 19:45 ` Joshua Lock
2012-01-10 19:48 ` Otavio Salvador
2012-01-24 23:37 ` Joshua Lock
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox