LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   mpg123 error, related to alsa module (https://www.linuxquestions.org/questions/linux-software-2/mpg123-error-related-to-alsa-module-785894/)

Chili.Willy 01-30-2010 05:48 PM

mpg123 error, related to alsa module
 
When I try to play a .mp3 file with mpg123, e.g. with this command:
mpg123 someCoolTune.mpg
I get these error messages.

[module.c:110] error: Failed to open module alsa: file not found
[module.c:110] error: Failed to open module oss: file not found
[module.c:110] error: Failed to open module esd: file not found
[module.c:110] error: Failed to open module jack: file not found
[module.c:110] error: Failed to open module pulse: file not found
[module.c:110] error: Failed to open module nas: file not found
[module.c:110] error: Failed to open module arts: file not found
[audio.c:179] error: Unable to find a working output module in this list: alsa,oss,esd,jack,pulse,nas,arts
[audio.c:463] error: Failed to open audio output module
[mpg123.c:757] error: Failed to initialize output, goodbye.


GUI audio players like Rhythmbox and Totem work just fine. I believe all of the audio on my computer depends on alsa. Another command that works just fine is aplay, as in
aplay -q /usr/lib/openoffice/basis3.1/share/gallery/sounds/cow.wav

and aplay definitely uses alsa.


My only other clue is, when I shut the machine down, one of the messages printed to the console during shutdown was something about /etc/default/timidity.
Timidity is something that converts MIDI to WAV, and it may have nothing to do with my mpg123 problem.

I am running Debian Lenny.

How can I troubleshoot mpg123? Or would it be likely to help if I simply uninstall and reinstall mpg123? That might be easier than troubleshooting.

Thanks for any ideas.

lugoteehalt 01-31-2010 12:28 AM

Timidity is a software midi player and almost certainly has nothing to do with it. At a guess mpg123 is simply unable to find the relevant stuff, like it says. Did you install it from source, in which case that will often happen if p's and q's are not religiously observed, or is it a deb file, in which case it is more mysterious?

If it were me I'd just forget it and use, say, mplayer which, as long as you get it set up properly - from debian multimedia - will play anything and give you huge flexibility.

Chili.Willy 01-31-2010 05:03 PM

Thanks, Lugoteehalt.

I should have mentioned, mpg123 used to work just fine. I installed it about a year ago with apt-get. I

And I can now say, removing and re-installing mpg123 did not help.

lugoteehalt 01-31-2010 07:41 PM

I'm using Lenny, it is a backport but it is not obvious, at least to me, why that should make a difference. So used apt-get install mpg123 to install said program. Then got this when tried to use it:
Code:

lugo@fido:~$ mpg123 /home/lugo/Politics/Chomsky/dn2008-1124-1.mp3                 
[module.c:110] error: Failed to open module oss: file not found                   
[audio.c:179] error: Unable to find a working output module in this list: oss     
[audio.c:464] error: Failed to open audio output module
[mpg123.c:767] error: Failed to initialize output, goodbye.
lugo@fido:~$ artsdsp mpg123 /home/lugo/Politics/Chomsky/dn2008-1124-1.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.5.1; written and copyright by Michael Hipp and others
        free software (LGPL/GPL) without any warranty but with best wishes

Directory: /home/lugo/Politics/Chomsky/
Playing MPEG stream 1 of 1: dn2008-1124-1.mp3 ...
Title:  Democracy Now! Monday, November 24, 2008
Artist:  Democracy Now!
Album:  Democracy Now!
Year:    2008

Then the file played. (Could have equally used artsdsp mplayer filename) So it seems vaguely similar to your problem and it was resolved by putting 'artsdsp' in front of the command.

artsdsp tells the program to use the arts sound server which is used by KDE; you using KDE?

Chili.Willy 01-31-2010 10:18 PM

Interesting. I have Gnome, not KDE. I'm not sure what you mean by "it is a backport". Lenny is? mpg123 is?

I'm pretty sure I don't have the arts sound ... um, module, I guess the term is.

I tried
alsadsp mpg123 myCoolTune.mp3 and
alsa mpg123 myCoolTune.mp3, but both gave "command not found".

Checked out man -k alsa and it listed a program called mpg123-alsa. It does have a man page that appears to be the plain old mpg123 man page. Here's what happens if I invoke mpg123-alsa:

>mpg123-alsa myCoolTune.mp3
[module.c:110] error: Failed to open module alsa: file not found
[audio.c:179] error: Unable to find a working output module in this list: alsa
[audio.c:463] error: Failed to open audio output module
[mpg123.c:757] error: Failed to initialize output, goodbye
.

Evidently mpg123-alsa is simply mpg123, but instead of looking for whatever sound module might be available, it looks only for alsa.

When you (Lugoteehalt) invoke mpg123, it seems to look only for oss. I wonder why that is, when my mpg123 looks for seven different sound modules. More to the point, I wonder how mpg123 normally finds the modules. Because, remember the error message is
Failed to open module alsa: file not found

Anyway, thanks for your interest & it would be great if you have any further ideas!

lugoteehalt 02-01-2010 12:16 AM

Had a look at its manual and there's various stuff that might work.
Code:

--list-modules
Might give something interesting. It might play by converting its output to .wav and putting its output to standard output using '-' and pipeing that into aplay, if that's the .wav thing.
Code:

mpg123 -w - | aplay -
I tend to get that sort of command wrong but it should be something like that.

Tried later command and it just printed to the screen.

Perhaps try shutting off the Gnome sound server.

Chili.Willy 02-04-2010 10:02 PM

SOLVED: mpg123 error, related to alsa module
 
Lugoteehalt, thank you very much for your ideas.

I found the answer from a member of Debian User Forums.

Apparently mpg123 was looking for the following files in /usr/lib, when in fact they were in /usr/lib/mpg123.

These are the files I mean:
output_alsa.la output_arts.la output_dummy.la output_esd.la output_jack.la output_nas.la output_oss.la output_pulse.la
output_alsa.so output_arts.so output_dummy.so output_esd.so output_jack.so output_nas.so output_oss.so output_pulse.so


"aspnair" on Debian User Forums suggested that I issue this command:
export LD_LIBRARY_PATH=/usr/lib:/usr/lib/mpg123

The first time I tried it, it didn't help. Then I rebooted, and mpg123 still wouldn't work. Then I ran the export command again, and after that, mpg123 worked perfectly.

This doesn't make any sense to me, because if the files were simply in /usr/lib/mpg123 and mpg123 was looking for them in a different directory, how would rebooting make any difference? All I know is what happened.

lugoteehalt 02-05-2010 06:00 AM

Quote:

Originally Posted by Chili.Willy (Post 3853351)
"aspnair" on Debian User Forums suggested that I issue this command:
export LD_LIBRARY_PATH=/usr/lib:/usr/lib/mpg123

The first time I tried it, it didn't help. Then I rebooted, and mpg123 still wouldn't work. Then I ran the export command again, and after that, mpg123 worked perfectly.

This doesn't make any sense to me, because if the files were simply in /usr/lib/mpg123 and mpg123 was looking for them in a different directory, how would rebooting make any difference? All I know is what happened.

It was probably just that mpg123 was still running and therefore used the data it had already got, not the new library path, something like that.

Thanks for posting the solution. These threads get looked up and it is very frustrating if the answers aren't there.

stevexyz 03-17-2010 12:13 PM

I had the same error messages. My libtool and ltdl were rather old; after installing libtool 2.2.6b and rebuilding mpg123 everything works just fine. Steve


All times are GMT -5. The time now is 01:37 PM.