Crackling in audio after compiling external code in Ubuntu 16.04 LTS

I have recently been exploring existing solutions for converting media into MIDI files.  After I was done and went back to my work, I quickly found that the audio coming out of say… Google Translate’s pronunciation of “hello” or Audacity was crackling.

This isn’t a new experience for me, or Ubuntu users in general. So I quickly looked up my log of recently installed packages to see which ones were incompatible.  The command to do that is:

grep " install " /var/log/dpkg.log

Sometimes when I have installed various libraries/packages, Ubuntu goes ahead and believes it should use those instead of the per-existing ones.  These were all the packages that I had installed just prior to when the crackling began:

2017-08-16 11:22:39 install cvs:amd64 2:1.12.13+real-15 X removed.
2017-08-16 11:27:51 install libfftw3-long3:amd64 3.3.4-2ubuntu1 X removed.
2017-08-16 11:27:51 install libfftw3-quad3:amd64 3.3.4-2ubuntu1 X removed.
2017-08-16 11:27:52 install libfftw3-bin:amd64 3.3.4-2ubuntu1 X removed.
2017-08-16 11:27:52 install libfftw3-dev:amd64 3.3.4-2ubuntu1 X removed.
2017-08-16 11:28:33 install libogg-dev:amd64 1.3.2-1 X removed. -> crackling sound went away.
2017-08-16 11:28:33 install libflac-dev:amd64 1.3.1-4 X removed. ^
2017-08-16 11:28:33 install libvorbis-dev:amd64 1.3.5-3 X removed. ^
2017-08-16 11:28:34 install libsndfile1-dev:amd64 1.0.25-10ubuntu0.16.04.1 X removed. ^
2017-08-16 11:29:17 install libao-dev:amd64 1.1.0-3ubuntu1 X removed. ^
2017-08-16 11:30:59 install libsamplerate0-dev:amd64 0.1.8-8 X removed. ^
2017-08-16 11:32:20 install libtinfo-dev:amd64 6.0+20160213-1ubuntu1 X removed. ^
2017-08-16 11:32:20 install libncurses5-dev:amd64 6.0+20160213-1ubuntu1 X removed. ^

I don’t intend to continually build any of the applications I explored, so for now I just removed them till the sound was free of the crackle.


Oh, no! I broke ‘apt-get’ in Ubuntu

When using any sort of experimental tools – which anyone in R&D will want – you need to prepare yourself for broken packages and most answers on the web being only partially helpful.  As a computer graphics professional there’s also a good chance the broken packages might be graphics drivers – the very ones you need to see what is broken.

Over the years I’ve had my fair share of PPA-repositories not living up to standards and the worst is when the libraries themselves ( +inexperience ) cause apt to break in a way where the simplest solution:

sudo apt-get autoclean
sudo apt-get update
sudo apt-get -f install

… fails.

From experience it’s always good to install ppa-purge and aptitude together. To do that use the following command in the terminal:

sudo apt-get install ppa-purge aptitude

The reason you should install them together is because if ppa-purge fails, it falls back to aptitude calculations…and if you don’t have aptitude installed ppa-purge breaks your apt-get even more.

  • If you find yourself in that position, you’re going to avoid purging anything and totally integrate the ppa-repository ( completely commit to “becoming their computer”…at least for now ).  Once your apt-get can actually install something, install the two and then work on correcting the packages.  Finally if this is not possible, you have to install apt by hand.

Now that is out of the way, here are some useful commands when using apt / or apt-get in Ubuntu:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get -f install
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get clean

Then there the less direct methods – which involve flushing any cached files of apt or apt-get manually. Such as:

sudo rm /var/lib/apt/lists/* -vf

“Below” apt-get is a program called dpkg, which can be used to help in certain circumstances. I find these two commands useful at times:

sudo dpkg -r --force-all <package-name>
sudo dpkg --purge --force-all <package-name>

Blog at

Up ↑