[patch] spec: Update alsa namespace to include virtual device

Marc-André Lureau
2007-08-23T16:22:17Z

[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]

Hi

Thanks to the great work of Bluez-guys, bluez-utils audio service is
now able to deal with several audio devices. Those Bluetooth devices
are accessed by a "bluetooth" ALSA plugin (see
http://wiki.bluez.org/wiki/HOWTO/AudioDevices)

There is only a few missing pieces to make those devices discoverable with HAL.

The following patch changes the "alsa" namespace so that "virtual
devices" can also be described (a former approach was to use
alsa.virtual or alsa_virtual new namespace, but alsa.virtual does not
inherit alsa property, and both namespaces have a lot in common).

Thus, a mandatory property "is_hardware" is introduced. If this value
is true, the current mandatory keys remain mandatory. If not, then the
client should use "device_name" to "open" the device.

Arguable:
- should "device_name" be optional? (currently, application hard-code
the prefix "hw")
- "service" is used to make a difference between a2dp and hfp/hsp
- "device_name", and "service" key naming

Cheers,
--
Marc-André Lureau

[-- Attachment #2: 0001-spec-Update-alsa-namespace-to-include-virtual-devic.patch --]
[-- Type: text/x-diff, Size: 5086 bytes --]

From 229891a1a31882575a7c3d625801ffebad7fa5bd Mon Sep 17 00:00:00 2001
From: Marc-Andre Lureau (elmarco) <marcandre.lureau@gmail.com>
Date: Thu, 23 Aug 2007 19:21:04 +0300
Subject: [PATCH] spec: Update alsa namespace to include virtual device

---
doc/spec/hal-spec-properties.xml | 45 ++++++++++++++++++++++++++++++++------
1 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index 94bc171..0a65d5d 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -5007,7 +5007,7 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}


Device objects with the capability alsa
- represent all the streams available through ALSA on a soundcard.
+ represent all the audio devices available through ALSA. Those could be hardware or software "virtual devices".

<informaltable>
<tgroup cols="2">
@@ -5025,7 +5025,7 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
alsa.card (int)
</entry>
<entry></entry>
- <entry>Yes</entry>
+ <entry>If alsa.is_hardware is set to TRUE</entry>
<entry>
Card number in system as registered by ALSA.
</entry>
@@ -5037,7 +5037,7 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
<entry>
Examples: I82801DBICH4 , MP3
</entry>
- <entry>No</entry>
+ <entry>If alsa.is_hardware is set to TRUE</entry>
<entry>
Textual description of the card.
</entry>
@@ -5047,7 +5047,7 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
alsa.device (int)
</entry>
<entry></entry>
- <entry>Yes</entry>
+ <entry>If alsa.is_hardware is set to TRUE</entry>
<entry>
Device number assigned by ALSA for a current card.
</entry>
@@ -5057,13 +5057,24 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
alsa.device_file (string)
</entry>
<entry></entry>
- <entry>Yes</entry>
+ <entry>If alsa.is_hardware is set to TRUE</entry>
<entry>
The device node to access the ALSA device.
</entry>
</row>
<row>
<entry>
+ alsa.device_name (string)
+ </entry>
+ <entry>Examples: plug:"hw:0,1" , bluetooth:00:19:4F:DB:04:40,hifi
+ </entry>
+ <entry>Yes</entry>
+ <entry>
+ The device name to access the ALSA device.
+ </entry>
+ </row>
+ <row>
+ <entry>
alsa.device_id (string)
</entry>
<entry>
@@ -5071,7 +5082,7 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
</entry>
<entry>No</entry>
<entry>
- Textual description of the specific device for a card
+ Textual description of the specific device for a card, or virtual device
</entry>
</row>
<row>
@@ -5139,13 +5150,33 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
alsa.originating_device (string)
</entry>
<entry></entry>
- <entry>Yes</entry>
+ <entry>If alsa.is_hardware is set to TRUE</entry>
<entry>
UDI of the device the ALSA device is bound to.
</entry>
</row>
<row>
<entry>
+ alsa.is_hardware (bool)
+ </entry>
+ <entry></entry>
+ <entry>Yes</entry>
+ <entry>
+ TRUE if it is an hardware device. FALSE if it is a "virtual device".
+ </entry>
+ </row>
+ <row>
+ <entry>
+ alsa.service (string)
+ </entry>
+ <entry>example: Hifi , Voice </entry>
+ <entry>No</entry>
+ <entry>
+ Hint of use case of this device.
+ </entry>
+ </row>
+ <row>
+ <entry>
alsa.type (string)
</entry>
<entry></entry>
--
1.5.2.3

[-- Attachment #3: Type: text/plain, Size: 141 bytes --]