diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2014-12-09 00:10:48 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-12-10 10:49:33 +0100 |
commit | 05588d340a128ff5c7b768c517150e31842a78aa (patch) | |
tree | 60a509a34e46e8ff91fae1e2da6f821adfa0d8e6 /sound/firewire/oxfw/oxfw-stream.c | |
parent | 216e256f7bf974ba402309d0ceb24f3500dc65c4 (diff) | |
download | op-kernel-dev-05588d340a128ff5c7b768c517150e31842a78aa.zip op-kernel-dev-05588d340a128ff5c7b768c517150e31842a78aa.tar.gz |
ALSA: oxfw: Add support for capture/playback MIDI messages
This commit adds MIDI functionality with an assumption of 'if the device
has MIDI comformant data channels in its stream formation, the device has
one MIDI port'.
When no streams have already started, MIDI functionality starts stream
with current sampling rate.
When MIDI functionality has already starts some streams and PCM
functionality is going to start streams at different sampling rate,
this driver stops streams once and changes sampling rate, then restarts
streams for both PCM/MIDI substreams.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/oxfw/oxfw-stream.c')
-rw-r--r-- | sound/firewire/oxfw/oxfw-stream.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/firewire/oxfw/oxfw-stream.c b/sound/firewire/oxfw/oxfw-stream.c index 1d15428..a38b3c3 100644 --- a/sound/firewire/oxfw/oxfw-stream.c +++ b/sound/firewire/oxfw/oxfw-stream.c @@ -282,6 +282,10 @@ int snd_oxfw_stream_start_simplex(struct snd_oxfw *oxfw, err = snd_oxfw_stream_get_current_formation(oxfw, dir, &formation); if (err < 0) goto end; + if (rate == 0) + rate = formation.rate; + if (pcm_channels == 0) + pcm_channels = formation.pcm; if ((formation.rate != rate) || (formation.pcm != pcm_channels)) { if (opposite != NULL) { |