mpd fails to open ALSA device where aplay succeeds
Clash Royale CLAN TAG#URR8PPP
I am trying to set up an Raspberry Pi / Raspbian wheezy audio player using the onboard sound hardware via ALSA LADSPA plugins to stereo downmix and compress the audio.
aplay, sox, mpg123, moc (cd ~/.moc && cp /usr/share/doc/moc/examples/config.example.gz ./ && gunzip config.example.gz && mv config.example config
) work with this custom "device":
pi@raspberrypi ~ $ aplay -D mcl audiofile.wav
pi@raspberrypi ~ $ sox audiofile.wav -t alsa mcl
pi@raspberrypi ~ $ mpg123 -a mcl audiofile.mp3
pi@raspberrypi ~ $ speaker-test -t wav -c 2
pi@raspberrypi ~ $ speaker-test -t wav -c 2 -D mcl
I have built the current mpd version from source (http://www.musicpd.org/download/mpd/0.19/mpd-0.19.8.tar.xz) following this tutorial:
http://www.infofreako.info/2014/04/building-mpd-on-raspberry-pi-with-opus-support/ (needs additional dependencies libboost-dev
and libicu-dev
)
pi@raspberrypi ~ $ mpc version
mpd version: 0.19.0
pi@raspberrypi ~ $ mpd --version
Music Player Daemon 0.19.8
but still get the error:
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM mcl
Jan 25 10:23 : alsa_output: Failed to open "My ALSA Device" [alsa]: Failed to open ALSA device "mcl": No such file or directory
Jan 25 10:23 : output: Failed to open audio output
Jan 25 10:23 : client: [1] closed
It does work fine when using the default
device (ladcomp
does not work either).
So there is either something wrong/missing in my ALSA configuration that the other players are guessing or mpd is doing it wrong.
There is no /etc/asound.conf, I created the following ~/.asoundrc using several sources
pcm.!default
type hw
card 0
device 0
ctl.!default
type hw
card 0
device 0
###############
# compressor
pcm.ladcomp_limiter
type ladspa
slave.pcm "plughw:0,0";
# slave.pcm "default";
# slave.pcm "makemono";
path "/usr/lib/ladspa";
plugins [
label fastLookaheadLimiter
input
#InputGain(Db) -20 -> +20 ; Limit (db) -20 -> 0 ; Release time (s) 0.01 -> 2
controls [ 20 0 0.8 ]
]
pcm.ladcomp_compressor
type ladspa
slave.pcm "ladcomp_limiter";
path "/usr/lib/ladspa";
plugins [
label dysonCompress
input
#peak limit, release time, fast ratio, ratio
controls [0 1 0.5 0.99]
]
pcm.ladcomp
type plug
slave.pcm "ladcomp_compressor";
### test mono downmix
#pcm.card0
# type hw
# card 0
# device 0
#
#ctl.card0
# type hw
# card 0
# device 0
#
#pcm.monocard
# slave.pcm card0
# slave.channels 2
# type plug
#
#ctl.monocard
# type hw
# card 0
# device 0
#
#pcm.!default monocard
####### didnt work, try this
pcm.mcl {
#pcm.makemono
type route
# slave.pcm "plughw:0,0"
slave.pcm "ladcomp"
ttable
# Copy both input channels to output channel 0 (Left).
0.0 1.0
1.0 1.0
# copy both input channels to output channel 1 (Right).
0.1 1.0
1.1 1.0
#pcm.!default monocomplimiter
# EOF
pi@raspberrypi ~ $ grep -v '^$|^s*#' /etc/mpd.conf
music_directory "/var/lib/mpd/music"
playlist_directory "/var/lib/mpd/"
db_file "/var/lib/mpd/tag_cache"
log_file "/var/lib/mpd/mpd.log"
pid_file "/var/run/mpd/pid"
state_file "/var/lib/mpd/state"
sticker_file "/var/lib/mpd/sticker.sql"
user "mpd"
bind_to_address "any"
metadata_to_use "artist,album,title,track,name,comment"
input
plugin "curl"
audio_output
type "alsa"
name "My ALSA Device"
device "mcl"
mixer_type "disabled"
filesystem_charset "UTF-8"
id3v1_encoding "UTF-8"
pi@raspberrypi ~ $ uname -r
3.18.3+
Let me know if you need more info.
Edit:
pi@raspberrypi ~ $ cat /proc/asound/cards
0 [ALSA ]: bcm2835 - bcm2835 ALSA
bcm2835 ALSA
pi@raspberrypi ~ $ cat /proc/asound/devices
0: [ 0] : control
1: : sequencer
16: [ 0- 0]: digital audio playback
17: [ 0- 1]: digital audio playback
33: : timer
pi@raspberrypi ~ $
Is there a way for ALSA to create virtual devices from the config in here, where mpd could find it (if it does search there)?
Edit:
pi@raspberrypi ~ $ cat /proc/asound/pcm
00-00: bcm2835 ALSA : bcm2835 ALSA : playback 8
00-01: bcm2835 ALSA : bcm2835 IEC958/HDMI : playback 1
pi@raspberrypi ~ $ ls /proc/asound/dev
ls: cannot access /proc/asound/dev: No such file or directory
pi@raspberrypi ~ $ ls /dev/snd
controlC0 pcmC0D0p pcmC0D1p seq timer
pi@raspberrypi ~ $ ls /proc/sound/
ls: cannot access /proc/sound/: No such file or directory
pi@raspberrypi ~ $ ls /proc/sound
ls: cannot access /proc/sound: No such file or directory
pi@raspberrypi ~ $ amixer
amixer: Mixer attach default error: Invalid argument
pi@raspberrypi ~ $ alsamixer
cannot open mixer: Invalid argument
pi@raspberrypi ~ $
Edit:
pi@raspberrypi ~ $ alsamixer -c 0
works.
audio raspberry-pi alsa raspbian mpd
add a comment |
I am trying to set up an Raspberry Pi / Raspbian wheezy audio player using the onboard sound hardware via ALSA LADSPA plugins to stereo downmix and compress the audio.
aplay, sox, mpg123, moc (cd ~/.moc && cp /usr/share/doc/moc/examples/config.example.gz ./ && gunzip config.example.gz && mv config.example config
) work with this custom "device":
pi@raspberrypi ~ $ aplay -D mcl audiofile.wav
pi@raspberrypi ~ $ sox audiofile.wav -t alsa mcl
pi@raspberrypi ~ $ mpg123 -a mcl audiofile.mp3
pi@raspberrypi ~ $ speaker-test -t wav -c 2
pi@raspberrypi ~ $ speaker-test -t wav -c 2 -D mcl
I have built the current mpd version from source (http://www.musicpd.org/download/mpd/0.19/mpd-0.19.8.tar.xz) following this tutorial:
http://www.infofreako.info/2014/04/building-mpd-on-raspberry-pi-with-opus-support/ (needs additional dependencies libboost-dev
and libicu-dev
)
pi@raspberrypi ~ $ mpc version
mpd version: 0.19.0
pi@raspberrypi ~ $ mpd --version
Music Player Daemon 0.19.8
but still get the error:
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM mcl
Jan 25 10:23 : alsa_output: Failed to open "My ALSA Device" [alsa]: Failed to open ALSA device "mcl": No such file or directory
Jan 25 10:23 : output: Failed to open audio output
Jan 25 10:23 : client: [1] closed
It does work fine when using the default
device (ladcomp
does not work either).
So there is either something wrong/missing in my ALSA configuration that the other players are guessing or mpd is doing it wrong.
There is no /etc/asound.conf, I created the following ~/.asoundrc using several sources
pcm.!default
type hw
card 0
device 0
ctl.!default
type hw
card 0
device 0
###############
# compressor
pcm.ladcomp_limiter
type ladspa
slave.pcm "plughw:0,0";
# slave.pcm "default";
# slave.pcm "makemono";
path "/usr/lib/ladspa";
plugins [
label fastLookaheadLimiter
input
#InputGain(Db) -20 -> +20 ; Limit (db) -20 -> 0 ; Release time (s) 0.01 -> 2
controls [ 20 0 0.8 ]
]
pcm.ladcomp_compressor
type ladspa
slave.pcm "ladcomp_limiter";
path "/usr/lib/ladspa";
plugins [
label dysonCompress
input
#peak limit, release time, fast ratio, ratio
controls [0 1 0.5 0.99]
]
pcm.ladcomp
type plug
slave.pcm "ladcomp_compressor";
### test mono downmix
#pcm.card0
# type hw
# card 0
# device 0
#
#ctl.card0
# type hw
# card 0
# device 0
#
#pcm.monocard
# slave.pcm card0
# slave.channels 2
# type plug
#
#ctl.monocard
# type hw
# card 0
# device 0
#
#pcm.!default monocard
####### didnt work, try this
pcm.mcl {
#pcm.makemono
type route
# slave.pcm "plughw:0,0"
slave.pcm "ladcomp"
ttable
# Copy both input channels to output channel 0 (Left).
0.0 1.0
1.0 1.0
# copy both input channels to output channel 1 (Right).
0.1 1.0
1.1 1.0
#pcm.!default monocomplimiter
# EOF
pi@raspberrypi ~ $ grep -v '^$|^s*#' /etc/mpd.conf
music_directory "/var/lib/mpd/music"
playlist_directory "/var/lib/mpd/"
db_file "/var/lib/mpd/tag_cache"
log_file "/var/lib/mpd/mpd.log"
pid_file "/var/run/mpd/pid"
state_file "/var/lib/mpd/state"
sticker_file "/var/lib/mpd/sticker.sql"
user "mpd"
bind_to_address "any"
metadata_to_use "artist,album,title,track,name,comment"
input
plugin "curl"
audio_output
type "alsa"
name "My ALSA Device"
device "mcl"
mixer_type "disabled"
filesystem_charset "UTF-8"
id3v1_encoding "UTF-8"
pi@raspberrypi ~ $ uname -r
3.18.3+
Let me know if you need more info.
Edit:
pi@raspberrypi ~ $ cat /proc/asound/cards
0 [ALSA ]: bcm2835 - bcm2835 ALSA
bcm2835 ALSA
pi@raspberrypi ~ $ cat /proc/asound/devices
0: [ 0] : control
1: : sequencer
16: [ 0- 0]: digital audio playback
17: [ 0- 1]: digital audio playback
33: : timer
pi@raspberrypi ~ $
Is there a way for ALSA to create virtual devices from the config in here, where mpd could find it (if it does search there)?
Edit:
pi@raspberrypi ~ $ cat /proc/asound/pcm
00-00: bcm2835 ALSA : bcm2835 ALSA : playback 8
00-01: bcm2835 ALSA : bcm2835 IEC958/HDMI : playback 1
pi@raspberrypi ~ $ ls /proc/asound/dev
ls: cannot access /proc/asound/dev: No such file or directory
pi@raspberrypi ~ $ ls /dev/snd
controlC0 pcmC0D0p pcmC0D1p seq timer
pi@raspberrypi ~ $ ls /proc/sound/
ls: cannot access /proc/sound/: No such file or directory
pi@raspberrypi ~ $ ls /proc/sound
ls: cannot access /proc/sound: No such file or directory
pi@raspberrypi ~ $ amixer
amixer: Mixer attach default error: Invalid argument
pi@raspberrypi ~ $ alsamixer
cannot open mixer: Invalid argument
pi@raspberrypi ~ $
Edit:
pi@raspberrypi ~ $ alsamixer -c 0
works.
audio raspberry-pi alsa raspbian mpd
add a comment |
I am trying to set up an Raspberry Pi / Raspbian wheezy audio player using the onboard sound hardware via ALSA LADSPA plugins to stereo downmix and compress the audio.
aplay, sox, mpg123, moc (cd ~/.moc && cp /usr/share/doc/moc/examples/config.example.gz ./ && gunzip config.example.gz && mv config.example config
) work with this custom "device":
pi@raspberrypi ~ $ aplay -D mcl audiofile.wav
pi@raspberrypi ~ $ sox audiofile.wav -t alsa mcl
pi@raspberrypi ~ $ mpg123 -a mcl audiofile.mp3
pi@raspberrypi ~ $ speaker-test -t wav -c 2
pi@raspberrypi ~ $ speaker-test -t wav -c 2 -D mcl
I have built the current mpd version from source (http://www.musicpd.org/download/mpd/0.19/mpd-0.19.8.tar.xz) following this tutorial:
http://www.infofreako.info/2014/04/building-mpd-on-raspberry-pi-with-opus-support/ (needs additional dependencies libboost-dev
and libicu-dev
)
pi@raspberrypi ~ $ mpc version
mpd version: 0.19.0
pi@raspberrypi ~ $ mpd --version
Music Player Daemon 0.19.8
but still get the error:
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM mcl
Jan 25 10:23 : alsa_output: Failed to open "My ALSA Device" [alsa]: Failed to open ALSA device "mcl": No such file or directory
Jan 25 10:23 : output: Failed to open audio output
Jan 25 10:23 : client: [1] closed
It does work fine when using the default
device (ladcomp
does not work either).
So there is either something wrong/missing in my ALSA configuration that the other players are guessing or mpd is doing it wrong.
There is no /etc/asound.conf, I created the following ~/.asoundrc using several sources
pcm.!default
type hw
card 0
device 0
ctl.!default
type hw
card 0
device 0
###############
# compressor
pcm.ladcomp_limiter
type ladspa
slave.pcm "plughw:0,0";
# slave.pcm "default";
# slave.pcm "makemono";
path "/usr/lib/ladspa";
plugins [
label fastLookaheadLimiter
input
#InputGain(Db) -20 -> +20 ; Limit (db) -20 -> 0 ; Release time (s) 0.01 -> 2
controls [ 20 0 0.8 ]
]
pcm.ladcomp_compressor
type ladspa
slave.pcm "ladcomp_limiter";
path "/usr/lib/ladspa";
plugins [
label dysonCompress
input
#peak limit, release time, fast ratio, ratio
controls [0 1 0.5 0.99]
]
pcm.ladcomp
type plug
slave.pcm "ladcomp_compressor";
### test mono downmix
#pcm.card0
# type hw
# card 0
# device 0
#
#ctl.card0
# type hw
# card 0
# device 0
#
#pcm.monocard
# slave.pcm card0
# slave.channels 2
# type plug
#
#ctl.monocard
# type hw
# card 0
# device 0
#
#pcm.!default monocard
####### didnt work, try this
pcm.mcl {
#pcm.makemono
type route
# slave.pcm "plughw:0,0"
slave.pcm "ladcomp"
ttable
# Copy both input channels to output channel 0 (Left).
0.0 1.0
1.0 1.0
# copy both input channels to output channel 1 (Right).
0.1 1.0
1.1 1.0
#pcm.!default monocomplimiter
# EOF
pi@raspberrypi ~ $ grep -v '^$|^s*#' /etc/mpd.conf
music_directory "/var/lib/mpd/music"
playlist_directory "/var/lib/mpd/"
db_file "/var/lib/mpd/tag_cache"
log_file "/var/lib/mpd/mpd.log"
pid_file "/var/run/mpd/pid"
state_file "/var/lib/mpd/state"
sticker_file "/var/lib/mpd/sticker.sql"
user "mpd"
bind_to_address "any"
metadata_to_use "artist,album,title,track,name,comment"
input
plugin "curl"
audio_output
type "alsa"
name "My ALSA Device"
device "mcl"
mixer_type "disabled"
filesystem_charset "UTF-8"
id3v1_encoding "UTF-8"
pi@raspberrypi ~ $ uname -r
3.18.3+
Let me know if you need more info.
Edit:
pi@raspberrypi ~ $ cat /proc/asound/cards
0 [ALSA ]: bcm2835 - bcm2835 ALSA
bcm2835 ALSA
pi@raspberrypi ~ $ cat /proc/asound/devices
0: [ 0] : control
1: : sequencer
16: [ 0- 0]: digital audio playback
17: [ 0- 1]: digital audio playback
33: : timer
pi@raspberrypi ~ $
Is there a way for ALSA to create virtual devices from the config in here, where mpd could find it (if it does search there)?
Edit:
pi@raspberrypi ~ $ cat /proc/asound/pcm
00-00: bcm2835 ALSA : bcm2835 ALSA : playback 8
00-01: bcm2835 ALSA : bcm2835 IEC958/HDMI : playback 1
pi@raspberrypi ~ $ ls /proc/asound/dev
ls: cannot access /proc/asound/dev: No such file or directory
pi@raspberrypi ~ $ ls /dev/snd
controlC0 pcmC0D0p pcmC0D1p seq timer
pi@raspberrypi ~ $ ls /proc/sound/
ls: cannot access /proc/sound/: No such file or directory
pi@raspberrypi ~ $ ls /proc/sound
ls: cannot access /proc/sound: No such file or directory
pi@raspberrypi ~ $ amixer
amixer: Mixer attach default error: Invalid argument
pi@raspberrypi ~ $ alsamixer
cannot open mixer: Invalid argument
pi@raspberrypi ~ $
Edit:
pi@raspberrypi ~ $ alsamixer -c 0
works.
audio raspberry-pi alsa raspbian mpd
I am trying to set up an Raspberry Pi / Raspbian wheezy audio player using the onboard sound hardware via ALSA LADSPA plugins to stereo downmix and compress the audio.
aplay, sox, mpg123, moc (cd ~/.moc && cp /usr/share/doc/moc/examples/config.example.gz ./ && gunzip config.example.gz && mv config.example config
) work with this custom "device":
pi@raspberrypi ~ $ aplay -D mcl audiofile.wav
pi@raspberrypi ~ $ sox audiofile.wav -t alsa mcl
pi@raspberrypi ~ $ mpg123 -a mcl audiofile.mp3
pi@raspberrypi ~ $ speaker-test -t wav -c 2
pi@raspberrypi ~ $ speaker-test -t wav -c 2 -D mcl
I have built the current mpd version from source (http://www.musicpd.org/download/mpd/0.19/mpd-0.19.8.tar.xz) following this tutorial:
http://www.infofreako.info/2014/04/building-mpd-on-raspberry-pi-with-opus-support/ (needs additional dependencies libboost-dev
and libicu-dev
)
pi@raspberrypi ~ $ mpc version
mpd version: 0.19.0
pi@raspberrypi ~ $ mpd --version
Music Player Daemon 0.19.8
but still get the error:
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM mcl
Jan 25 10:23 : alsa_output: Failed to open "My ALSA Device" [alsa]: Failed to open ALSA device "mcl": No such file or directory
Jan 25 10:23 : output: Failed to open audio output
Jan 25 10:23 : client: [1] closed
It does work fine when using the default
device (ladcomp
does not work either).
So there is either something wrong/missing in my ALSA configuration that the other players are guessing or mpd is doing it wrong.
There is no /etc/asound.conf, I created the following ~/.asoundrc using several sources
pcm.!default
type hw
card 0
device 0
ctl.!default
type hw
card 0
device 0
###############
# compressor
pcm.ladcomp_limiter
type ladspa
slave.pcm "plughw:0,0";
# slave.pcm "default";
# slave.pcm "makemono";
path "/usr/lib/ladspa";
plugins [
label fastLookaheadLimiter
input
#InputGain(Db) -20 -> +20 ; Limit (db) -20 -> 0 ; Release time (s) 0.01 -> 2
controls [ 20 0 0.8 ]
]
pcm.ladcomp_compressor
type ladspa
slave.pcm "ladcomp_limiter";
path "/usr/lib/ladspa";
plugins [
label dysonCompress
input
#peak limit, release time, fast ratio, ratio
controls [0 1 0.5 0.99]
]
pcm.ladcomp
type plug
slave.pcm "ladcomp_compressor";
### test mono downmix
#pcm.card0
# type hw
# card 0
# device 0
#
#ctl.card0
# type hw
# card 0
# device 0
#
#pcm.monocard
# slave.pcm card0
# slave.channels 2
# type plug
#
#ctl.monocard
# type hw
# card 0
# device 0
#
#pcm.!default monocard
####### didnt work, try this
pcm.mcl {
#pcm.makemono
type route
# slave.pcm "plughw:0,0"
slave.pcm "ladcomp"
ttable
# Copy both input channels to output channel 0 (Left).
0.0 1.0
1.0 1.0
# copy both input channels to output channel 1 (Right).
0.1 1.0
1.1 1.0
#pcm.!default monocomplimiter
# EOF
pi@raspberrypi ~ $ grep -v '^$|^s*#' /etc/mpd.conf
music_directory "/var/lib/mpd/music"
playlist_directory "/var/lib/mpd/"
db_file "/var/lib/mpd/tag_cache"
log_file "/var/lib/mpd/mpd.log"
pid_file "/var/run/mpd/pid"
state_file "/var/lib/mpd/state"
sticker_file "/var/lib/mpd/sticker.sql"
user "mpd"
bind_to_address "any"
metadata_to_use "artist,album,title,track,name,comment"
input
plugin "curl"
audio_output
type "alsa"
name "My ALSA Device"
device "mcl"
mixer_type "disabled"
filesystem_charset "UTF-8"
id3v1_encoding "UTF-8"
pi@raspberrypi ~ $ uname -r
3.18.3+
Let me know if you need more info.
Edit:
pi@raspberrypi ~ $ cat /proc/asound/cards
0 [ALSA ]: bcm2835 - bcm2835 ALSA
bcm2835 ALSA
pi@raspberrypi ~ $ cat /proc/asound/devices
0: [ 0] : control
1: : sequencer
16: [ 0- 0]: digital audio playback
17: [ 0- 1]: digital audio playback
33: : timer
pi@raspberrypi ~ $
Is there a way for ALSA to create virtual devices from the config in here, where mpd could find it (if it does search there)?
Edit:
pi@raspberrypi ~ $ cat /proc/asound/pcm
00-00: bcm2835 ALSA : bcm2835 ALSA : playback 8
00-01: bcm2835 ALSA : bcm2835 IEC958/HDMI : playback 1
pi@raspberrypi ~ $ ls /proc/asound/dev
ls: cannot access /proc/asound/dev: No such file or directory
pi@raspberrypi ~ $ ls /dev/snd
controlC0 pcmC0D0p pcmC0D1p seq timer
pi@raspberrypi ~ $ ls /proc/sound/
ls: cannot access /proc/sound/: No such file or directory
pi@raspberrypi ~ $ ls /proc/sound
ls: cannot access /proc/sound: No such file or directory
pi@raspberrypi ~ $ amixer
amixer: Mixer attach default error: Invalid argument
pi@raspberrypi ~ $ alsamixer
cannot open mixer: Invalid argument
pi@raspberrypi ~ $
Edit:
pi@raspberrypi ~ $ alsamixer -c 0
works.
audio raspberry-pi alsa raspbian mpd
audio raspberry-pi alsa raspbian mpd
edited Jan 25 '15 at 10:33
none
asked Jan 25 '15 at 10:05
nonenone
3114
3114
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
mpd
's alsa output does not find the device, because it really is not defined!mpd
(the daemon program) is run as user mpd
which does not know about the "regular" user pi
s /home/pi/.asoundrc
This can be tested by running a player as user mpd
:
pi@raspberrypi ~ $ sudo -u mpd speaker-test -t wav -c 2 -D mcl
I have discovered elsewhere that there is in fact an alsa configuration file
pi@raspberrypi ~ $ sudo nano /usr/share/alsa/alsa.conf
#
# ALSA library configuration file
#
# pre-load the configuration files
@hooks [
func load
files [
@func concat
strings [
@func datadir
"/alsa.conf.d/"
]
"/etc/asound.conf"
"~/.asoundrc"
"/home/pi/.asoundrc" # added !
]
errors false
]
...
to which I have added pi
's local config.
And then it works:
pi@raspberrypi ~ $ sudo -u mpd speaker-test -t wav -c 2 -D mcl
speaker-test 1.0.25
Playback device is mcl
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 256 to 16384
Period size range from 256 to 16384
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
0 - Front Left
1 - Front Right
Time per period = 2.944647
0 - Front Left
^C
Also with mpd
pi@raspberrypi ~ mpc play
A globally available device should be put into/etc/asound.conf
. A device available for the usermpd
should be put into/home/mpd/.asoundrc
.
– CL.
Jan 25 '15 at 12:32
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f180949%2fmpd-fails-to-open-alsa-device-where-aplay-succeeds%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
mpd
's alsa output does not find the device, because it really is not defined!mpd
(the daemon program) is run as user mpd
which does not know about the "regular" user pi
s /home/pi/.asoundrc
This can be tested by running a player as user mpd
:
pi@raspberrypi ~ $ sudo -u mpd speaker-test -t wav -c 2 -D mcl
I have discovered elsewhere that there is in fact an alsa configuration file
pi@raspberrypi ~ $ sudo nano /usr/share/alsa/alsa.conf
#
# ALSA library configuration file
#
# pre-load the configuration files
@hooks [
func load
files [
@func concat
strings [
@func datadir
"/alsa.conf.d/"
]
"/etc/asound.conf"
"~/.asoundrc"
"/home/pi/.asoundrc" # added !
]
errors false
]
...
to which I have added pi
's local config.
And then it works:
pi@raspberrypi ~ $ sudo -u mpd speaker-test -t wav -c 2 -D mcl
speaker-test 1.0.25
Playback device is mcl
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 256 to 16384
Period size range from 256 to 16384
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
0 - Front Left
1 - Front Right
Time per period = 2.944647
0 - Front Left
^C
Also with mpd
pi@raspberrypi ~ mpc play
A globally available device should be put into/etc/asound.conf
. A device available for the usermpd
should be put into/home/mpd/.asoundrc
.
– CL.
Jan 25 '15 at 12:32
add a comment |
mpd
's alsa output does not find the device, because it really is not defined!mpd
(the daemon program) is run as user mpd
which does not know about the "regular" user pi
s /home/pi/.asoundrc
This can be tested by running a player as user mpd
:
pi@raspberrypi ~ $ sudo -u mpd speaker-test -t wav -c 2 -D mcl
I have discovered elsewhere that there is in fact an alsa configuration file
pi@raspberrypi ~ $ sudo nano /usr/share/alsa/alsa.conf
#
# ALSA library configuration file
#
# pre-load the configuration files
@hooks [
func load
files [
@func concat
strings [
@func datadir
"/alsa.conf.d/"
]
"/etc/asound.conf"
"~/.asoundrc"
"/home/pi/.asoundrc" # added !
]
errors false
]
...
to which I have added pi
's local config.
And then it works:
pi@raspberrypi ~ $ sudo -u mpd speaker-test -t wav -c 2 -D mcl
speaker-test 1.0.25
Playback device is mcl
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 256 to 16384
Period size range from 256 to 16384
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
0 - Front Left
1 - Front Right
Time per period = 2.944647
0 - Front Left
^C
Also with mpd
pi@raspberrypi ~ mpc play
A globally available device should be put into/etc/asound.conf
. A device available for the usermpd
should be put into/home/mpd/.asoundrc
.
– CL.
Jan 25 '15 at 12:32
add a comment |
mpd
's alsa output does not find the device, because it really is not defined!mpd
(the daemon program) is run as user mpd
which does not know about the "regular" user pi
s /home/pi/.asoundrc
This can be tested by running a player as user mpd
:
pi@raspberrypi ~ $ sudo -u mpd speaker-test -t wav -c 2 -D mcl
I have discovered elsewhere that there is in fact an alsa configuration file
pi@raspberrypi ~ $ sudo nano /usr/share/alsa/alsa.conf
#
# ALSA library configuration file
#
# pre-load the configuration files
@hooks [
func load
files [
@func concat
strings [
@func datadir
"/alsa.conf.d/"
]
"/etc/asound.conf"
"~/.asoundrc"
"/home/pi/.asoundrc" # added !
]
errors false
]
...
to which I have added pi
's local config.
And then it works:
pi@raspberrypi ~ $ sudo -u mpd speaker-test -t wav -c 2 -D mcl
speaker-test 1.0.25
Playback device is mcl
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 256 to 16384
Period size range from 256 to 16384
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
0 - Front Left
1 - Front Right
Time per period = 2.944647
0 - Front Left
^C
Also with mpd
pi@raspberrypi ~ mpc play
mpd
's alsa output does not find the device, because it really is not defined!mpd
(the daemon program) is run as user mpd
which does not know about the "regular" user pi
s /home/pi/.asoundrc
This can be tested by running a player as user mpd
:
pi@raspberrypi ~ $ sudo -u mpd speaker-test -t wav -c 2 -D mcl
I have discovered elsewhere that there is in fact an alsa configuration file
pi@raspberrypi ~ $ sudo nano /usr/share/alsa/alsa.conf
#
# ALSA library configuration file
#
# pre-load the configuration files
@hooks [
func load
files [
@func concat
strings [
@func datadir
"/alsa.conf.d/"
]
"/etc/asound.conf"
"~/.asoundrc"
"/home/pi/.asoundrc" # added !
]
errors false
]
...
to which I have added pi
's local config.
And then it works:
pi@raspberrypi ~ $ sudo -u mpd speaker-test -t wav -c 2 -D mcl
speaker-test 1.0.25
Playback device is mcl
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 256 to 16384
Period size range from 256 to 16384
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
0 - Front Left
1 - Front Right
Time per period = 2.944647
0 - Front Left
^C
Also with mpd
pi@raspberrypi ~ mpc play
answered Jan 25 '15 at 12:09
nonenone
3114
3114
A globally available device should be put into/etc/asound.conf
. A device available for the usermpd
should be put into/home/mpd/.asoundrc
.
– CL.
Jan 25 '15 at 12:32
add a comment |
A globally available device should be put into/etc/asound.conf
. A device available for the usermpd
should be put into/home/mpd/.asoundrc
.
– CL.
Jan 25 '15 at 12:32
A globally available device should be put into
/etc/asound.conf
. A device available for the user mpd
should be put into /home/mpd/.asoundrc
.– CL.
Jan 25 '15 at 12:32
A globally available device should be put into
/etc/asound.conf
. A device available for the user mpd
should be put into /home/mpd/.asoundrc
.– CL.
Jan 25 '15 at 12:32
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f180949%2fmpd-fails-to-open-alsa-device-where-aplay-succeeds%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown