hal: Branch 'master'
Danny Kukawka
dkukawka at kemper.freedesktop.org
Tue Nov 14 10:50:10 PST 2006
doc/spec/hal-spec-properties.xml | 24 +++++++++++++++++++++++-
hald/linux/device.c | 18 ++++++++++++++++++
2 files changed, 41 insertions(+), 1 deletion(-)
New commits:
diff-tree 2440190f73030e6550e97fec3f5f580166bb9181 (from 3d8bf144f9f2f8809baedc8b52631967db0e980b)
Author: Danny Kukawka <danny.kukawka at web.de>
Date: Tue Nov 14 18:41:10 2006 +0100
add hardware dependent/specific alsa sound devices to HAL
This adds support/detection of hardware specific ALSA Sound devices (as
e.g. Fortemedia FM801 PCI Audio with driver snd_fm801) to HAL. The driver
can use this devices freely for purposes that are not covered by standard
ALSA API (PCM, control, etc).
Also changed alsa.device_pcm_class from mandatory to not mandatory
because not all devices in the alsa namespace need to provide the property
(e.g. if they aren't a PCM device).
diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index 4931aae..4ebe9fd 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -4137,7 +4137,7 @@
<literal>alsa.device_pcm_class</literal> (string)
</entry>
<entry></entry>
- <entry>Yes</entry>
+ <entry>No</entry>
<entry>
The PCM class of the device.
</entry>
@@ -4242,6 +4242,28 @@
Stream is playback device.
</entry>
</row>
+ <row>
+ <entry></entry>
+ <entry>
+ <literal>unknown</literal>
+ </entry>
+ <entry></entry>
+ <entry>
+ The type of the device is unknown.
+ </entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry>
+ <literal>hw_specific</literal>
+ </entry>
+ <entry></entry>
+ <entry>
+ This is a hardware specific device (as e.g. from snd_fm801 for Fortemedia FM801
+ PCI Audio). The driver can use it freely for purposes that are not covered by
+ standard ALSA API.
+ </entry>
+ </row>
<row>
<entry></entry>
<entry>
diff --git a/hald/linux/device.c b/hald/linux/device.c
index 6c8c259..ebe80c2 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -678,6 +678,24 @@ sound_add (const gchar *sysfs_path, cons
} else
hal_device_property_set_string (d, "info.product", "ALSA Device");
}
+ } else if (sscanf (device, "hwC%dD%d", &cardnum, &devicenum) == 2) {
+
+ hal_device_property_set_string (d, "info.category", "alsa");
+ hal_device_add_capability (d, "alsa");
+ hal_device_property_set_string (d, "alsa.device_file", device_file);
+ hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
+ hal_device_property_set_string (d, "alsa.physical_device", hal_device_get_udi (parent_dev));
+ hal_device_property_set_int (d, "alsa.card", cardnum);
+ hal_device_property_set_int (d, "alsa.device", devicenum);
+
+ 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");
+
+ hal_device_property_set_string (d, "alsa.type", "hw_specific");
+
+ snprintf (buf, sizeof (buf), "%s ALSA hardware specific Device", hal_device_property_get_string (d, "alsa.card_id"));
+ hal_device_property_set_string (d, "info.product", buf);
+
} else if (!strncmp (device, "dsp", 3) || !strncmp (device, "adsp", 4) ||
!strncmp (device, "midi", 4) || !strncmp (device, "amidi", 5) ||
!strncmp (device, "audio", 5) || !strncmp (device, "mixer", 5)) {
More information about the hal-commit
mailing list