diff options
author | Danny Kukawka <danny.kukawka@web.de> | 2006-08-31 19:19:42 +0200 |
---|---|---|
committer | Danny Kukawka <danny.kukawka@web.de> | 2006-08-31 19:19:42 +0200 |
commit | fef0ddad7bd5853373cbbf430497d6ec16862cd7 (patch) | |
tree | 68cb7c27034a1001e926c61d061b619f1ee2c9ec | |
parent | cf4fa80cc891f9a254b3d47fd98eea834503a473 (diff) |
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)
-rw-r--r-- | doc/spec/hal-spec-properties.xml | 60 | ||||
-rw-r--r-- | hald/linux/classdev.c | 3 |
2 files changed, 63 insertions, 0 deletions
diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml index 72c2b336..c3ff5223 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 3e3a6679..98ab2bcb 100644 --- a/hald/linux/classdev.c +++ b/hald/linux/classdev.c @@ -657,6 +657,9 @@ sound_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *physdev 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); |