SoX was compiled without MP3 encoding support

Bug #223783 reported by Ken Fallon
94
This bug affects 16 people
Affects Status Importance Assigned to Milestone
sox (Debian)
Fix Released
Unknown
sox (Ubuntu)
Fix Released
Wishlist
Unassigned
Declined for Karmic by Sebastien Bacher
Declined for Lucid by Sebastien Bacher
Declined for Maverick by Sebastien Bacher

Bug Description

Binary package hint: sox

When trying to change the speed of a MP3 file the sox program fails to convert mp3 files exiting with the error "
# sox x.mp3 y.mp3 tempo 1.5
sox soxio: Failed writing `y.mp3': SoX was compiled without MP3 encoding support

Running the same command with ogg files worked fine.

I'm running Kubunty 8.04 Hardy (updated form Gusty) with sox version 14.0.0-5 installed. I've also installed libsox-fmt-all and I have several /usr/lib/libmp3lame* files. All other music applications play mp3.

sox -h reports
[snip]
SUPPORTED FILE FORMATS: 8svx aif aifc aiff aiffc al alsa ao au auto avi avr caf cdda cdr cvs cvsd dat dvms fap ffmpeg flac fssd gsm hcom ima ircam la lpc lpc10 lu m3u m4a mat mat4 mat5 maud mp2 mp3 mp4 mpg nist nul null ogg oss ossdsp paf pls prc pvf raw s1 s2 s3 s4 sb sd2 sds sf sl smp snd sndfile sndt sou sph sw txw u1 u2 u3 u4 ub ul uw vms voc vorbis vox w64 wav wmv wve xa xi
[/snip]

FURTHER INFO
$ lsb_release -rd
Description: Ubuntu 8.04
Release: 8.04

$ apt-cache policy sox
sox:
  Installed: 14.0.0-5
  Candidate: 14.0.0-5
  Version table:
 *** 14.0.0-5 0
        500 http://nl.archive.ubuntu.com hardy/universe Packages
        100 /var/lib/dpkg/status

$ apt-cache policy libsox-fmt-all
libsox-fmt-all:
  Installed: 14.0.0-5
  Candidate: 14.0.0-5
  Version table:
 *** 14.0.0-5 0
        500 http://nl.archive.ubuntu.com hardy/universe Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
Architecture: i386
Date: Mon Apr 28 19:49:23 2008
DistroRelease: Ubuntu 8.04
Package: sox 14.0.0-5
PackageArchitecture: i386
ProcEnviron:
 SHELL=/bin/bash
 PATH=/home/username/bin:/sbin:/usr/sbin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=en_US.UTF-8
SourcePackage: sox
Uname: Linux 2.6.24-16-generic i686

Tags: apport-bug

Related branches

Revision history for this message
Ken Fallon (ubuntu-fallon) wrote :
Revision history for this message
Fevrin (fevrin) wrote :

I can confirm that SoX returns this error when you try to output an MP3 file. In my case, I was trying to convert a FLAC file to an MP3 file with "sox -i -V4 "song.flac" "song.mp3". Trying it with sudo of course didn't change anything. Also, I installed Sox and libsox-fmt-all through Synaptic, if that helps.

Some general setup info:

Hardware:
AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
3023 MB RAM

Software:
Ubuntu 8.04 Hardy Heron AMD64
GNOME: 2.22.1 (Ubuntu 2008-05-07)
Kernel version: 2.6.24-16-generic (#1 SMP Thu Apr 10 12:47:45 UTC 2008)
GCC: 4.2.3 (x86_64-linux-gnu)

Revision history for this message
Ken Fallon (ubuntu-fallon) wrote :

I just confirmed that this is also an issue with Debian Lenny/SID

joe@blogg:~$ sox --version
sox: SoX v14.0.1
joe@blogg:~$ cat /etc/debian_version
lenny/sid
joe@blogg:~$ uname -a
Linux papps02 2.6.16-2-686-smp #1 SMP Fri Aug 18 19:25:21 UTC 2006 i686 GNU/Linux
joe@blogg:~$ sox x.mp3 y.mp3 tempo 1.5
sox soxio: Can't open output file `y.mp3': SoX was compiled without MP3 encoding support
joe@blogg:~$ aptitude show libsox-fmt-all
Package: libsox-fmt-all
New: yes
State: installed
Automatically installed: no
Version: 14.0.1-2+b1
Priority: optional
Section: sound
Maintainer: Pascal Giard <email address hidden>
Uncompressed Size: 45.1k
Depends: libsox-fmt-base, libsox-fmt-ffmpeg, libsox-fmt-flac, libsox-fmt-gsm, libsox-fmt-mp3, libsox-fmt-ogg, libsox-fmt-sndfile,
         libsox-fmt-alsa, libsox-fmt-ao, libsox-fmt-oss
Description: All SoX format libraries
 SoX is the swiss army knife of sound processing.

 This is a meta package depending on all free SoX format libraries.
Homepage: http://sox.sourceforge.net

joe@blogg:~$ aptitude search sox | grep ^i
i libsox-fmt-all - All SoX format libraries
i A libsox-fmt-alsa - SoX alsa format I/O library
i A libsox-fmt-ao - SoX Libao format I/O library
i A libsox-fmt-base - Minimal set of SoX format libraries
i A libsox-fmt-ffmpeg - SoX ffmpeg format library
i A libsox-fmt-flac - SoX FLAC format library
i A libsox-fmt-gsm - SoX GSM format library
i A libsox-fmt-mp3 - SoX MP3 format library
i A libsox-fmt-ogg - SoX OGG Vorbis format library
i A libsox-fmt-oss - SoX OSS format I/O library
i A libsox-fmt-sndfile - SoX libsndfile format library
i A libsox0 - SoX library
i A sox - Swiss army knife of sound processing

Revision history for this message
Ken Fallon (ubuntu-fallon) wrote :

I think that the error message "SoX was compiled without MP3 encoding support" is misleading. It can convert from mp3 but not to mp3. If I run the command "sox x.mp3 y.mp3 tempo 1.5" it fails but the command "sox x.mp3 y.ogg tempo 1.5" works fine. So this issue is just related to writing mp3 files.

Revision history for this message
Pascal Giard (pascalgiard-debian) wrote :

I can't distribute sox binaries with mp3 encoding support compiled in at least in Debian main.

One of SoX developpers posted a patch to support mp3 encoding via dlopen awhile back but many changes occured in SoX since then. That patch needs to be reworked and i don't currently have the time to do so.

If you're willing to help, please have a look at:
http://bugs.debian.org/382275

Changed in sox:
status: Unknown → Confirmed
Revision history for this message
Luke Schlather (luke2760) wrote :

It would be really nice to have a simple thing that "just works" after installing one package or metapackage like Imagemagick does for images...

To the point that I think a 'full' version of SoX in the nonfree repositories would be a nice thing to have around. I know it's fairly redundant, but looking at upstream it sounds like the cleanness of having a single base package might not be worth the mess of trying to dynamically load lame or somesuch, when we could just throw a version with mp3 support in non-free, and not have to worry about the maintenance nightmare that will come up the next time sox has a redesign.

Revision history for this message
Joshua Swink (yathster) wrote :

Absolutely, the program should work after installing its main package. That is, it should include some format libraries. There should be a sox-base package that doesn't include any format libraries, like the main sox package does now. The sox package should depend on most or all open formats, and sox-full depend on all available format packages. That way you wouldn't get surprises like "I just installed sox, and it can't even play .WAV? What gives?!"

Revision history for this message
Arie Skliarouk (skliarie) wrote :

I tried to rebuild sox with enabled mp3 encoding support and the resulting binary segfaults on any mp3-encoding operation. I have used following procedure to do that (on Ubuntu 8.10, both i386 and x86_64 architectures):

apt-get install sox libmp3lame0 libmp3lame-dev
apt-get build-dep sox
cd /usr/src
apt-get source sox
dpkg-source -x sox_14.0.1-2build2.dsc
vi sox-14.0.1/debian/rules
# comment out, by putting an '#' at the beginning of the line, the line
DEB_CONFIGURE_EXTRA_FLAGS := --disable-lame

cd sox-14.0.1/
dpkg-buildpackage -b

Revision history for this message
Arie Skliarouk (skliarie) wrote :

Actually the "mp3-enabled" sox segfaults on attempt to create any output file, not just the mp3 one.

Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

I can understand if Ubuntu doesn't want to distribute sox with mp3 encoding enabled by default, but couldn't there be another sox version (maybe in multiverse, or even in a ppa) with mp3 encoding enabled?

Revision history for this message
frederyk (frederyk) wrote :

I understand that too, but a mp3-enabled sox should be available, especially for the server-market hat tool could be the "audio-imagemagick". this should be fixed soon.

Revision history for this message
Adrian (adrian-dziubek) wrote :

For simple scenarios, this should work:

for a in *; do sox "$a" "`basename "$a" .ogg`.wav"; done
for a in *.wav; do lame --preset extreme "$a" "`basename "$a" .wav`.mp3"; done

Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

marking as confirmed, importance wishlist

Changed in sox (Ubuntu):
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Risto H. Kurppa (risto.kurppa) wrote :

Any updates here, someone working on this? Still an issue with Karmic.

Revision history for this message
Domenico Martella (dom0) wrote :

I've just recompiled sox with mp3 support (thought liblame0). It's available at ppa:
deb http://ppa.launchpad.net/domenico-martella-alcacoop/ppa/ubuntu karmic main

Revision history for this message
IDtheTarget (benjamin-birdvet) wrote :

I made the mistake of upgrading to lucid, and now can't use sox for mp3 again. I desperately need this ability. I've tried to use your ppa, but it didn't work. do you have one for lucid?

Thank you!

Revision history for this message
Michael Hipp (michael-hipp) wrote :

I guess I don't understand this comment:

"I can't distribute sox binaries with mp3 encoding support compiled in at least in Debian main."

I presume this refers to the non-free mp3 encoder. But just removing the configure switch '--disable-lame' does not cause the sox binary to include any non-free code. (True?) The non-free code only arrives in lame. I just don't see how this configure switch changes the legal disposition of sox. It doesn't really change sox per se.

Otherwise, how is Audacity able to be distributed in exactly this fashion. It won't encode mp3 right out of the box. But all you have to do is install the lame library and it is then fully enabled. You certainly don't have to recompile it.

Why can't sox be distributed like Audacity.

Revision history for this message
Daniel Letzeisen (dtl131) wrote :

I have "liberated" versions of sox in PPA: https://launchpad.net/~dtl131/+archive/mediahacks

Revision history for this message
Daniel Letzeisen (dtl131) wrote :

I have sox in my PPA too, though it looks like Domenico Martella is doing a good job of maintaining his PPA.

Revision history for this message
LenWeisberg (len-weisberg) wrote :

I tried to install sox from the PPA and still can't write MP3.
 Here's the story (some newlines added). Any idea what's wrong?

[code]
$ sudo add-apt-repository ppa:dtl131/mediahacks
$ sudo apt-get update

$ sudo apt-get install sox
[messages included:]
Get:1 http://ppa.launchpad.net/dtl131/mediahacks/ubuntu/ lucid/main
    sox 14.3.0-1.1build2~mediahacks2 [93.2kB]

$ sox --version
sox: SoX v14.3.0
$ type sox
sox is /usr/bin/sox
$ ls -l /usr/bin/sox
-rwxr-xr-x 1 root root 61792 2010-09-18 15:17 /usr/bin/sox
$ ls -lc /usr/bin/sox
-rwxr-xr-x 1 root root 61792 2010-12-23 13:35 /usr/bin/sox
$ uname -a
Linux mysys 2.6.32-27-generic #49-Ubuntu SMP Thu Dec 2 00:51:09 UTC 2010
    x86_64 GNU/Linux

$ sox stereo.mp3 -c1 mono.mp3
sox FAIL formats: can't open output file `mono.mp3':
    SoX was compiled without MP3 encoding support
[/code]

Revision history for this message
LenWeisberg (len-weisberg) wrote :

Forgot to mention, I also did:
$ sudo apt-get install libsox-fmt-all

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sox - 14.3.1-1ubuntu1

---------------
sox (14.3.1-1ubuntu1) natty; urgency=low

  * Enable lame support (drop --without-lame and add libmp3lame-dev to
    build dependencies) (LP: #223783).
  * Set distro based on the build distribution.
 -- Benjamin Drung <email address hidden> Tue, 08 Feb 2011 12:20:41 +0100

Changed in sox (Ubuntu):
status: Confirmed → Fix Released
Changed in sox (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.