]> git.alsa-project.org Git - alsa-gobject.git/commit
rawmidi: stream_pair: fix to select substream topic/fix-rawmidi-substream
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 16 Nov 2020 13:27:54 +0000 (22:27 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 16 Nov 2020 13:29:20 +0000 (22:29 +0900)
commit089d204e75b109eadcc24e9db593f9d86e0af867
tree28785ddc0b2b3f22cc55aac43c19297e98ea953f
parent3738f77ea2b3b81355b7b2ef6447fe43fd2fe71e
rawmidi: stream_pair: fix to select substream

ALSARawmidi.StreamPair.open() has subdevice_id to select one of
substreams supported by the Rawmidi device. However, this parameter is
ignored and the first substream is always selected.

In ALSA rawmidi core, private structure associated to file descriptor
to control character device assists selection of rawmidi substream.
It requires to keep the file descriptor until the selected substream
is actually attached by open rawmidi character device.

Current implementation of libalsarawmidi is to close the file descriptor
before opening rawmidi character device. This is the cause of the issue.

This commit fixes the bug by keeping the file descriptor till opening
rawmidi character device.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/rawmidi/privates.h
src/rawmidi/query.c
src/rawmidi/stream-pair.c