rawmidi: substream 0 is always selected, ignoring parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux