Audacity's "default" mp3 decoder produces noise

Help for Audacity 2.x.x on GNU/Linux.
Forum rules
ImageThis forum is for Audacity 2.x.x on GNU/Linux.
Please state:
  • which version of Linux you are using,
  • the exact three-section version number of Audacity from Help menu > About Audacity,
  • whether you installed your distribution's release, PPA version, or compiled Audacity from source code.

Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade (see https://www.audacityteam.org/download/).
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Post Reply
mxdxz
Posts: 23
Joined: Fri Jul 27, 2018 11:54 pm
Operating System: Linux Fedora/RHEL

Audacity's "default" mp3 decoder produces noise

Post by mxdxz » Mon Nov 19, 2018 6:56 pm

I noticed something interesting: when I use audacity built from git (using the instructions from the INSTALL file), there's some extra noise when reading mp3 files. On the other hand, when I use audacity built on the same machine but with the audacity-freeworld patches (that make audacity link against various audio libraries), there's no noise. Both versions are built from the Audacity-2.2.2 git tag.

I'm attaching four files: the original mp3, decodings done with both versions of Audacity, and the (amplified) difference between them.

I'm also attaching the difference between the libraries that the two versions of audacity are linked against ("+" are present only in the "good" version", "-" are present only in the "bad" version).

My hypothesis is that in the two cases audacity uses different mp3 decoders, and the default/fallback one is buggy. Unfortunately, I don't know how to figure out which decoder audacity uses in each case.

Is this a known issue?
Attachments
bad.wav
(452.29 KiB) Downloaded 6 times
diff.wav
(452.29 KiB) Downloaded 5 times
good.wav
(452.29 KiB) Downloaded 4 times
test.mp3
(75.38 KiB) Downloaded 4 times

mxdxz
Posts: 23
Joined: Fri Jul 27, 2018 11:54 pm
Operating System: Linux Fedora/RHEL

Re: Audacity's "default" mp3 decoder produces noise

Post by mxdxz » Mon Nov 19, 2018 6:57 pm

Attaching the libraries diff.
Attachments
audacity-ldd-diff.txt
(2.67 KiB) Downloaded 6 times

steve
Site Admin
Posts: 49025
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Audacity's "default" mp3 decoder produces noise

Post by steve » Mon Nov 19, 2018 8:56 pm

By default, Audacity uses libmad to decode MP3s. It is also possible to use FFmpeg or avconv if Audacity has been built appropriately, and a compatible version of FFmpeg / avconv is installed. To tell Audacity to use FFmpeg (or avconv) to import a file, select "FFmpeg-compatible files" as the file type filter in the audio import dialog.

It is "normal" for different decoders to produce slightly different results, though I'm not able to reproduce the kind of noise that you demonstrate in "diff.wav". From my own tests, Audacity with libmad is on par with lame 3.99.5 command line encoder, and slightly better than FFmpeg (subjective test - not ABX)
mxdxz wrote:
Mon Nov 19, 2018 6:56 pm
there's some extra noise when reading mp3 files
What are you comparing with what? I don't see how you are deciding which version is "good" and which is "bad".
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

mxdxz
Posts: 23
Joined: Fri Jul 27, 2018 11:54 pm
Operating System: Linux Fedora/RHEL

Re: Audacity's "default" mp3 decoder produces noise

Post by mxdxz » Tue Nov 20, 2018 7:23 am

Thanks for the reply, steve.
steve wrote:
Mon Nov 19, 2018 8:56 pm
What are you comparing with what? I don't see how you are deciding which version is "good" and which is "bad".
The noise in bad.wav is very audible if you listen to it in headphones and turn the volume up a bit.
steve wrote:
Mon Nov 19, 2018 8:56 pm
It is "normal" for different decoders to produce slightly different results, though I'm not able to reproduce the kind of noise that you demonstrate in "diff.wav".
Are you testing it with my test.mp3? Shouldn't the results produced by the same version of libmad on different machines be identical? Could you post the decoded audio that you get with libmad?

steve
Site Admin
Posts: 49025
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Audacity's "default" mp3 decoder produces noise

Post by steve » Tue Nov 20, 2018 12:23 pm

mxdxz wrote:
Tue Nov 20, 2018 7:23 am
The noise in bad.wav is very audible if you listen to it in headphones and turn the volume up a bit.
When I listen to the imported test.mp3 file, I can hear a very slight hiss, but not that awful noise that you demonstrate in diff.wav.

mxdxz wrote:
Tue Nov 20, 2018 7:23 am
Are you testing it with my test.mp3?
Yes.
mxdxz wrote:
Tue Nov 20, 2018 7:23 am
Shouldn't the results produced by the same version of libmad on different machines be identical?
Yes.

mxdxz wrote:
Tue Nov 20, 2018 7:23 am
Could you post the decoded audio that you get with libmad?
Here it is in 32-bit WAV format:
libmad-audacity.wav
(900.08 KiB) Downloaded 5 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

mxdxz
Posts: 23
Joined: Fri Jul 27, 2018 11:54 pm
Operating System: Linux Fedora/RHEL

Re: Audacity's "default" mp3 decoder produces noise

Post by mxdxz » Tue Nov 20, 2018 2:34 pm

steve wrote:
Tue Nov 20, 2018 12:23 pm
When I listen to the imported test.mp3 file, I can hear a very slight hiss, but not that awful noise that you demonstrate in diff.wav.
As I said above, diff.wav is amplified just to demonstrate how the noise sounds — but if you listen to bad.wav (or manually diff it with good.wav), you can hear the way it sounds originally. I think you'll be able to hear it in bad.wav easily.

Your decoding indeed doesn't have that kind of noise. Are you using the system version of libmad or the one bundled with audacity's source? (I'm using the latter.)

steve
Site Admin
Posts: 49025
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Audacity's "default" mp3 decoder produces noise

Post by steve » Tue Nov 20, 2018 4:16 pm

mxdxz wrote:
Tue Nov 20, 2018 2:34 pm
Are you using the system version of libmad or the one bundled with audacity's source? (I'm using the latter.)
I'm using the one in the Audacity source code.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply