[alsa-devel] Support for getting "manufacturer" from snd_seq_client_info and/or snd_ctl_card_info

Adam Goode agoode at chromium.org
Sun May 11 03:18:20 CEST 2014


I am doing a bit of work on the Alsa Web MIDI implementation in Chrome:

Web MIDI likes to know the "manufacturer" field as part of its API:

The current implementation in Chrome uses rawmidi, and then tries to parse
out the manufacturer from the longname of the card. This works reasonably
well, but is brittle and results in a lot of code.

I am working on a seq implementation for Chrome, to replace the rawmidi
implementation. I can retain the manufacturer extraction hack on the card,
but seq requires yet another hack to guess the card for a particular seq

Any suggestions on how to extract the manufacturer more easily? The best
solution would be to add a manufacturer (or vendor) field to the
snd_seq_client_info ioctl struct. This would likely require a new ioctl,
since there is only 64 bytes reserved in the current struct. I am guessing
this is not too likely to be accepted. (I would want to also add the same
manufacturer field to the snd_ctl_card_info.)

The next best solution would be to add a card field to snd_seq_client_info,
which could be optionally populated with the card that is associated to the

A completely different solution would be to add all this info to sysfs
which is easier to extend dynamically and won't require any ioctl changes
at all. (I kind of like this solution the best, but it would be a change
from the ioctl-based mechanisms done so far.)

Ultimately, if I am stuck guessing and parsing, that will work as long as
the underlying implementation doesn't change. But I would rather have a
more reliable solution going forward.

Any thoughts?


Adam Goode

More information about the Alsa-devel mailing list