Audio file exporrt performance under Linux Mint

I have a slight concern over Audacity audio export performance under Linux and wonder if I am doing something wrong:

I’m exporting a ‘raw’ (Audacity_data/aup) file, of about 1414 MB, to an m4a(aac) format file, at quality 292 kbps, using Audacity 2.3.3 (commit build 008d8d) under Mint 19.2, Cinnamon 64 bit, with kernel 5.0.0-37. The export takes about 31 minutes and 20 seconds.

In contrast, if I use Win 10 on this dual boot machine with everything else the same, (especially the build version of Audacity), the export takes 3 minutes and 48 seconds.

Why is there a 10:1 difference in performance?

How many tracks in the project?
How long are the tracks?
What are the track sample rates? (look in the track info panel on the left end of the track)
What is the “Project Rate” set at (bottom left corner of the main Audacity window)

2 tracks
2 hours recording time (to within the nearest minute)
48,000 Hz
48,000 Hz

Now please explain to me why these metrics should make the 10:1 difference in encoding rates - after all both versions of Audacity have a common source code and ‘see’ the same data- surely ?

They shouldn’t, but in order to reproduce the problem, I need to know precisely what you are doing.

Not for AAC export. This export format uses FFmpeg, which is an optional download for Windows, and is supplied by the Linux distribution for Linux.

As described here Encode/AAC – FFmpeg there are different codecs that may be used for AAC encoding in FFmpeg. Which one is used, and to some degree the default options, is determined by how FFmpeg is built (which is done by the package maintainer).
From this page: MediaCenter/CodecSupport - Ubuntu Wiki it looks like current versions of FFmpeg in Ubuntu are built with “libfaad” for AAC encoding.

On my (fairly fast) Ubuntu laptop, exporting 2 mono tracks to 192 kbps m4a, took 9mins 21 seconds, so your quoted times are in the same ballpark.

Thank you for this interesting background: i want to set it against a modification to my original post:

I realise I had been comparing 2 species of apples (i.e. not apples and oranges, but not identical apples either): the ‘raw’ data file used in these comparisons was replicated and placed on different hard disks in my old dual boot desktop. By different I mean in performance (one 5400 rpm, the other 7200 rpm). I have now repeated the comparison running the Linux and Windows version of Audacity against the same data file on the same hard disk. And to eliminate effects caused by the data being, possibly, on a different hard drive to the code, I have run the test twice, one on each hard disk.

The results show that it doesn’t really matter which hard disk the data is on: the difference between the Linux performance and the Windows performance is not 10:1 but 15:1, in favour of Windows. The big difference is between the source code for the Windows and Linux versions of ffmpeg (I am not able to tell what versions they are)

From al that you have told me I conclude that the majority of the ‘work’ to be done in this encoding (from Audacity’s internal ‘raw’ format to AAC) is being done mostly in ffmpeg - and I assume this is mostly just mathematical operations, with Audacity providing the database management. iI I am correct then I need to ask how can I get a better performing ffmpeg in Linux?

(btw I did try installing ffmpeg 4 from a PPA, as directed by just about every Google-able article I could find wrt installing ffmpeg 4 in Mint 19.2. These efforts fail, telling me that the PPA does not support Bionic. The mind boggles.

I think you’ve got an uphill battle trying to get good support for AAC on Linux. AAC is encumbered with patents that make it difficult (and legally dubious) for open source software to use it. If you want to use open source software, then you will find “free” formats much easier to work with.

I’m guessing that you want AAC because you want to use the files in Apple products (on your iPhone?), in which case, it would be best to use the AAC encoder in iTunes (which is probably the best AAC encoder). As iTunes is not available for Linux, you will need to use Windows or macOS to run iTunes.

Aside from the time element, how does the result compare between Linux Mint and Windows re. file size and final quality?

If there’s no perceptible difference between what Audacity produces on both platforms, although it would be nice for Linux Mint to perform better, then it’s largely academic.

If it were me in this situation it would be the difference between making a coffee or having lunch while Audacity exports. Not a deal breaker. :slight_smile:


I would not expect a big difference in sound quality when using the same compression settings, though iTunes is frequently said to have the best AAC encoder. This article is rather old, but I think still relevant: AAC FAQ - Hydrogenaudio Knowledgebase

The quality of AAC encoding on Linux depends on which AAC encoder has been compiled into FFmpeg. The default “native” codec is libav/libavcodec, which is old and generally considered not as good as other AAC encoders. I think that the “Fraunhofer FDK AAC” is still considered to be the best quality open source AAC encoder, but the open source license does not extend to patented technologies (so not “free” software) and is limited to 16-bit input. The FDK AAC license states that the library may only be distributed as authorized by patent licenses.