[LAD] sequencer and sysex again

rdxesy at yahoo.de rdxesy at yahoo.de
Fri Jun 6 17:30:49 UTC 2008


hey,

when i request a lot of parameters in one function:

get_channel_setup_settings(void)
{
    pmesg(100, "midi get_channel_setup_settings()\n");

    int i;
    for (i = 367; i <= 415; i++)
    {
        param_request(i);
    }
    for (i = 512; i <= 639; i++)
    {
        param_request(i);
        usleep(100000);
    }
}

(param_request just sends a sysex message for the requested 
parameter)

then i discover some weirdness:

midi get_channel_setup_settings()
midi param_request()
midi nibble(367, 1)
midi sysex_delivery()
midi midi_callback() ENTERING
midi unibble(111, 2)
midi unibble(4, 0)
midi midi_callback() got param: 367, value: 4
midi param_request()
midi nibble(368, 1)
midi sysex_delivery()
midi param_request()
midi nibble(369, 1)
midi sysex_delivery()
midi param_request()
....
parameter requests only, until the last parameter:
...
midi param_request()
midi nibble(639, 1)
midi sysex_delivery()
midi set_spinbutton() <- rest of midi_callback() from above
midi midi_callback() ENTERING
midi unibble(112, 2)
midi unibble(0, 0)
midi midi_callback() got param: 368, value: 0
...
(midi_callback is catching the received answers. its 
running in another thread)
...
midi unibble(51, 4)
midi unibble(51, 0)
midi midi_callback() got param: 563, value: 51
midi set_spinbutton()
.


now there are two things i dont understand:
first: why is the midi_callback() thread being called once 
at the beginning, right after the very first parameter 
request and then never again until the very last request?

second: why does the midi_callback() thread only receive 
the parameters up to 563 where the last request was for 
parameter 639? i am missing the remaining parameters! :-)

about the second weirdness: this can only be a problem on 
the receivers side (alsa) as i gave the device i am sending 
to more than enough time to answer before its "message 
receive buffer" could ever be filled (see the usleeps after 
every request). i would guess that some alsa side buffer is 
filled up and alsa just drops the rest.

solutions would be:
1. call the midi_callback() thread more often
2. resize the alsa midi input buffer to something more big.

how would i do any of this, preferably 1.?

thank you,
Jan



More information about the Linux-audio-dev mailing list