Takashi Iwai wrote:
> Martin Langer wrote:
> > usb hotplug works perfect if my usbmidi client isn't aconnected to another
> > midi client. But the aconnected usb midi device still remains in the clients
> > list, after hotpluging out.
>
> yep,  when the connection exists, the connected devices (on both
> sides) are regarded as active.

The sequencer design allows asynchronous removal of clients.


--- alsa-kernel/core/seq/seq_device.c.orig      Wed Aug 14 18:11:13 2002
+++ alsa-kernel/core/seq/seq_device.c   Thu Nov 28 23:05:47 2002
@@ -92,6 +92,7 @@
 static int snd_seq_device_free(snd_seq_device_t *dev);
 static int snd_seq_device_dev_free(snd_device_t *device);
 static int snd_seq_device_dev_register(snd_device_t *device);
+static int snd_seq_device_dev_disconnect(snd_device_t *device);
 static int snd_seq_device_dev_unregister(snd_device_t *device);

 static int init_device(snd_seq_device_t *dev, ops_list_t *ops);
@@ -166,6 +167,7 @@
        static snd_device_ops_t dops = {
                .dev_free = snd_seq_device_dev_free,
                .dev_register = snd_seq_device_dev_register,
+               .dev_disconnect = snd_seq_device_dev_disconnect,
                .dev_unregister = snd_seq_device_dev_unregister
        };

@@ -265,6 +267,22 @@
                init_device(dev, ops);

        unlock_driver(ops);
+       return 0;
+}
+
+/*
+ * disconnect the device
+ */
+static int snd_seq_device_dev_disconnect(snd_device_t *device)
+{
+       snd_seq_device_t *dev = snd_magic_cast(snd_seq_device_t, device->device_data, 
+return -ENXIO);
+       ops_list_t *ops;
+
+       ops = find_driver(dev->id, 0);
+       if (ops == NULL)
+               return -ENOENT;
+
+       free_device(dev, ops);
        return 0;
 }




-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T 
handheld. Power & Color in a compact size! 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to