From: Clemens Ladisch <clemens@ladisch.de>
To: Adarsh <punia.adarsh@gmail.com>, alsa-devel@alsa-project.org
Subject: Re: Need Help: Repeated Jackhammer noise after several hours of play and heavy cpu usage in snd_pcm_dmix_sync_area
Date: Thu, 20 Feb 2014 10:57:58 +0100 [thread overview]
Message-ID: <5305D1A6.6060401@ladisch.de> (raw)
In-Reply-To: <CANxfbX_o=UcTz0Sjno=zkEns4MGdrjnsbJmP0J=7O8owu7_8+g@mail.gmail.com>
Adarsh wrote:
> 2. However to disable the underruns, the
> snd_pcm_sw_params_set_stop_threshold is set to 0x7fffffff
This does not disable underruns; it just disables stopping the device
when an underrun happens.
> which is greater than boundary value.
Guess what happens on a 64-bit machine.
> 3.Period size is 1024 and buffer size is 2048.
Do you actually need that low a latency?
> 2. gdb is attached to the process and continued inside gdb.
This will result in an underrun.
When an underrun happens, the buffer is reported to contain less than
zero frames (i.e., the "avail" value is larger than the buffer size).
The program has to write samples _faster_ than normally to catch up.
Alternately, it could advance the pointer by calling snd_pcm_forward
(which might be a better idea because those samples won't be played
at the correct time anyway.)
You should reconsider setting the stop threshold.
> 3. At this point, the thread went into a tight loop taking >100% cpu
This is probably because of all the 'catch-up' samples that are being
mixed.
> Stack trace shows that 'snd_pcm_dmix_sync_area' in pcm_dmix.c is taking a
> very long time to return because the 'size' is
> a large unsinged interger and mix_areas is getting called with 'transfer'
> value of <=2048.
Hmmm, this might be a bug in the dmix plugin.
Regards,
Clemens
next prev parent reply other threads:[~2014-02-20 9:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-19 12:07 Need Help: Repeated Jackhammer noise after several hours of play and heavy cpu usage in snd_pcm_dmix_sync_area Adarsh
2014-02-19 15:16 ` Gabriel M. Beddingfield
2014-02-20 9:57 ` Clemens Ladisch [this message]
2014-02-20 11:07 ` Adarsh
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=5305D1A6.6060401@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=punia.adarsh@gmail.com \
/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