From: Clemens Ladisch <clemens@ladisch.de>
To: Krzysztof Foltman <wdev@foltman.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: proposed MPD16 latency workaround
Date: Thu, 16 Sep 2010 11:02:17 +0200 [thread overview]
Message-ID: <4C91DD19.5000005@ladisch.de> (raw)
In-Reply-To: <4C9154F4.8040304@foltman.com>
Krzysztof Foltman wrote:
> I've played with USB MIDI driver and MPD16 a bit more. The problem is
> definitely triggered by submitting URBs on the configuration input
> endpoint - when these are killed, the latency disappears. Disabling the
> configuration port works, but is a bit heavy-handed, so I've implemented
> a workaround: initially, the URBs for the input configuration endpoint
> are not submitted until two conditions are met:
>
> i) the control port is actually open (I check that using input_triggered
> bitmask)
>
> ii) the driver is switched into config mode by sending a special SysEx
> message to the output port (which is intercepted by the driver and used
> to set a flag). This is to prevent programs that open all the MIDI ports
> in the system (JACK daemon with ALSA MIDI driver, a2jmidid etc.) from
> starting unwanted communication with configuration endpoints.
This can be considered a bug in those programs.
> I'm mostly interested in the review of the general approach - I have
> some doubts about thread-safety of calling snd_usbmidi_input_update_ep
> from send function
I also have doubts, but I didn't look too much into this.
Since this device uses a completely vendor-dependent protocol, your
changes result in a driver that uses practically none of the common
code for the MPD16. Furthermore, your code makes it harder to maintain
the driver because these parts of the code cannot be tested without the
MPD16. In other words, I think that writing a separate driver would be
a better idea.
I'll see if I can write it until Monday; you'll just have to test it
and remove my bugs. :)
> and about the elegance of the SysEx approach (vs. ioctl or something
> else).
If the control port is used only by some specialized control
application, it doesn't matter too much which mechanism is used.
If the data port is already being used by it, the SysEx approach
would indeed be the simplest to use.
Regards,
Clemens
next prev parent reply other threads:[~2010-09-16 9:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-15 23:21 proposed MPD16 latency workaround Krzysztof Foltman
2010-09-16 9:02 ` Clemens Ladisch [this message]
2010-09-16 13:37 ` Krzysztof Foltman
2010-09-20 7:23 ` Clemens Ladisch
2010-09-21 10:01 ` Krzysztof Foltman
2010-09-21 11:22 ` Clemens Ladisch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C91DD19.5000005@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=wdev@foltman.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.