alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* SND_PCM_STREAM_CAPTURE and SND_PCM_NONBLOCK producing strange artifacts
@ 2016-06-29  2:27 Trent Reed
  2016-07-02 21:58 ` Trent Reed
  0 siblings, 1 reply; 7+ messages in thread
From: Trent Reed @ 2016-06-29  2:27 UTC (permalink / raw)
  To: alsa-devel

Hey All,

I've been banging my head against the wall for about a week on this bug.
The following gist shows my sample reproduction code:
https://gist.github.com/TReed0803/985c5d5c3d295245e19006a27be447c3

I'm simply opening up a non-blocking PCM capture stream and writing the
contents of the reads to stdout.
(Originally, I was writing to the playback stream, but I was hearing this
strange static occasionally!)

It's the static I'm trying to debug. It doesn't happen every time. In fact,
sometimes I'll go a few consecutive executions without hearing it.
I was able to capture some of the bad data, and I loaded it up in Audacity
for visualization:
https://drive.google.com/file/d/0B-1aumGKQcQTcUJoZzIwRWhYSFE/view?usp=sharing

It looks like the internal buffer occasionally is sending me more data than
it actually captured, and I end up either reading old PCM data from the
internal ring buffer, or (at the very beginning) a bunch of zeros.

Can anyone help me understand what is going on? What could cause these
definitely incorrect samples to be recorded? (I get the same effect
regardless of hardware, but I will list hardware just in case.)

I hope I have all the information you might need:
Hardware: Samson Meteor Mic (USB-Audio, USB Mixer) [Though, it even happens
with my built-in microphone]
ALSA version: Advanced Linux Sound Architecture Driver Version
k4.4.0-28-generic.
apt-cache policy (installed alsa-lib version): 1.1.0-0ubuntu1

Thanks,
- Trent Reed

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-08-11 14:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-29  2:27 SND_PCM_STREAM_CAPTURE and SND_PCM_NONBLOCK producing strange artifacts Trent Reed
2016-07-02 21:58 ` Trent Reed
2016-07-05  6:52   ` Takashi Iwai
     [not found]     ` <CAL6pMWpwpgLBmqEhDnqKPvQPYmnSy1S=19m6YL=5YMpHQRfLtw@mail.gmail.com>
2016-07-05  7:38       ` Takashi Iwai
2016-07-05  8:46         ` Trent Reed
2016-08-06 19:13           ` Trent Reed
2016-08-11 14:32             ` Takashi Iwai

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).