* linked streams question
@ 2007-07-05 7:53 Eliot Blennerhassett
2007-07-06 9:20 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Eliot Blennerhassett @ 2007-07-05 7:53 UTC (permalink / raw)
To: alsa-devel
Greetings,
I'm adding linked stream support to my driver (asihpi), and having some
trouble with the end of playback.
What happens is that the slave streams never transition to SETUP state at the
end of playback.
(Eg playing 4 channel wav file to 2 linked stereo streams with aplay).
The master stream reaches snd_pcm_drain_done() which then causes
trigger(stop), resulting in all linked streams being stopped.
But only the master state is set to SETUP
However, now the slave streams are stopped, period_elapsed() is not called
for a final time to (I assme) cause them to transition to the SETUP state.
Eventually I get "playback drain error (DMA or IRQ trouble?)\n"
My workaround is to set the state of each substream to SETUP in the
trigger-stop operator, but no other driver needs to do this so I think it is
probably the wrong solution - maybe misses some other cleanup code?
Any suggestions on the proper way to handle this?
regards
Eliot
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: linked streams question
2007-07-05 7:53 linked streams question Eliot Blennerhassett
@ 2007-07-06 9:20 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2007-07-06 9:20 UTC (permalink / raw)
To: Eliot Blennerhassett; +Cc: alsa-devel
At Thu, 05 Jul 2007 19:53:36 +1200,
Eliot Blennerhassett wrote:
>
> Greetings,
>
> I'm adding linked stream support to my driver (asihpi), and having some
> trouble with the end of playback.
>
> What happens is that the slave streams never transition to SETUP state at the
> end of playback.
> (Eg playing 4 channel wav file to 2 linked stereo streams with aplay).
>
> The master stream reaches snd_pcm_drain_done() which then causes
> trigger(stop), resulting in all linked streams being stopped.
> But only the master state is set to SETUP
>
> However, now the slave streams are stopped, period_elapsed() is not called
> for a final time to (I assme) cause them to transition to the SETUP state.
> Eventually I get "playback drain error (DMA or IRQ trouble?)\n"
>
> My workaround is to set the state of each substream to SETUP in the
> trigger-stop operator, but no other driver needs to do this so I think it is
> probably the wrong solution - maybe misses some other cleanup code?
snd_pcm_drain() has a loop to wait until the all substreams are
drained. That's why snd_pcm_drain_done() stops only one substream,
not all linked substreams.
But, yes, there seems to be a problem with hardware-linked substreams
that stops the multiple substreams. This mess comes from the fact
that we handle both soft-linked and hard-linked substreams as if they
are identical. We'd need a deeper clean up, I'm afraid.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-06 9:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-05 7:53 linked streams question Eliot Blennerhassett
2007-07-06 9:20 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.