Grating crackle/static occasionally shows up in playback

There is a problem that I currently have with Audacity. Every so often, I hear extremely grating crackle/static on the playback. I find it frustrating. It is getting to the point where I feel afraid to use Audacity, because I often say four-letter words and pound on the desk every time.

The distro that I currently have is OpenSuSE 13.2. What other information would you like to know to help me solve this problem?

There are many possible causes for crackle on playback.
What sort of computer do you have?
What sound card?
How are you listening to the music?
Does it only occur with particular files?
If you try playing the same file another time, will it play OK?
Does it still happen if you turn down the volume?
Are you running other applications at the same time?
Does rebooting your computer (temporarily) fix the problem?
What steps have you taken to diagnose the problem?
Anything else that you can think of that may help to diagnose the problem?

Here are the cards installed in my computer:

card 0: NVidia [HDA NVidia], device 0: ALC888 Analog [ALC888 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 1: ALC888 Digital [ALC888 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 2: ALC888 Alt Analog [ALC888 Alt Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

The computer I have is made from different parts, most of which were ordered from Newegg.com. I believe that I have 2GB of RAM installed in the computer. Perhaps more should be installed?

I can think of several things that may be going on. It is possible that Audacity may be having conflict with a few other programs. I am guessing that VLC and Firefox might be among those.

I might also be using a version of Audacity that is unstable. I can either get this program from the Packman repository or the regular one. I think I used the Packman one before, which I am guessing might be the more unstable one.

This crackle/static usually happens on some occasions whenever I attempt to do crossfade effects in an audio file, using more than one mono track. Perhaps I may not be doing this correctly. I usually choose “Add New Audio Track” from the Tracks menu whenever I want to do the crossfade or dissolve effect. I’ve read, though, that “Split New” from the Edit menu is what should be used for this.

Another possibility is that it has something to do with me occasionally using a track directly from video files. In some cases, the soundtracks are 48000Hz, as opposed to, say, 44100Hz. Perhaps I should make an audio-only track with 44100Hz first?

Whenever I check out an edit that I have just made, I also often play part of an audio for a very short time, like for only a few seconds. Do you think that might be causing the trouble I’m having as well?

One common cause of “crackling” is when the audio level goes above 0 dB. In digital audio* 0 dB is an absolute limit.
When two or more tracks play simultaneously, the amplitude is the sum of amplitudes in all tracks at that point. Thus it is easy to cause the peak level to exceed 0 dB when multiple tracks are playing, even when each of the tracks individually are well below 0 dB. If the audio exceeds 0 dB, the waveform is “clipped” on playback, which can sound like a “crackling distortion”. When this occurs, the playback meter in Audacity will show that the level hits 0 dB and a “clip indicator” will show (see: http://manual.audacityteam.org/o/man/meter_toolbar.html#playback).

The current version of Audacity is 2.1.1.
Unfortunately, some Linux distributions (notably “Ubuntu”) built Audacity with the wrong version of WxWidgets, so their official version has a number of bugs as a result of that. They are aware of the problem and it should be resolved once Audacity 2.1.2 becomes available. You can check your version of Audacity by looking in “Help > About Audacity”. The version number is at the top of the first tab. The version of WxWidgets should be 2.8.xx (where “xx” is at least 10). The WxWidgets version number is shown on the “Build Information” tab. Audacity 2.1.2 has not been released yet, but this requires WxWidgets 3.x.

What is your USB audio device?

Firefox will not normally interfere with Audacity unless you are critically short of RAM or disk space (2 GB should be adequate - I only have 3 GB on my machine and most of the time only about 1 GB is used). However, if you have had a page open that uses Flash player, then Flash will be running, and that may cause problems with other audio applications (Audacity). Some versions of Flash do not release the sound services correctly after use. Closing Firefox and restarting Audacity should fix this problem (temporarily).

If tracks are at a different sample rate than is supported natively by your sound card, then resampling must occur (either in Audacity, or somewhere within your computer’s sound system. This places additional load on the system that may cause crackling. This is most likely on very old or under-powered hardware.

*Digital audio is usually 8, 16 or 24 bit “integer”, which means that the amplitude of each sample is denoted by an integer number which is then “normalized” to a range of +/- 1. It is not possible to have a sample value outside of the range of +/- 1 because that is the point where you run out of “bits”. For example, the range for 4 bit (binary) numbers is from 0000 to 1111 and that is all. An exception to this rule is “floating point” format audio. Internally Audacity uses “32-bit float” representation for representing sample values, and this does support values outside of the range +/- 1, but sound cards don’t understand floating point, so the audio must be converted to “integer format” before being sent to the sound card, and that brings back the +/- 1 limit.

This is what I get when I run “lsusb”:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 002 Device 003: ID 08bb:2900 Texas Instruments PCM2900 Audio Codec
Bus 002 Device 002: ID 056a:0302 Wacom Co., Ltd
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

I think the “003” probably is the one that has to do with the USB audio. The number “002” is probably the drawing tablet, “004” is probably the wireless mouse, and the two “001”'s I am not sure of. The “Bus 001” ones are probably the front USB ports (which have nothing connected to them at the moment), and the “Bus 002” ones are probably the back USB ports.

I am aware of distortion if the sound is above 0dB, but I doubt that the volume of a sound file has anything to do with the current problem that I am having. I am guessing that it could be an overuse of hardware sources.

The version of Audacity that I currently have in my computer is 2.0.5. At the time that I wrote the first message, I believe I may have had version 2.1.1. At some point, I had installed Audacity from a different repository after writing the first message. The WxWidgets version that I currently have is 2.8.12.

Until recently, I had Kubuntu installed in my computer. After that, I switched to OpenSuSE, because I’ve read that many Linux distros have faulty forks of cdrtools in them. This past summer, I ordered and installed a Blu-ray burner into my computer. I have burnt two Blu-ray discs so far, and both times I received some sort of error messages when I used K3b for these processes, before switching over to OpenSuSE. I have yet to burn any discs using this distro.

I believe you are right about Flash affecting programs like Audacity. This is particularly noticeable after I go to a website like YouTube with the Firefox browser. In the past, I had problems with Audacity freezing, or with it playing audio really fast. This is because the audio source listed would switch over to “default,” or something like that.

I think you are also probably right about too much additional load on the sources used while playing audio on Audacity, especially after using another program that may use some of the same sources.

What playback device do you want to use? Can you post the contents of Help > Audio Device Info… top right of Audacity? It might give us some extra clues.

When you open a new project window, what is the project rate bottom left?

What desktop are you using? If it’s GNOME, I understand that OpenSUSE uses PulseAudio https://en.opensuse.org/SDB:Pulseaudio#Configuration. PulseAudio can be prone to freezing, cracking and skipping. That is what you experienced before when you chose “Default”.

At its simplest, you can bypass pulse by choosing the (hw) device in Audacity’s Device Toolbar.

Are you doing CTRL + W regularly to clear out Audacity’s temp folder?


Gale

The Audio Device Info is very long. It looks like it lists as many as 15 different devices, with 15 as the default selection. Here is a small part of text that I saw. Please let me know if you want the entire text, which I pasted into a separate text file that I saved.

Selected capture device: 15 - default
Selected playback device: 0 - HDA NVidia: ALC888 Analog (hw:0,0)
Supported Rates:
44100
48000
96000
192000

The rate displayed at the bottom left is 44100.

The desktop environment that I am using is KDE4. There are times in the past when “default” is selected automatically by Audacity itself. This seems to occur after I use another program with sound source, such as VLC and Firefox.

I had recently read about switching to an (hw) device, but I still get the occasional crackle or static - especially when I begin to play a small part of an audio again.

I had never thought of trying the CTRL + W idea. I could always try that. That is a good idea.

Now you have done it, we may as well see it, if you don’t mind. If you press the Code button above your message, then paste the information, it will be formatted nicely inside a scrolling box.


Gale

I have attached a text file that has the full list of these devices.

By the way, I have recently switched Linux distros again, from OpenSuSE to Ubuntu Studio, mainly because there seem to be limitations as to what one can do with FLV files in OpenSuSE. The Ubuntu-based distros have always been more familiar to me, in fact. So far, I have used Audacity a little bit in Ubuntu Studio. The only problem that I have run into, at this point, is Audacity freezing up once, and being forced to close the program. This has happened with me before, when I had used such distros as Kubuntu. I’ll have to read up on how to avoid having Audacity freezing up every now and then.
audacity device info.txt (5.45 KB)

Your list does not contain a pulse device, so was that list from when you still had OpenSUSE?

Ubuntu Studio uses PulseAudio, so see http://wiki.audacityteam.org/wiki/Linux_Issues#pulse.

You have never stated clearly what the USB device is (make and model number). Are you getting crackle on that, the built-in device, or both?


Gale

Yes, the list was when I had OpenSuSE installed for up to a couple of weeks.

I will also go to the link that you have provided in your reply.

[EDIT: I went to the link, and did go to it a few days back, after seeing another thread about this situation with Ubuntu-based distros. I did the suggestions mentioned in the link that you provided. I had also changed the Output Device to “HDA NVidia: ALC888 Analog (hw:0,0).” By the way, I currently have “ALSA” selected as Audio Host, and also currently have a choice of “OSS.” I believe “OSS” was not listed when I had OpenSuSE installed, though.]

About listing USB devices, what command(s) shall I type when opening up a Terminal type of program?
Or, where would the make and model number be mentioned on or in the USB devices?
I have two front USB ports, and (I believe) as many as about six in the back.
The crackle, though, I believe is probably not from a USB device, since the speakers that I currently have hooked up, for some time now, are connected to an output jack on the back of the computer.

Audacity’s support for OSS is untested. I would not use it unless it happens to solve your crackle problems.

Type the following (the first character is l for “lady”):

lsusb -v

Or you can see a simple listing of hardware and driver details including audio with:

inxi -Fx

If you don’t have inxi, type:

sudo apt-get install inxi

and follow the prompts.

Most likely on the device, or on the box or manual that came with it. But what is it in general terms? A USB cassette deck? USB turntable? USB mic with headphone port? USB headset with integral mic?

So you don’t want to use whatever this USB device is for playback, but want to use the speakers you mentioned? Does the crackle go away if you remove the USB device? I am guessing it might not.

What are the make and model number of the speakers? Have you tried connecting other speakers or headphones, to be sure the problem is not the speakers?

Do you have only that one audio output?


Gale

Regarding the “lsusb” command, how do I write the information that shows up into a text file? The amount of information is so lengthy, that some of the earlier text disappears whenever I run this in a shell program.

However, the “inxi” text is much shorter, so I can paste that information here:

System:    Host: john-TF520-A2 Kernel: 3.19.0-33-lowlatency x86_64 (64 bit, gcc: 4.8.2) 
           Desktop: Xfce 4.11.8 (Gtk 2.24.23) Distro: Ubuntu 14.04 trusty
Machine:   Mobo: TAR model: TF520-A2 version: 1.0 Bios: Phoenix version: 6.00 PG date: 05/18/2007
CPU:       Dual core AMD Athlon 64 X2 4200+ (-MCP-) cache: 1024 KB flags: (lm nx sse sse2 sse3 svm) bmips: 4018.64 
           Clock Speeds: 1: 1000.00 MHz 2: 1000.00 MHz
Graphics:  Card: NVIDIA G86 [GeForce 8400 GS] bus-ID: 04:00.0 
           X.Org: 1.17.1 drivers: nouveau (unloaded: fbdev,vesa) Resolution: 1440x900@59.9hz 
           GLX Renderer: Gallium 0.4 on NV86 GLX Version: 3.0 Mesa 10.5.9 Direct Rendering: Yes
Audio:     Card-1: NVIDIA MCP65 High Definition Audio driver: snd_hda_intel bus-ID: 00:07.0 
           Card-2: Texas Instruments PCM2900 Audio Codec driver: USB Audio usb-ID: 002-003 
           Sound: Advanced Linux Sound Architecture ver: k3.19.0-33-lowlatency
Network:   Card: Realtek RTL-8110SC/8169SC Gigabit Ethernet driver: r8169 ver: 2.3LK-NAPI port: cc00 bus-ID: 01:09.0
           IF: eth0 state: up speed: 1000 Mbps duplex: full mac: 00:e0:4d:2f:9e:27
Drives:    HDD Total Size: 1000.2GB (76.4% used) 1: id: /dev/sda model: ST1000DM003 size: 1000.2GB 
Partition: ID: / size: 25G used: 15G (61%) fs: btrfs ID: /home size: 888G used: 698G (83%) fs: ext4 
           ID: swap-1 size: 5.25GB used: 0.00GB (0%) fs: swap 
RAID:      No RAID devices detected - /proc/mdstat and md_mod kernel raid module present
Sensors:   System Temperatures: cpu: 18.0C mobo: N/A gpu: 54.0 
           Fan Speeds (in rpm): cpu: N/A 
Info:      Processes: 267 Uptime: 11 min Memory: 790.6/2000.0MB Runlevel: 2 Gcc sys: 4.8.4 
           Client: Shell (bash 4.3.11) inxi: 1.9.17



I don’t currently use any USB devices for sound output, although I did use such speakers previously. They are still in perfect working shape, though, but at some point, I had some difficulty configuring the computer and certain programs to make it come out of those speakers, so I eventually bought some that connect to a more conventional audio output jack in the back of the computer.

By the way, I currently have a USB turntable connected to the computer, and sometimes a webcam.

I can also connect speakers to a USB port, although I don’t have any connected there right now.

I doubt that the speakers are the problem, especially since the ones that I am currently using are rather new. I also have not tried headphones at this point. That’s something I could do. But I was guessing that it depends on what distro that I am using, and the sound card itself. So far, I haven’t received any of that crackle noise since switching from OpenSuSE to Ubuntu Studio. I have experience a freeze once so far, and, whenever certain programs run, such as VLC, the output device would switch to “default,” usually making Audacity playback run less smoothly.

I bought these rather new speakers online through Best Buy early this fall. So far, I am happy with them. The link to them at Best Buy is here:
http://tinyurl.com/ounp6fr



lsusb > lsusb.txt

Gale

I created the text file as you instructed. Without the “-v” switch, though, there is a lot less information. Therefore, I can easily post it here:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 002 Device 003: ID 08bb:2900 Texas Instruments PCM2900 Audio Codec
Bus 002 Device 002: ID 056a:0302 Wacom Co., Ltd
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Is it possible to also write the command results of “lsusb -v” into a text file? I get lots more text with the “-v” switch used. I attempted this with that switch included, by typing:

lsusb -v lsusb-v.txt

…but it said “Couldn’t open device, some information will be missing” five times.

Eventually, though, I was able to create such a text file with more detailed information, typing something like this:

cat >> lsusb -v lsusb-v.txt

The resulting text is included here as an attachment.

The odd thing, though, is that this idea only works occasionally.

I have tried the former idea again, but this time, I noticed that it did work, but it still said “Couldn’t open device, some information will be missing” five times. It also did not say, “lsusb -v” in the beginning of the resulted text.
lsusb-v.txt (58 KB)



lsusb -v  | tee lsusb-v.txt

which gives you a file and screen output.


Gale

Yes, it works quite well. Thanks.

Where would the output device switch to default, in Audacity? I don’t think that should happen, if Audacity was already set to the (hw:0,0) device.

But if you want to use (or have open) multiple audio applications at once, you should use the pulse device for Audacity playback.

Gale

I just tried out playing something in Audacity using “pulse,” but somehow, the playback is not very smooth. What shall I configure to remedy this situation?

You can play around with these settings: http://wiki.audacityteam.org/wiki/Linux_Issues#pulse.

Gale