From: Alexander Jahn Date: Fri, 30 Dec 2016 06:29:11 +0000 (+0530) Subject: pcm: dshare: enable silence X-Git-Tag: android-x86-9.0-r1~368 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=8eeee1ab7d7db3110b7b3bb31cfb989304dced94;p=android-x86%2Fexternal-alsa-lib.git pcm: dshare: enable silence This issue depends on system load - if the process using dshare is scheduled fast enough, then there is no noise. A delay of e.g >~2ms produces hearable noise. Reproduction with instrumented aplay(sleep every 100th period for a given time): During the sleep time of 2000000us (2s) the hardware plays old samples in a loop before xrun is detected and recovered after the sleep. This is resolved by placing it in silence, in case of dshare plugin. Signed-off-by: Alexander Jahn Signed-off-by: Andreas Pape Signed-off-by: Takashi Iwai --- diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c index f5d922fd..0770abc4 100644 --- a/src/pcm/pcm_direct.c +++ b/src/pcm/pcm_direct.c @@ -1161,7 +1161,8 @@ int snd_pcm_direct_initialize_slave(snd_pcm_direct_t *dmix, snd_pcm_t *spcm, str return ret; } - if (dmix->type != SND_PCM_TYPE_DMIX) + if (dmix->type != SND_PCM_TYPE_DMIX && + dmix->type != SND_PCM_TYPE_DSHARE) goto __skip_silencing; ret = snd_pcm_sw_params_set_silence_threshold(spcm, &sw_params, 0);