Skip to content
Commit 4c6239b1 authored by Robert Wu's avatar Robert Wu
Browse files

Don't call setInterface when querying protocol

calculateDefaultMidiProtocol() is a function that figures out the block
type of a specific MIDI device. This function is used whenever a MIDI 2.0
device is added.

Currently, connection.setInterface() is always called in this function.
When a different interface is set, the MIDI 1.0 interface in ALSA just stops.
/dev/snd/midiC1D0 is no longer exposed.

The solution in this CL is that Android should not call
connection.setInterface() until the MIDI 2.0 interface has opened. This
means that querying protocol on startup should not use setInterface.

This way, the MIDI 1.0 interface should work up until the MIDI 2.0
interface is actually used.

Bug: 216178160
Test: MidiScope and MidiKeyboard
Change-Id: I53d7792d6d331abcddea2d1aedb394ff4dee0a9c
parent 91cfa7ff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment