[LAD] sequencer and sysex again

From: <rdxesy@email-addr-hidden>
Date: Fri Jun 06 2008 - 20:30:49 EEST

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
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Sat Jun 7 00:15:03 2008

This archive was generated by hypermail 2.1.8 : Sat Jun 07 2008 - 00:15:03 EEST