[alsa-devel] How to add a new MIDI device to the usbaudio driver

Daniel Mack zonque at gmail.com
Wed Aug 24 12:29:45 CEST 2011


On Wed, Aug 24, 2011 at 12:14 PM, Kristian Amlie <kristian at amlie.name> wrote:
> On 08/24/11 10:32, Daniel Mack wrote:
>> Hmm? Can you trace where this happens and which dereferenced pointer
>> is NULL? I don't see it, sorry.
>
> The attached patch solves the NULL pointer dereference. With this patch,
> the device shows up as a MIDI device, but still produces no events
> according to aseqdump.

Eh, quite obvious. Thanks for spotting.

> I did a more thorough examination of the calls to usb_control_msg() from
> the ftdi_sio driver, and this is what I came up with:
>
> Plugging it in:
>
> Calling usb_control_msg() from read_latency_timer(): value=0, index=0
> Calling usb_control_msg() from write_latency_timer(): value=1, index=0
> usb 3-2: FTDI USB Serial Device converter now attached to ttyUSB0
>
> Starting cu:
>
> Calling usb_control_msg() from ftdi_open(): value=0, index=0
> Calling usb_control_msg() from ftdi_set_termios(): value=8, index=0
> Calling usb_control_msg() from change_speed(): value=16696, index=0
> Calling usb_control_msg() from ftdi_set_termios(): value=0, index=0
> Calling usb_control_msg() from update_mctrl(): value=771, index=0
> Calling usb_control_msg() from ftdi_set_termios(): value=8, index=0
> Calling usb_control_msg() from change_speed(): value=49230, index=0
> Calling usb_control_msg() from ftdi_set_termios(): value=0, index=0
> Calling usb_control_msg() from ftdi_set_termios(): value=8, index=0
> Calling usb_control_msg() from change_speed(): value=49230, index=0
> Calling usb_control_msg() from ftdi_set_termios(): value=0, index=0
> Calling usb_control_msg() from ftdi_set_termios(): value=8, index=0
> Calling usb_control_msg() from change_speed(): value=49230, index=0
> Calling usb_control_msg() from ftdi_set_termios(): value=4881, index=1024

Ok - can you play around with these commands and add them to the MIDI
driver? The stubs are all there now, and  I think all that's missing
is the termios call and maybe write_latency_timer(). I could prepare
another patch, but I think it's faster if you just try around which
command sequence helps :)


Daniel


More information about the Alsa-devel mailing list