alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: sutar.mounesh@gmail.com
To: patch@alsa-project.org
Cc: alsa-devel@alsa-project.org,
	Alexander Jahn <ajahn@de.adit-jv.com>,
	Andreas Pape <apape@de.adit-jv.com>,
	mounesh_sutar@mentor.com
Subject: [PATCH 3/6] alsa-lib: pcm:dshare enable silence
Date: Fri, 30 Dec 2016 11:59:11 +0530	[thread overview]
Message-ID: <1483079351-28905-1-git-send-email-sutar.mounesh@gmail.com> (raw)

From: Alexander Jahn <ajahn@de.adit-jv.com>

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 <ajahn@de.adit-jv.com>
Signed-off-by: Andreas Pape <apape@de.adit-jv.com>

diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
index 4234d66..779845c 100644
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -1240,7 +1240,7 @@ 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);
-- 
1.7.9.5

             reply	other threads:[~2016-12-30  6:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-30  6:29 sutar.mounesh [this message]
2017-01-02 13:55 ` [PATCH 3/6] alsa-lib: pcm:dshare enable silence Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1483079351-28905-1-git-send-email-sutar.mounesh@gmail.com \
    --to=sutar.mounesh@gmail.com \
    --cc=ajahn@de.adit-jv.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=apape@de.adit-jv.com \
    --cc=mounesh_sutar@mentor.com \
    --cc=patch@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).