hal: Branch 'master'
Danny Kukawka
dkukawka at kemper.freedesktop.org
Thu Aug 31 10:22:58 PDT 2006
doc/spec/hal-spec-properties.xml | 60 +++++++++++++++++++++++++++++++++++++++
hald/linux/classdev.c | 3 +
2 files changed, 63 insertions(+)
New commits:
diff-tree fef0ddad7bd5853373cbbf430497d6ec16862cd7 (from cf4fa80cc891f9a254b3d47fd98eea834503a473)
Author: Danny Kukawka <danny.kukawka at web.de>
Date: Thu Aug 31 19:19:42 2006 +0200
add property alsa.device_pcm_classi
This adds the property alsa.device_pcm_class to alsa devices to show if
the device is e.g. a generic sound device or a modem. The new property
represents the types of snd_pcm_info_t from the alsa lib (generic, modem,
multi, digitizer).
You need a kernel patch from Takashi Iwai which should be in 2.6.19
(see http://lists.freedesktop.org/archives/hal/2006-August/006012.html)
diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index 72c2b33..c3ff522 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -3912,6 +3912,66 @@
</row>
<row>
<entry>
+ <literal>alsa.device_pcm_class</literal> (string)
+ </entry>
+ <entry></entry>
+ <entry>Yes</entry>
+ <entry>
+ The PCM class of the device.
+ </entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry>generic</entry>
+ <entry></entry>
+ <entry>
+ A standard PCM sound device (SND_PCM_CLASS_GENERIC).
+ </entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry>multi</entry>
+ <entry></entry>
+ <entry>
+ A multichannel device PCM sound device (SND_PCM_CLASS_MULTI) which
+ e.g. contains a generic and a modem device.
+ </entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry>digitizer</entry>
+ <entry></entry>
+ <entry>
+ A PCM digitizer device (SND_PCM_CLASS_DIGITIZER).
+ </entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry>modem</entry>
+ <entry></entry>
+ <entry>
+ A PCM modem device (SND_PCM_CLASS_MODEM).
+ </entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry>unknown</entry>
+ <entry></entry>
+ <entry>
+ The value is 'unknown' if the kernel provide no information about the
+ PCM device class of the device (e.g. the file pcm_class is missing).
+ </entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry>none</entry>
+ <entry></entry>
+ <entry>
+ The value is 'none' if this there is no PCM class for this device.
+ </entry>
+ </row>
+ <row>
+ <entry>
<literal>alsa.physical_device</literal> (string)
</entry>
<entry></entry>
diff --git a/hald/linux/classdev.c b/hald/linux/classdev.c
index 3e3a667..98ab2bc 100644
--- a/hald/linux/classdev.c
+++ b/hald/linux/classdev.c
@@ -657,6 +657,9 @@ sound_add (const gchar *sysfs_path, cons
snprintf (aprocdir, sizeof (aprocdir), "%s/asound/card%d", get_hal_proc_path (), cardnum);
hal_util_set_string_from_file (d, "alsa.card_id", aprocdir, "id");
+
+ if (!hal_util_set_string_from_file (d, "alsa.pcm_class", sysfs_path, "pcm_class"))
+ hal_device_property_set_string (d, "alsa.pcm_class", "unknown");
snprintf (aprocdir, sizeof (aprocdir), "%s/asound/card%d/pcm%d%c",
get_hal_proc_path (), cardnum, devicenum, type);
More information about the hal-commit
mailing list