PDA

View Full Version : Sound doesn't play



rccharles
23rd December 2014, 12:32 AM
I've used mpg123 to play sounds in scripts to denote progress. I have mpg123 playing music in Fedora 19 on a t20 but not on a later install of Fedora 19 on a t61. The t20 machines isn't up-to-date, but the t61 has the latest updates. On the t61, the music does play in videos app when I double click. I've had troubles installing the music playing software, but I got Allten to work with the addition of --nogpgcheck on yum install to install "most codecs on your system".

Any command line app to play an mp3 file would be fine.


me $ mpg123 '/home/me/wind-howl-01.mp3'

[oss.c:172] error: Can't open default sound device!

[audio.c:643] error: failed to open audio device

[audio.c:180] error: Unable to find a working output module in this list: oss

[audio.c:545] error: Failed to open audio output module

[mpg123.c:913] error: Failed to initialize output, goodbye.
me $

dobbi
23rd December 2014, 12:48 AM
Its failing probably because of an alsa-oss misconfiguration.

Vlc comes with a cli version called cvlc.


$ cvlc /usr/share/flightgear/Sounds/intro.mp3
VLC media player 2.1.5 Rincewind (revision 2.1.4-49-gdab6cb5)
[0xf9ea38] dummy interface: using the dummy interface module...

Mplayer also can do it.

and if you don't use those proprietary codecs that have patents problems you can also use

paplay and aplay

e.g.:

paplay --list-file-formats
aiff AIFF (Apple/SGI)
au AU (Sun/NeXT)
avr AVR (Audio Visual Research)
caf CAF (Apple Core Audio File)
flac FLAC (FLAC Lossless Audio Codec)
htk HTK (HMM Tool Kit)
iff IFF (Amiga IFF/SVX8/SV16)
mat MAT4 (GNU Octave 2.0 / Matlab 4.2)
mat MAT5 (GNU Octave 2.1 / Matlab 5.0)
mpc MPC (Akai MPC 2k)
oga OGG (OGG Container format)
paf PAF (Ensoniq PARIS)
pvf PVF (Portable Voice Format)
raw RAW (header-less)
rf64 RF64 (RIFF 64)
sd2 SD2 (Sound Designer II)
sds SDS (Midi Sample Dump Standard)
sf SF (Berkeley/IRCAM/CARL)
voc VOC (Creative Labs)
w64 W64 (SoundFoundry WAVE 64)
wav WAV (Microsoft)
wav WAV (NIST Sphere)
wav WAVEX (Microsoft)
wve WVE (Psion Series 3)
xi XI (FastTracker 2)

rccharles
23rd December 2014, 03:44 AM
I guess I'll alias mpg123 to mplayer, so I will not have to change my scripts. Hack.

cvlc plays sound, but never quits.

cvlc '/home/me/wind-howl-01.mp3'
VLC media player 2.0.10 Twoflower (revision 2.0.10-0-g2912d78)
[0x93188b8] dummy interface: using the dummy interface module...
TagLib: MPEG::Header::parse() -- Invalid sample rate.
TagLib: MPEG::Header::parse() -- Invalid sample rate.




mplayers works with a few warnings.


mplayer '/home/me/wind-howl-01.mp3'
Creating config file: /home/me/.mplayer/config
MPlayer SVN-r36171-4.8.1 (C) 2000-2013 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing /home/me/wind-howl-01.mp3.
libavformat version 54.63.104 (external)
Audio only file format detected.
Clip info:
Title:
Artist: SoundJay.com Sound Effects
Album:
Year:
Comment:
Genre: Unknown
Load subtitles in /home/me/
================================================== ========================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 320.0 kbit/22.68% (ratio: 40000->176400)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
================================================== ========================
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 11.7 (11.6) of 11.0 (11.0) 0.8%


Exiting... (End of file)
me $

rccharles
23rd December 2014, 03:51 AM
Its failing probably because of an alsa-oss misconfiguration.

Any hints on configuration?
I guess I will look around my bios and see if I can config.


me $ cat devices
me $ cat sndstat
Sound Driver:3.8.1a-980706 (ALSA emulation code)
Kernel: Linux localhost.localdomain 3.14.23-100.fc19.i686 #1 SMP Thu Oct 30 19:00:51 UTC 2014 i686
Config options: 0

Installed drivers:
Type 10: ALSA emulation

Card config:
HDA Intel at 0xfe020000 irq 48
ThinkPad Console Audio Control at EC reg 0x30, fw 7KHT24WW-1.08

Audio devices: NOT ENABLED IN CONFIG

Synth devices: NOT ENABLED IN CONFIG

Midi devices: NOT ENABLED IN CONFIG

Timers:
31: system timer

Mixers: NOT ENABLED IN CONFIG
me $ pwd
/proc/asound/oss
me $

kurtdriver
23rd December 2014, 05:04 AM
mplayers works with a few warnings.

Mplayer always gives those lines.

Can you find your sound card in alsamixer?
Does it appear in the output of dmesg?

If alsamixer can't find it, you'll have no sound.

I bought a usb sound card recently and it appeared in dmesg, but in neither alsamixer nor pavucontrol until I reload the module. I pulled my hair out for a week before finding that gem on the internet. Works like a charm now.

dobbi
23rd December 2014, 05:43 AM
$ padsp <application>

source:
https://wiki.ubuntu.com/PulseAudio#Programs_Using_OpenSound.2BAC8-OSS_output
https://wiki.archlinux.org/index.php/PulseAudio#ossp

Other than that, sorry no, I know there are ways, but I do also remember that they are not for the faint of heart, you would have to dig deep into the conf files to make it work, that level of knowledge and familiarity is lost for me today.

mpg123 doesn't have switches to change the output to something else?

There is a clone of it called mpg321, there is also ffplay from the ffmpeg and some others that I can't remember at the moment.

Still if you want to give it a try there are many ways to do it, you could use alsa-oss emulation or vice-versa, pulseaudio-oss emulation or vice-versa.

Pulseaudio and alsa don't play nice with OSS.

resources:
http://www.alsa-project.org/~tiwai/OSS-Emulation.html
http://alsa.opensrc.org/OSS_emulation
http://wiki.gentoo.org/wiki/OSS
http://www.opensound.com/wiki/index.php/Main_Page
http://www.opensound.com/wiki/index.php/Troubleshooting
http://www.opensound.com/wiki/index.php/Tips_And_Tricks
https://en.wikipedia.org/wiki/Open_Sound_System

rccharles
24th December 2014, 12:05 AM
This is going to have to do for now:

cd /usr/local/bin
sudo mv mpg123 mpg123-original
sudo ln -s /usr/bin/mplayer mpg123

Thanks for everyone's help. Maybe I'll get a free day sometime.

Robert