[alsa-devel] RawMIDI behaviour with MidiFace 4x4

Ricard Wanderlof ricard.wanderlof at axis.com
Mon Mar 9 15:29:08 CET 2015


On Mon, 9 Mar 2015, Clemens Ladisch wrote:

> Ricard Wanderlof wrote:
> > On Sat, 7 Mar 2015, Kalvas, Taneli wrote:
> >> I am developing a patch librarian for a synthesizer. Because the
> >> communication happens with Midi sysex and timing is not relevant I chose
> >> RawMIDI interface and not the alsa sequencer. The problem I have
> >> encountered is that writing to the midi port with snd_rawmidi_write()
> >> seems to broken. The function accepts any size of data block and claims
> >> to have sent everything. In reality only a part of the message is sent.
> >> For a large block size I can see the activity light blinking for
> >> fraction of a second. This happens both in blocking and non-blocking
> >> mode. I would expect the snd_rawmidi_write() to accept only a part of
> >> the message.
> >
> > Can't help with rawmidi, but I can at least report that my experience
> > using the sequencer interface has been that it is rather straightforward
> > to use, even if just using it to send and transmit sysex data, even when
> > the data is longer than 300 bytes.
> 
> If the data is larger than the RawMIDI buffer size (4096 bytes), the
> sequencer does not wait (like snd_rawmidi_write() would do), but just
> drops data.

Interesting. Thanks for the info. I've only tried sending patch dumps for 
single synthesizer patches, in the region of 400 bytes, which are more 
than 300 but far less than 4096 obviously.

I have noted though, that when sending data with snd_seq_ev_set_sysex() 
that the ALSA lib internally copies the data to an internal, malloced 
buffer, so I always thought that it would take care of any amount of data 
from there, but apparently not then?

/Ricard
-- 
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30


More information about the Alsa-devel mailing list