midi device only shown as OSS device?
Stefan Kost
ensonic at hora-obscura.de
Sat Mar 17 01:26:09 PDT 2007
Hi,
here the sysfs file is:
/sys/class/sound/midiC2D0
C2 means card2 and D0 device 0
but yes, it points to /dev/midi2. I will try to use it a such.
Stefan
Danny Kukawka wrote:
> On Mittwoch, 14. März 2007, Danny Kukawka wrote:
>> I ask the SUSE ALSA developer ...
>
> Due to the statement of Takashi Iwai the mapping of the names:
>
>> midi and midi[0-9] are OSS devices.
>> amidi and amidi[0-9] are OSS devices, too.
>
>> midiC[0-9]D[0-9] are ALSA devices.
>> midiC0D0 points the same physical device as OSS midi0, and midiC1D0
>> points amidi0.
>
> So the devices you listed in your mail (/sys/class/sound/midi2) are
> really OSS and not ALSA devices.
>
> I attached a patch to support the midiC* devices correct as ALSA
> devices.
>
> Danny
>
> device.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
>
> ------------------------------------------------------------------------
>
> diff --git a/hald/linux/device.c b/hald/linux/device.c
> index 74e440b..5d657f6 100644
> --- a/hald/linux/device.c
> +++ b/hald/linux/device.c
> @@ -953,7 +953,8 @@ sound_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_
> } else
> hal_device_property_set_string (d, "info.product", "ALSA Device");
> }
> - } else if (sscanf (device, "hwC%dD%d", &cardnum, &devicenum) == 2) {
> + } else if ((sscanf (device, "hwC%dD%d", &cardnum, &devicenum) == 2) ||
> + (sscanf (device, "midiC%dD%d", &cardnum, &devicenum) == 2)) {
>
> hal_device_property_set_string (d, "info.category", "alsa");
> hal_device_add_capability (d, "alsa");
> @@ -966,9 +967,13 @@ sound_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_
>
> asound_card_id_set (cardnum, d, "alsa.card_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"));
> + if (!strncmp (device, "hwC", 3)) {
> + 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"));
> + } else if (!strncmp (device, "midiC", 5)) {
> + hal_device_property_set_string (d, "alsa.type", "midi");
> + snprintf (buf, sizeof (buf), "%s ALSA MIDI 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) ||
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> hal mailing list
> hal at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/hal
More information about the hal
mailing list