tuffy / python-audio-tools

A collection of audio handling programs which work from the command line.
http://audiotools.sourceforge.net
GNU General Public License v2.0
249 stars 58 forks source link

libmpg123 - Raspberry PI #36

Closed c0d3phr3ak closed 9 years ago

c0d3phr3ak commented 10 years ago

I am running Rasbian (Wheezy).

I have installed libmpg123 via repository.

When I run the following:

root@raspberrypi:/home/pi/audiotools-2.21# pkg-config --list-all | grep libmpg123 libmpg123 libmpg123 - An optimised MPEG Audio decoder

It appears to be installed (and based on the setup.cfg should find it when set to probe).

However, after compile, when I run audiotools-config - the mp2, and mp3 sections are red.

Is there something that I am missing?

c0d3phr3ak commented 10 years ago

Should add the following as well:

root@raspberrypi:/home/pi/audiotools-2.21# apt-get install libmpg123-dev Reading package lists... Done Building dependency tree
Reading state information... Done libmpg123-dev is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 81 not upgraded.

tuffy commented 10 years ago

The problem I run into is that running:

% python setup.py build % apt-get install libmpg123-dev % python setup.py build % python setup.py install

won't work as expected since Python's distutils caches a lot of stuff, so you'll need to remove the build/ directory after installing additional packages.

But if that doesn't solve the problem, perhaps running:

% echo "from audiotools.decoders import MP3Decoder" | python -

might help determine why it's not loading. There might a 32/64-bit library mismatch or some other strangeness at work.

c0d3phr3ak commented 10 years ago

Thanks for the input. I will try tonight and let you know how that works.

On Tue, Sep 2, 2014 at 9:26 AM, tuffy notifications@github.com wrote:

The problem I run into is that running:

% python setup.py build % apt-get install libmpg123-dev % python setup.py build % python setup.py install

won't work as expected since Python's distutils caches a lot of stuff, so you'll need to remove the build/ directory after installing additional packages.

But if that doesn't solve the problem, perhaps running:

% echo "from audiotools.decoders import MP3Decoder" | python -

might help determine why it's not loading. There might a 32/64-bit library mismatch or some other strangeness at work.

— Reply to this email directly or view it on GitHub https://github.com/tuffy/python-audio-tools/issues/36#issuecomment-54150261 .

c0d3phr3ak commented 10 years ago

Hi,

Still receiving error when trying to run trackplay on an mp3.

However, I see the following when running python setup.py install:

Python Audio Tools 2.21 Setup

library present? used for download URL


libasound2 no ALSA output http://www.alsa-project.org libcdio no CDDA data extraction http://www.gnu.org/software/libcdio/ libmpg123 yes MP3/MP2 decoding libpulse no PulseAudio output http://www.freedesktop.org mp3lame no MP3 encoding http://lame.sourceforge.net opus no Opus encoding http://www.opus-codec.org opusfile no Opus decoding http://www.opus-codec.org twolame no MP2 encoding http://twolame.sourceforge.net vorbisenc no Ogg Vorbis encoding http://www.xiph.org vorbisfile no Ogg Vorbis decoding http://xiph.org

audiotools-config still shows mp2 and mp3 in red.

And when running trackplay I get the following:

library "libmp3lame" needed to support mp3 format mp3lame can be downloaded from http://lame.sourceforge.net/ library "libmpg123" needed to support mp3 format mpg123 can be downloaded from http://www.mpg123.org/ or check your system's package manager

When trying your other suggestion:

pi@raspberrypi ~/Desktop $ echo "from audiotools.decoders import MP3Decoder" | python - pi@raspberrypi ~/Desktop $

Given the processor is ARM, I am not sure if there is 32/64 weirdness. Is there anything else I can try?

tuffy commented 10 years ago

Ah, looks like you're missing libmp3lame which is needed for MP3 support, since the codec wants both the decoder and encoder in order to work. Try installing "lame" and "lame-dev", clean out the build/ directory and rebuild.

I haven't yet split the decoding and encoding prerequisites so that one can decode a file without also being able to encode it, but that is on my TODO list.

c0d3phr3ak commented 9 years ago

I was able to do the following steps and it works great now thanks!

With Raspian IMG 2014-06-20

sudo apt-get install python-dev python-gtk2 sudo apt-get install libcdio-dev libcdio-paranoia-dev libasound2 libasound2-dev sudo apt-get install mpg123 twolame libtwolame-dev sudo apt-get install mpg123 lame mp3gain libmp3lame-dev libmpg123-dev sudo apt-get install vorbis-tools libvorbis-dev sudo apt-get install opus-tools libopus-dev FAAC/FAAD Installation (adapted from http://pierskennedy.wordpress.com/2013/03/28/python-audiotools-on-the-rpi/) Edit your apt-get source list by adding another source. sudo nano /etc/apt/sources.list Paste in deb http://www.deb-multimedia.org/ wheezy main non-free on a new line. Save and exit. sudo apt-get install debian-keyring Next, we would perform sudo apt-get update, but it will complain that the public key for the new source is missing. You should probably go ahead and try it before continuing, because I would strongly recommend against blindly installing keys that you don't know what they are just because som random guy (me) told you so. apt-get will complain about key 07DC563D1F41B907 (which has fingerprint 1F41B907) is unknown. The actions 4 and 5 need to be properly run as root (sudo bash, and then executing them), simply prepending every command with sudo did not do it for me. gpg --keyserver pgp.mit.edu --recv-keys 1F41B907 gpg --armor --export 1F41B907 | apt-key add - sudo apt-get update sudo apt-get install faad libfaad-dev faac libfaac-dev

Audiotools Installation

git clone git://github.com/tuffy/python-audio-tools.git

cd python-audio-tools sudo make sudo make install

c0d3phr3ak commented 9 years ago

Forgot to add the following changes to the setup.cfg file to force acceptance of different libraries not found with probe: libcdio_paranoia:probe libpulse:probe alsa:probe libmpg123:yes vorbisfile:yes opusfile:probe mp3lame:yes twolame:yes vorbisenc:yes opus:probe