1

A few days back I wrote question regarding MIDI and ALSA, but I've since solved the problem and run into a new one.

the context in short:

I have a Beaglebone Black with debian 7.5 on it.

My host is a 32bit Ubuntu 14.10 installation.

I'm using Qt4.8.6 for arm cross-compilation.

I am trying create an application which uses a touchscreen and also reads MIDI input from a keyboard. I've used the following tutorial (http://embedded.von-kannen.net/2014/05/21/qt-4-8-6-on-beaglebone-black/) to install Qt embedded so I can crosscompile to my beaglebone (Tutorial needs some fixes, I've got a 'fixed' doc ready if anyone needs one) and the following one to compile ALSA for use on an ARM MPU: omappedia.org/wiki/ALSA_Setup

Basically after I finally got the program building and deploying onto my beaglebone black it couldn't find the port it needs to receive the MIDI signals.

I'm using a MidiMate II to connect the MIDI device I'm using to a USB port on a HUB in my Beaglebone Black.

I have the following code to check for available ports (C++):

RtMidiIn  *midiin = 0;
// RtMidiIn constructor
try {
  midiin = new RtMidiIn();
}
catch ( RtMidiError &error ) {
  error.printMessage();
  exit( EXIT_FAILURE );
}
// Check inputs.
unsigned int nPorts = midiin->getPortCount();
qDebug() << "\nThere are " << nPorts << " MIDI input sources available.\n";
std::string portName;
for ( unsigned int i=0; i<nPorts; i++ ) {
  try {
    portName = midiin->getPortName(i);
  }
  catch ( RtMidiError &error ) {
    error.printMessage();
    delete midiin
  }
  std::cout << "  Input Port #" << i+1 << ": " << portName << '\n';
}

I can confirm that the MidiMate functions properly with Ubuntu. As running the application on desktop receives values just fine. I'm not certain of functionality on Debian for the BeagleBone.

The above code tells me there are no available input sources when ran on the Beaglebone, as opposed to the 2 available input sources when ran on both Ubuntu and Windows desktops.

my question: How can I get my Beaglebone to detect the port that I need for reading the live MIDI input?


edit:

plugging the midimate into the beaglebone generates a midi1 entry int the /dev/ list. however I don't know what and how to do with it.

the RtMidi function I use can only accept an unsigned integer as input so I can't provide the string "midi1" as an argument :(

poehalcho
  • 21
  • 4
  • Are the ALSA modules like `snd-seq-midi` loaded? Does the device show up in `/proc/asound/seq/clients`? – CL. Jan 15 '15 at 15:41
  • There is an entry called II in asound folder. seq is empty. I don't know how to check whether ALSA modules are loaded :S the II folder contains: id, midi0, oss_mixed, usbbus, usbid, usbmixer – poehalcho Jan 15 '15 at 15:59

1 Answers1

0

Your distribution does not load the snd-seq and snd-seq-midi kernel modules when booting, and has no mechanism to load them on demand either.

Add them to the /etc/modules file.

CL.
  • 173,858
  • 17
  • 217
  • 259
  • I added snd-seq and snd-seq-midi to the /etc/modules file. The previously empty /seq folder has stuff in it now. clients contains the following: http://pastebin.com/ymCaVYd6 . However my problem still seems to persist... the program doesn't detect a useful MIDI input source – poehalcho Jan 16 '15 at 10:32
  • I should point out that each of the entries in clients (128 and up) only showed up after running my application. – poehalcho Jan 16 '15 at 12:55
  • Is `snd-usb-audio` loaded (see `lsmod`)? – CL. Jan 16 '15 at 13:15
  • it wasn't initially. after using `modprobe snd-usb-audio` it shows in the lsmod list. Problem is not solved :/ – poehalcho Jan 16 '15 at 13:39
  • With all three modules loaded, does it show up in `clients`? – CL. Jan 16 '15 at 15:29
  • I believe only after the application starts running. I'm at home now so I can't confirm. I can check next monday. Thank you for your help so far. I thought I read something about getting portaudio serving as a fix (can't seem to trace back the source from home...), however I don't see how it would help considering it's an API of some sort :S. Does having it built provide additional services somehow or would this be a long shot? This whole business is for my internship, which is ending in 2 weeks. This port issue seems to be the last thing getting in my way and I'm eager to get it over with... – poehalcho Jan 16 '15 at 20:37
  • After the modules are loaded, nothing new shows up in `clients`. Here's a screenshot of my terminal with the entries in a variety of files to avoid confusion...: http://imgur.com/u3FRTq8 – poehalcho Jan 19 '15 at 08:33
  • Where is the `snd-rawmidi` module? Was it compiled into the kernel? Try unloading and reloading `snd-usb-audio`. – CL. Jan 19 '15 at 09:03
  • if try unloading snd-rawmidi it tells me: `FATAL: Module snd_rawmidi is builtin.`. So I'm guessing it was compiled into the kernel :? reloading snd_usb_audio doesn't really seem to do anything much... – poehalcho Jan 19 '15 at 09:26
  • I don't know if this is new progression or not. I swapped the cables (MIDImate has 2 midi cables, supposedly for input/output). After swapping them I could `cat /dev/midi1` and receive input from the keyboard (3 Bytes, as it should be the case, so the input is completely valid). The application still does not accept it though. Rather strange since we had previously marked the first cable as being the one that worked when used for desktop. Should I post my code to see if nothing is going wrong there? – poehalcho Jan 19 '15 at 11:32
  • The MIDI driver itself works fine; the problem is that it is not registered correctly with the ALSA sequencer. I suspect this might be related to the partially built-in modules; try recompiling the kernel with all sound drivers as modules. – CL. Jan 19 '15 at 11:37
  • How do I do that...? From what I've understood compiling a kernel is no child's play... Specifically how do I make the sound drivers as modules? It's not a very common thing to do, so information is scarce. I've seen it mentioned a few times but no details on how to do it. I'm looking at an elinux page on compiling kernels and I have no idea what I'm reading... btw, will this cause me to lose the files on the Beaglebone? I'm guessing it's not the case since the kernel is saved in a protected memory area. I'm sorry for my mild incompetence... – poehalcho Jan 19 '15 at 12:50