Hi, I have a proyect made in juce that runs fine in windows and osx, but now I’m testing it on linux (ubuntu 10.04 amd64), and having problems with the midi comunication.
to make it easier to spot out I’ve made a small program to send a midi sysex to a device that made that device answers with another sysex (like a network ping)
if I send the sysex using amidi everithng works:
$ amidi -l
Dir Device Name
IO hw:1,0,0 DigiTech GSP1101 MIDI 1
$ cat /dev/midi1 | hd &
$ amidi --port=hw:1,0,0 --send-hex="f0 00 00 10 7f 7f 7f 01 6e f7"
$ 00000000 f0 00 00 10 00 5f 01 02 00 00 5f 01 00 12 f7 f0 |....._...._.....|
but if I try doing so in juce it doesn’t work, what is worse it seams to not been any mesg send neither to the midi device (/dev/midi1) or the usb port where it is connected (sniffing using sudo cat /sys/kernel/debug/usb/usbmon/2u)
where is my juce test code:
String const GSP_1101_MIDI_ID = "DigiTech GSP1101";
struct MyCallback : public MidiInputCallback {
bool received;
MyCallback() : received(false) {}
virtual ~MyCallback() {}
virtual void handleIncomingMidiMessage (MidiInput *source, const MidiMessage &message) {
received = true;
cout << "Midi input received" << endl;
}
};
int main_ (int argc, char* argv[]) {
const ScopedJuceInitialiser_NonGUI juceSystemInitialiser;
MyCallback* cb = new MyCallback;
StringArray midevs = MidiInput::getDevices ();
MidiInput* mi = MidiInput::openDevice(midevs.indexOf(GSP_1101_MIDI_ID), cb);
StringArray modevs = MidiOutput::getDevices ();
MidiOutput* mo = MidiOutput::openDevice(modevs.indexOf(GSP_1101_MIDI_ID));
if (!mi || !mo) return -1;
mi->start();
unsigned char const echoTest[]= { 0x00, 0x00, 0x10, 0x7f, 0x7f, 0x7f, 0x01, 0x6e };
MidiMessage midiMessage = MidiMessage::createSysExMessage(echoTest, sizeof(echoTest));
mo->sendMessageNow(midiMessage);
cout << "Midi output sent" << endl;
while (!cb->received) {
Thread::sleep(200);
}
mi->stop();
delete mo;
delete mi;
delete cb;
return 0;
}
it runs untill the while loop where it never left
please any help would be very appreciated.
regards


