rawmidi: substream 0 is always selected, ignoring parameter
alsa-project/alsa-gobject issue #53 was opened from takaswie:
This issue is confirmed in v0.1.0 release.
`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.
Currently, the procedure in `ALSARawmidi.StreamPair.open()` to open Rawmidi character device is:
1. open control character device 2. ioctl call with SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE 3. close control character device 4. open rawmidi character device
The cause to ignore is step 3. After closing control character device, private structure assigned to file descriptor of control character device is dropped in kernel land. At step 4, the selection information is already lost and the first substream is assigned to file descriptor of rawmidi character device.
The solution is to keep file descriptor of control character device when opening rawmidi character device, thus the procedure should be:
1. open control character device 2. ioctl call with SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE 3. open rawmidi character device 4. close control character device
Issue URL : https://github.com/alsa-project/alsa-gobject/issues/53 Repository URL: https://github.com/alsa-project/alsa-gobject
participants (1)
-
GitHub issues - opened