alsa-plugins icon indicating copy to clipboard operation
alsa-plugins copied to clipboard

crackling microphone

Open riddicc opened this issue 5 years ago • 5 comments

Hi!

When I send a 800Hz sine wave with rate 12345 to pcm.outmic and when I arecord from pcm.micend at rate 8000 with 1 channel (/etc/asound.conf), then I get a lot of tiny little gaps (see attachment) and a lot of messages like "overrun!!! (at least 0.014 ms long)" (the "ms" vary from 0.008 to 0.043; and arecord continues to record) and sometimes even this error: "arecord: xrun:1672: read/write error, state = RUNNING" (it causes arecord to terminate).

  1. speaker-test -D outmic -t sine -f 800 -c2 -r 12345

  2. arecord -D micend -r 8000 -c 1 -f S16_LE /tmp/bla.wav

twinkle makes even bigger gaps, when I let it use pcm.micend as microphone... But with hw:Generic,0,0 as mic device twinkle works fine... https://github.com/LubosD/twinkle/issues/207

"samplerate_best" and "samplerate_order" seems to make it worse...

How can I fix that?

Thx.

Bye.

audacity screenshot

riddicc avatar May 08 '20 08:05 riddicc

with some more plug-plugins (/etc/asound.conf) it works nicely... giggle :) w00t -arne

riddicc avatar May 08 '20 22:05 riddicc

oops... now the gaps are gone, when I use pcm.micend, but there is permanent noise and there are echoes that are not in hw:Generic,0,0...

in the log file i found this:

ALSA capture buffer settings. Rate = 8000 frames/sec Frame size = 2 bytes Periods = 8 Period size = 682 bytes Buffer size = 5456 bytes Can pause: no

seems like the period_size is funny...

-arne

riddicc avatar May 09 '20 06:05 riddicc

when I change the rate value in pcm.micnat from 48000 to 44100 plug:micnat sounds much better... now it is just the pcm.micmul, that does not work so good... but that is possibly caused by some other mistake in asound.conf... -arne

riddicc avatar May 09 '20 06:05 riddicc

  1. it seems like pcm.micnat still has some extra crackling... but it is acceptable...
  2. but: pcm.micmul stays bad...
  3. and: skype does not like to use pcm.default, if it points to plug:micnat with the asym plugin...

how can i fix it without using pulseaudio, which twinkle does not support?

-arne

riddicc avatar May 09 '20 11:05 riddicc

is it possible, that pcm.micnat crackles, because: the alsa-clock is different from the HD-Audio Generic clock?

if yes: how can i fix it without writing my own program, that reads from hw:Generic,0,0 at its native rate and injects at system-clock-48kHz to pcm.outmic?

-arne

riddicc avatar May 09 '20 16:05 riddicc