]> git.alsa-project.org Git - alsa-gobject.git/commit
rawmidi: stream_pair: fix to select substream
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 16 Nov 2020 13:27:54 +0000 (22:27 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Mon, 16 Nov 2020 23:40:05 +0000 (08:40 +0900)
commit9c1f5f3af766156f7d22c46c2d08a3fae4da2dd0
tree28785ddc0b2b3f22cc55aac43c19297e98ea953f
parent6c9f09adb2b01ee1003606768cf6ae236229e389
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