summaryrefslogtreecommitdiffstats
path: root/sound/firewire/dice/dice-pcm.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-12-09 00:10:36 +0900
committerTakashi Iwai <tiwai@suse.de>2014-12-10 10:44:54 +0100
commit9a02843caefbc370ef6d5895881101f9436f98da (patch)
tree7dd629455220cf9e20f79bd8be51805b905058f4 /sound/firewire/dice/dice-pcm.c
parent288a8d0cb04f7715c7c302c8a40bdb227142f3a6 (diff)
ALSA: dice: Add support for duplex streams with synchronization
This commit adds support for AMDTP in-stream. As a result, Dice driver supports full duplex streams with synchronization. AMDTP can transfer timestamps in its packets. By handling the timestamp, devices can synchronize to the other devices or drivers on the same bus. When Dice chipset is 'enabled', it starts streams with correct settings. This 'enable' register is global, thus, when a stream is started to run, an opposite stream can't start unless turning off 'enable'. Therefore a pair of streams must be running. This causes a loss of CPU usage when single stream is needed for neither playbacking or capturing. This commit assumes that playback-only models also have a functionality to transmit stream for delivering timestamps. Currently, sampling clock source is restricted to SYT-Match mode. This is improved in followed commit. I note that at SYT-Match mode, Dice can select from 4 streams for synchronization but this driver uses the 1st stream only for simplicity. 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/dice/dice-pcm.c')
-rw-r--r--sound/firewire/dice/dice-pcm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/firewire/dice/dice-pcm.c b/sound/firewire/dice/dice-pcm.c
index b185391dc02..b9ce0264a2d 100644
--- a/sound/firewire/dice/dice-pcm.c
+++ b/sound/firewire/dice/dice-pcm.c
@@ -181,7 +181,7 @@ static int playback_hw_free(struct snd_pcm_substream *substream)
struct snd_dice *dice = substream->private_data;
mutex_lock(&dice->mutex);
- snd_dice_stream_stop(dice);
+ snd_dice_stream_stop_duplex(dice);
mutex_unlock(&dice->mutex);
return snd_pcm_lib_free_vmalloc_buffer(substream);
@@ -193,7 +193,7 @@ static int playback_prepare(struct snd_pcm_substream *substream)
int err;
mutex_lock(&dice->mutex);
- err = snd_dice_stream_start(dice, substream->runtime->rate);
+ err = snd_dice_stream_start_duplex(dice, substream->runtime->rate);
mutex_unlock(&dice->mutex);
if (err >= 0)
amdtp_stream_pcm_prepare(&dice->rx_stream);