Closed davidedelvento closed 1 year ago
The underlying MIDI framework of the OS needs to support the device. What are you running on the Odroid? If it's Linux/ALSA, check whether the device is listed with amidi -l
and/or aplay -l
, if you're using JACK, check with jack_lsp
.
Thanks @SpotlightKid
Yes, it's Linux/ALSA. The amidi -l
correctly returns the phone as a MIDI device (the way I want to utilize it), and aplay
doesn't.
$ amidi -l
Dir Device Name
IO hw:1,0,0 SAMSUNG_Android MIDI 1
Kernel modules are identical to the ones in my desktop:
$ lsmod | grep -i mid
snd_seq_midi 16384 0
snd_seq_midi_event 16384 1 snd_seq_midi
snd_seq 57344 2 snd_seq_midi_event,snd_seq_midi
snd_usbmidi_lib 28672 1 snd_usb_audio
snd_rawmidi 28672 2 snd_seq_midi,snd_usbmidi_lib
snd_seq_device 16384 3 snd_seq,snd_rawmidi,snd_seq_midi
Still, empty list from get_ports()
aplay
is for audio. Check aplaymidi -l
whether the ALSA sequencer output ports are there.
aplay
is for audio. Checkaplaymidi -l
whether the ALSA sequencer output ports are there.
Yes it is
$ aplaymidi -l
Port Client name Port name
14:0 Midi Through Midi Through Port-0
20:0 SAMSUNG_Android SAMSUNG_Android MIDI 1
What does this return?
import rtmidi
rtmidi.get_compiled_api()
What does this return?
import rtmidi rtmidi.get_compiled_api()
Just [5]
Then ALSA support was not compiled in. Please check the install instructions in the docs. Make sure you have the ALSA headers/libs installed. If the distro is debian-based, you need to install a special ALSA dev package. Then recompile/-install.
Awesome, that was it. It's now working perfectly. I greatly appreciate your quick response and your patience, @SpotlightKid you are the best!
For others who may land on this issue and wonder about the nitty gritty details, installing the dev package for my distro and recompile rtmidi is a simple matter of
apt install libasound2-dev
pip uninstall python-rtmidi
pip install --no-cache-dir python-rtmidi
This is not strictly a
python-rtmidi
question, but I hope you can point me in the right direction.I connect my phone via USB on my Linux desktop box, select MIDI on the phone and everything works fine. In particular, the following shows the phone name:
I do the same on an embedded platform (Odroid XU4), where I really need to do this (the Desktop is only for development/debugging) and it returns the empty list. The phone still thinks it is connected to a midi device. I suspect I am missing something (perhaps a kernel module?) but I don't know what. Ideas on what it might be?
Thanks in advance!