Play mp3 with madplay:
madplay /home/ftp/test.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
audio: /dev/dsp: No such device
It is ture that /dev/dsp exists.
ls -al /dev/dsp
crwxrwxrwx 1 root pulse 14, 3 Jun 19 12:39 /dev/dsp
Strange enough:
root@OpenWrt:~/.mpd# service mpd restart
mkdir: can't create directory '': No such file or directory
root@OpenWrt:~/.mpd#
Strange. My /dev/dsp has different permissions:
crw--w--w- 1 root root 14, 3 May 24 11:29 /dev/dsp
AFAIK that does the same as
/etc/init.d/mpd restart
So you can 'debug' it:
sh -x /etc/init.d/mpd restart
root@OpenWrt:~# chmod root.root /dev/dsp
root@OpenWrt:~# chmod 622 /dev/dsp
root@OpenWrt:~# ls -al /dev/dsp
crw--w--w- 1 root root 14, 3 Jun 19 12:39 /dev/dsp
root@OpenWrt:~# /etc/init.d/mpd restart
mkdir: can't create directory '': No such file or directory
root@OpenWrt:~# sh -x /etc/init.d/mpd restart
+ START=93
+ USE_PROCD=1
+ PROG=/usr/bin/mpd
+ CONFIGFILE=/etc/mpd.conf
+ NICEPRIO=-10
root@OpenWrt:~# madplay /home/ftp/test.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
audio: /dev/dsp: No such device
How can fix it then?
Get info on sound cards:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: Generic Digital [Generic Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: Generic Analog [Generic Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
Set proper argument in mpd.conf.
vi /etc/mpd.conf
music_directory "/home/ftp"
playlist_directory "/home/.mpd/music_playlist"
db_file "/home/.mpd/mpd.db"
log_file "/home/.mpd/mpd.log"
pid_file "/home/.mpd/mpd.pid"
state_file "/home/.mpd/mpd.state"
user "mpd"
group "audio"
bind_to_address "0.0.0.0"
port "6600"
input {
plugin "curl"
}
audio_output {
type "alsa"
name "My ALAS Device"
device "hw:1,0"
mixer_type "software"
}
filesystem_charset "UTF-8"
And add user to group.
usermod -aG audio mpd
mpc can open audio stram now.
service mpc start
mpc add mms://60.199.213.68/22
mpc play 1
But madplay still can't play mp3 file.
madplay /home/ftp/test.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
audio: /dev/dsp: No such device
diizzy
#5
Avoid madlib/madplay, it's extremely slow compared to both mpg123 and ffmpeg. It's also unmaintained upstream...
mpc can play audio stream from mms url,madplay can't play audio file in local directory.
How to fix then?
tmomas
closed
#7
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.