question about android.hardware.usb and midi interfaces
Linux - MobileThis forum is for the discussion of all topics relating to Mobile Linux. This includes Android, LiMo, Maemo, MeeGo, LiPS, Moblin, Openmoko, Ubuntu Mobile, Open Mobile Alliance and other similar projects and products.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
question about android.hardware.usb and midi interfaces
Hello,
I would like to know if android.hardware.usb could be useful to make an android device communicate with a midi usb interface.
I ask also if every midi usb interface adopt the same protocol.
In linux systems when I plug my Edirol UA4fx interface, it is detected and recognized, and later alsa can exploit it. I wonder if a driver for every midi interface is inside the system or just there is a protocol.
If yes where could I find documentation about it so to implement it with
android.hardware.usb?
And moreover, can alsa be ported to android like a c++ legacy library?
Any further information is welcome.
Thank you very much
I have written a lot of MIDI apps, mostly using the MidiShare framework (midishare.sourceforge.net). But like you, I wanted to get something going on Android, and after a lot of digging found some ideas and wrote a simple test program.
Not wanting to modify my stock Acer A-500 tablet (Android 3.2, Kernel 2.6.36.3), I decided to access the Midi USB adapter using the Usb Host classes provided in the SDK.
I tried two different USB Midi adapters, an Edirol UM-1 and an old Turtle Beach one (no model number on it, I think it's the only one they made under that name). Both worked with the same protocol, I just had to change the resources to match the different Vendor and Product ID's. All Midi data is transported in four-byte packets and no setup commands are required; just get USB permission, find the in and out block transfer endpoints, and use multiple threads to prevent stalling.
My test program so far just generates a few fixed NoteOn and NoteOff messages to test the output (played just fine on my Casio synthesizer) and printed the incoming MIDI messages in a TextView to check the input (received the Casio's keyboard messages fine).
The next step will be to implement code to send/receive MIDI to/from a standard midi file, and then to write a full application for a sequencer. But the important thing is proof of concept -- with the latest Android you CAN use a USB Midi interface (at least these two) without rooting the tablet and adding additional drivers.
Hi, I'm also looking to achieve this. At present, my USB-MIDI controller (non-branded) is unrecognised when plugged into an Android 3.1 Samsung Galaxy 10.1". I think the first step would be to get the hardware recognised and would appreciate direction. Thanks! pacman
I have written a lot of MIDI apps, mostly using the MidiShare framework (midishare.sourceforge.net). But like you, I wanted to get something going on Android, and after a lot of digging found some ideas and wrote a simple test program.
Not wanting to modify my stock Acer A-500 tablet (Android 3.2, Kernel 2.6.36.3), I decided to access the Midi USB adapter using the Usb Host classes provided in the SDK.
I tried two different USB Midi adapters, an Edirol UM-1 and an old Turtle Beach one (no model number on it, I think it's the only one they made under that name). Both worked with the same protocol, I just had to change the resources to match the different Vendor and Product ID's. All Midi data is transported in four-byte packets and no setup commands are required; just get USB permission, find the in and out block transfer endpoints, and use multiple threads to prevent stalling.
My test program so far just generates a few fixed NoteOn and NoteOff messages to test the output (played just fine on my Casio synthesizer) and printed the incoming MIDI messages in a TextView to check the input (received the Casio's keyboard messages fine).
The next step will be to implement code to send/receive MIDI to/from a standard midi file, and then to write a full application for a sequencer. But the important thing is proof of concept -- with the latest Android you CAN use a USB Midi interface (at least these two) without rooting the tablet and adding additional drivers.
Brian
Hey Brian,
I'm actually working on a same proof-of-concept like you were doing. I have already the permissions and threads. But now I'm stuck as I don't have much midi and low level expirience. It would be so great if you could post your proof-of-concept or at least a cool hint for the incoming part
#and printed the incoming MIDI messages in a TextView to check the input (received the Casio's keyboard messages fine).
I really cannot understand why that Java midi library I used on Linux and Windows is not on Android too, at least for tablets, because it is impossible that tablets have performances issues. So annoying.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.