Openembedded Core Discussions
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Add alsa-state from OE Classic
@ 2012-01-03  2:26 Joshua Lock
  2012-01-03  2:26 ` [RFC PATCH 1/2] alsa-state: add alsa-state from oe classic Joshua Lock
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Joshua Lock @ 2012-01-03  2:26 UTC (permalink / raw)
  To: openembedded-core

Please review the following changes for suitability for inclusion. If you have
any objections or suggestions for improvement, please respond to the patches. If
you agree with the changes, please provide your Acked-by.

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.

Cheers.
Joshua

The following changes since commit 8f348ccad083d6c02c200652ff6295e701e88f0d:

  coreutils: ensure --color works so DEPEND on libcap (2011-12-24 10:05:35 +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 (2):
  alsa-state: add alsa-state from oe classic
  task-base: add alsa-state to task-base-alsa

 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 +
 meta/recipes-core/tasks/task-base.bb               |    5 +-
 5 files changed, 102 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.4




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC PATCH 1/2] alsa-state: add alsa-state from oe classic
  2012-01-03  2:26 [RFC PATCH 0/2] Add alsa-state from OE Classic Joshua Lock
@ 2012-01-03  2:26 ` Joshua Lock
  2012-01-03  2:26 ` [RFC PATCH 2/2] task-base: add alsa-state to task-base-alsa Joshua Lock
  2012-01-04  0:43 ` [RFC PATCH 0/2] Add alsa-state from OE Classic Saul Wold
  2 siblings, 0 replies; 5+ messages in thread
From: Joshua Lock @ 2012-01-03  2:26 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.4




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RFC PATCH 2/2] task-base: add alsa-state to task-base-alsa
  2012-01-03  2:26 [RFC PATCH 0/2] Add alsa-state from OE Classic Joshua Lock
  2012-01-03  2:26 ` [RFC PATCH 1/2] alsa-state: add alsa-state from oe classic Joshua Lock
@ 2012-01-03  2:26 ` Joshua Lock
  2012-01-04  0:43 ` [RFC PATCH 0/2] Add alsa-state from OE Classic Saul Wold
  2 siblings, 0 replies; 5+ messages in thread
From: Joshua Lock @ 2012-01-03  2:26 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.4




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH 0/2] Add alsa-state from OE Classic
  2012-01-03  2:26 [RFC PATCH 0/2] Add alsa-state from OE Classic Joshua Lock
  2012-01-03  2:26 ` [RFC PATCH 1/2] alsa-state: add alsa-state from oe classic Joshua Lock
  2012-01-03  2:26 ` [RFC PATCH 2/2] task-base: add alsa-state to task-base-alsa Joshua Lock
@ 2012-01-04  0:43 ` Saul Wold
  2012-01-04  0:53   ` Joshua Lock
  2 siblings, 1 reply; 5+ messages in thread
From: Saul Wold @ 2012-01-04  0:43 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 01/02/2012 06:26 PM, Joshua Lock wrote:
> Please review the following changes for suitability for inclusion. If you have
> any objections or suggestions for improvement, please respond to the patches. If
> you agree with the changes, please provide your Acked-by.
>
> 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.
>
Will this address the similar issue that the n450-audio recipe does in 
the meta-intel layer?  The n450 seems to use amixer and not alsactl.

And if so, can you provide a patch for meta-intel?

Sau!

> Cheers.
> Joshua
>
> The following changes since commit 8f348ccad083d6c02c200652ff6295e701e88f0d:
>
>    coreutils: ensure --color works so DEPEND on libcap (2011-12-24 10:05:35 +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 (2):
>    alsa-state: add alsa-state from oe classic
>    task-base: add alsa-state to task-base-alsa
>
>   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 +
>   meta/recipes-core/tasks/task-base.bb               |    5 +-
>   5 files changed, 102 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
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH 0/2] Add alsa-state from OE Classic
  2012-01-04  0:43 ` [RFC PATCH 0/2] Add alsa-state from OE Classic Saul Wold
@ 2012-01-04  0:53   ` Joshua Lock
  0 siblings, 0 replies; 5+ messages in thread
From: Joshua Lock @ 2012-01-04  0:53 UTC (permalink / raw)
  To: Saul Wold; +Cc: Patches and discussions about the oe-core layer

On 03/01/12 16:43, Saul Wold wrote:
> On 01/02/2012 06:26 PM, Joshua Lock wrote:
>> Please review the following changes for suitability for inclusion. If
>> you have
>> any objections or suggestions for improvement, please respond to the
>> patches. If
>> you agree with the changes, please provide your Acked-by.
>>
>> 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.
>>
> Will this address the similar issue that the n450-audio recipe does in
> the meta-intel layer? The n450 seems to use amixer and not alsactl.

That's the intent. The beagleboard-audio recipe in meta-yocto also uses 
amixer not alsactl but alsactl and the alsa-state recipe offers more 
functionality IMHO (and fewer dependencies iirc).

>
> And if so, can you provide a patch for meta-intel?

Can do, I've already got one for meta-yocto prepared but was waiting for 
some C's before submitting.

Joshua
-- 
Joshua Lock
         Yocto Project "Johannes factotum"
         Intel Open Source Technology Centre



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-04  1:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-03  2:26 [RFC PATCH 0/2] Add alsa-state from OE Classic Joshua Lock
2012-01-03  2:26 ` [RFC PATCH 1/2] alsa-state: add alsa-state from oe classic Joshua Lock
2012-01-03  2:26 ` [RFC PATCH 2/2] task-base: add alsa-state to task-base-alsa Joshua Lock
2012-01-04  0:43 ` [RFC PATCH 0/2] Add alsa-state from OE Classic Saul Wold
2012-01-04  0:53   ` Joshua Lock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox