Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening MIDI devices on Linux always fails. Fix inside #492

Open
lkamp opened this issue Oct 21, 2022 · 3 comments
Open

Opening MIDI devices on Linux always fails. Fix inside #492

lkamp opened this issue Oct 21, 2022 · 3 comments

Comments

@lkamp
Copy link

lkamp commented Oct 21, 2022

I built from source on Arch Linux, version 5.6.0, downloaded from the GitHub releases page.

Opening a MIDI device always failed. I fixed the issue by changing CtrlrMIDIDevice.cpp line 54 from

outJucePtr = MidiOutput::openDevice (getProperty(Ids::midiDevIndex).toString()).release();

to

outJucePtr = MidiOutput::openDevice ((int)getProperty(Ids::midiDevIndex)).release();

Same thing has to be done on line 75 to open MIDI input.

This was only tested on current version of Arch Linux. No guarantee that it works on all platforms.

@keinstein
Copy link

keinstein commented Nov 12, 2022

Actually Midi Ports are two dimensional in Linux (ALSA) and each dimension may change independently. Flat port numbers change as soon as a device with a lower ALSA device number will change its number of ports. This may happen more often with software MIDI devices. The string representation is slightly better.

@keinstein
Copy link

You could try
outJucePtr = MidiOutput::openDevice (getProperty(Ids::midiDevId).toString()).release();
and

inJucePtr = MidiInput::openDevice (getProperty(Ids::midiDevId).toString(), this).release();

midiDevId is implemented in https://github.com/keinstein/ctrlr/tree/dehnhardt_midichanges which is based on #151
Could you try it, please?
If @dehnhardt agrees I could make a pull request for that.

@dehnhardt
Copy link
Contributor

I don't mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants