Discussion:
[Alsa-user] Crackling Noise In Playback
Jay Foster
2017-05-04 15:24:20 UTC
Permalink
I have encountered a strange problem. About 6 months ago, I added a USB
sound adapter and alsa to an ARM based linux system. I used aplay to
play wav files successfully.
Now, the playback has a crackling noise in it. I can not find anything
that has changed. A few units still play with no noise, but I cannot
determine any difference between them and the ones with the noise.

One odd thing is if I run an application to make the CPU busy while
playing the audio wav file, the noise seems to go away. Any ideas on
where to look for the root cause?

Jay
chris hermansen
2017-05-04 15:50:44 UTC
Permalink
Jay and list,
Post by Jay Foster
I have encountered a strange problem. About 6 months ago, I added a USB
sound adapter and alsa to an ARM based linux system. I used aplay to
play wav files successfully.
Now, the playback has a crackling noise in it. I can not find anything
that has changed. A few units still play with no noise, but I cannot
determine any difference between them and the ones with the noise.
One odd thing is if I run an application to make the CPU busy while
playing the audio wav file, the noise seems to go away. Any ideas on
where to look for the root cause?
Jay
I have had a similar experience using an AudioQuest DragonFly and a CuBox
i4. In my case, errors were reported in syslog. Do you show any errors
there?

Do you have any other USB sound cards to try out?
--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.
Jay Foster
2017-05-04 16:23:05 UTC
Permalink
Post by chris hermansen
Jay and list,
I have encountered a strange problem. About 6 months ago, I added a USB
sound adapter and alsa to an ARM based linux system. I used aplay to
play wav files successfully.
Now, the playback has a crackling noise in it. I can not find anything
that has changed. A few units still play with no noise, but I cannot
determine any difference between them and the ones with the noise.
One odd thing is if I run an application to make the CPU busy while
playing the audio wav file, the noise seems to go away. Any ideas on
where to look for the root cause?
Jay
I have had a similar experience using an AudioQuest DragonFly and a
CuBox i4. In my case, errors were reported in syslog. Do you show
any errors there?
Do you have any other USB sound cards to try out?
--
Chris Hermansen · clhermansen "at" gmail "dot" com
C'est ma façon de parler.
I have tried 3 different USB audio dongles (all C-Media chip based). No
difference.
No messages in /var/log/messages.
I had to put the following in my /etc/asound.conf file to get clean
playback when I originally got this working (the CPU is too under
powered to do the default rate conversion).

defaults.pcm.rate_converter "linear"

The noise is also present using 'speakertest -c 2 -t wav'. What bugs me
is that this used to work fine, and still does if I make the CPU busy,
which seems counter intuitive.
Jay
chris hermansen
2017-05-04 19:12:23 UTC
Permalink
Jay and list,
Post by chris hermansen
Post by Jay Foster
I have encountered a strange problem. About 6 months ago, I added a USB
sound adapter and alsa to an ARM based linux system. I used aplay to
play wav files successfully.
Now, the playback has a crackling noise in it. I can not find anything
that has changed. A few units still play with no noise, but I cannot
determine any difference between them and the ones with the noise.
One odd thing is if I run an application to make the CPU busy while
playing the audio wav file, the noise seems to go away. Any ideas on
where to look for the root cause?
Jay
I have had a similar experience using an AudioQuest DragonFly and a CuBox
i4. In my case, errors were reported in syslog. Do you show any errors
there?
Do you have any other USB sound cards to try out?
I have tried 3 different USB audio dongles (all C-Media chip based). No
difference.
No messages in /var/log/messages.
I had to put the following in my /etc/asound.conf file to get clean
playback when I originally got this working (the CPU is too under powered
to do the default rate conversion).
defaults.pcm.rate_converter "linear"
The noise is also present using 'speakertest -c 2 -t wav'. What bugs me
is that this used to work fine, and still does if I make the CPU busy,
which seems counter intuitive.
Hmm. any reason you are doing rate conversions? Have you tried to play
your files with the hw:CARD=???,DEV=??? argument?
--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.
Jay Foster
2017-05-04 21:22:49 UTC
Permalink
Post by chris hermansen
Jay and list,
Post by Jay Foster
I have encountered a strange problem. About 6 months ago, I added a USB
sound adapter and alsa to an ARM based linux system. I used aplay to
play wav files successfully.
Now, the playback has a crackling noise in it. I can not find anything
that has changed. A few units still play with no noise, but I cannot
determine any difference between them and the ones with the noise.
One odd thing is if I run an application to make the CPU busy while
playing the audio wav file, the noise seems to go away. Any ideas on
where to look for the root cause?
Jay
I have had a similar experience using an AudioQuest DragonFly and
a CuBox i4. In my case, errors were reported in syslog. Do you
show any errors there?
Do you have any other USB sound cards to try out?
I have tried 3 different USB audio dongles (all C-Media chip
based). No difference.
No messages in /var/log/messages.
I had to put the following in my /etc/asound.conf file to get
clean playback when I originally got this working (the CPU is too
under powered to do the default rate conversion).
defaults.pcm.rate_converter "linear"
The noise is also present using 'speakertest -c 2 -t wav'. What
bugs me is that this used to work fine, and still does if I make
the CPU busy, which seems counter intuitive.
Hmm. any reason you are doing rate conversions? Have you tried to
play your files with the hw:CARD=???,DEV=??? argument?
--
Chris Hermansen · clhermansen "at" gmail "dot" com
C'est ma façon de parler.
Yes. Without it, the audio would keep pausing every 0.5 seconds with
underruns. The default rate scaling is too CPU intensive for my
platform. Using the linear rate conversion is what was recommended to
me by someone on this list, and seemed to work fine. Some of the audio
is 22050 Hz (mono) which needs to be scaled to 44100 Hz (the card only
supports 44100 and 48000 rates.

I am not familiar with the hw:CARD=???,DEV=??? argument. The aplay man
page and --help do not document it. I did try adding the '-D front'
option to aplay and the noise went away (yeah). I got the PCM name,
front, from the output of aplay -L.

Jay
Jay Foster
2017-05-04 21:39:16 UTC
Permalink
Post by Jay Foster
Post by chris hermansen
Jay and list,
Post by Jay Foster
I have encountered a strange problem. About 6 months ago, I
added a USB
sound adapter and alsa to an ARM based linux system. I used aplay to
play wav files successfully.
Now, the playback has a crackling noise in it. I can not find anything
that has changed. A few units still play with no noise, but I cannot
determine any difference between them and the ones with the noise.
One odd thing is if I run an application to make the CPU busy while
playing the audio wav file, the noise seems to go away. Any ideas on
where to look for the root cause?
Jay
I have had a similar experience using an AudioQuest DragonFly
and a CuBox i4. In my case, errors were reported in syslog. Do
you show any errors there?
Do you have any other USB sound cards to try out?
I have tried 3 different USB audio dongles (all C-Media chip
based). No difference.
No messages in /var/log/messages.
I had to put the following in my /etc/asound.conf file to get
clean playback when I originally got this working (the CPU is too
under powered to do the default rate conversion).
defaults.pcm.rate_converter "linear"
The noise is also present using 'speakertest -c 2 -t wav'. What
bugs me is that this used to work fine, and still does if I make
the CPU busy, which seems counter intuitive.
Hmm. any reason you are doing rate conversions? Have you tried to
play your files with the hw:CARD=???,DEV=??? argument?
--
Chris Hermansen · clhermansen "at" gmail "dot" com
C'est ma façon de parler.
Yes. Without it, the audio would keep pausing every 0.5 seconds with
underruns. The default rate scaling is too CPU intensive for my
platform. Using the linear rate conversion is what was recommended to
me by someone on this list, and seemed to work fine. Some of the
audio is 22050 Hz (mono) which needs to be scaled to 44100 Hz (the
card only supports 44100 and 48000 rates.
I am not familiar with the hw:CARD=???,DEV=??? argument. The aplay
man page and --help do not document it. I did try adding the '-D
front' option to aplay and the noise went away (yeah). I got the PCM
name, front, from the output of aplay -L.
Jay
With a bit more testing, I found that the '-D front' only works for two
channel audio files, not my mono files. I have found that '-Dplughw:0'
works for both. Thanks for pointing me there. I still need the scaling
too.
Jay
chris hermansen
2017-05-05 00:57:40 UTC
Permalink
Jay and list,
Post by chris hermansen
Post by Jay Foster
I have encountered a strange problem. About 6 months ago, I added a USB
sound adapter and alsa to an ARM based linux system. I used aplay to
play wav files successfully.
Now, the playback has a crackling noise in it. I can not find anything
that has changed. A few units still play with no noise, but I cannot
determine any difference between them and the ones with the noise.
One odd thing is if I run an application to make the CPU busy while
playing the audio wav file, the noise seems to go away. Any ideas on
where to look for the root cause?
Jay
I have had a similar experience using an AudioQuest DragonFly and a CuBox
i4. In my case, errors were reported in syslog. Do you show any errors
there?
Do you have any other USB sound cards to try out?
I have tried 3 different USB audio dongles (all C-Media chip based). No
difference.
No messages in /var/log/messages.
I had to put the following in my /etc/asound.conf file to get clean
playback when I originally got this working (the CPU is too under powered
to do the default rate conversion).
defaults.pcm.rate_converter "linear"
The noise is also present using 'speakertest -c 2 -t wav'. What bugs me
is that this used to work fine, and still does if I make the CPU busy,
which seems counter intuitive.
Hmm. any reason you are doing rate conversions? Have you tried to play
your files with the hw:CARD=???,DEV=??? argument?
--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.

Yes. Without it, the audio would keep pausing every 0.5 seconds with
underruns. The default rate scaling is too CPU intensive for my platform.
Using the linear rate conversion is what was recommended to me by someone
on this list, and seemed to work fine. Some of the audio is 22050 Hz
(mono) which needs to be scaled to 44100 Hz (the card only supports 44100
and 48000 rates.

I am not familiar with the hw:CARD=???,DEV=??? argument. The aplay man
page and --help do not document it. I did try adding the '-D front' option
to aplay and the noise went away (yeah). I got the PCM name, front, from
the output of aplay -L.

Jay

With a bit more testing, I found that the '-D front' only works for two
channel audio files, not my mono files. I have found that '-Dplughw:0'
works for both. Thanks for pointing me there. I still need the scaling
too.


I may well be wrong but I think plughw will take care of applying rate
converters for you...

What about converting your files before you play them?
Loading...