Fix resume of dmix, dsnoop and dshare plugins

Fix the resume of dmix, dsnoop and dshare plugins.

[This replaces the timer mode with TREAD mode, and may trigger Oops
 with the older kernel...]
This commit is contained in:
Takashi Iwai 2005-03-15 11:39:51 +00:00
parent 4e992e3424
commit dab2b58e0e
4 changed files with 47 additions and 14 deletions

View file

@ -202,7 +202,7 @@ static snd_pcm_state_t snd_pcm_dshare_state(snd_pcm_t *pcm)
snd_pcm_direct_t *dshare = pcm->private_data;
switch (snd_pcm_state(dshare->spcm)) {
case SND_PCM_STATE_SUSPENDED:
return -ESTRPIPE;
return SND_PCM_STATE_SUSPENDED;
case SND_PCM_STATE_DISCONNECTED:
dshare->state = SNDRV_PCM_STATE_DISCONNECTED;
return -ENOTTY;
@ -379,10 +379,10 @@ static snd_pcm_sframes_t snd_pcm_dshare_forward(snd_pcm_t *pcm, snd_pcm_uframes_
return frames;
}
static int snd_pcm_dshare_resume(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
static int snd_pcm_dshare_resume(snd_pcm_t *pcm)
{
// snd_pcm_direct_t *dshare = pcm->private_data;
// FIXME
snd_pcm_direct_t *dshare = pcm->private_data;
snd_pcm_resume(dshare->spcm);
return 0;
}
@ -430,6 +430,14 @@ static snd_pcm_sframes_t snd_pcm_dshare_mmap_commit(snd_pcm_t *pcm,
snd_pcm_direct_t *dshare = pcm->private_data;
int err;
switch (snd_pcm_state(dshare->spcm)) {
case SND_PCM_STATE_XRUN:
return -EPIPE;
case SND_PCM_STATE_SUSPENDED:
return -ESTRPIPE;
default:
break;
}
snd_pcm_mmap_appl_forward(pcm, size);
if (dshare->state == SND_PCM_STATE_RUNNING) {
err = snd_pcm_dshare_sync_ptr(pcm);