You are not logged in.

#1 2013-06-10 08:18:28

geekinthesticks
Member
From: England
Registered: 2011-09-21
Posts: 143
Website

MPD On A Headless VM. No Sound.

I have all my music stored on an Ubuntu server. On this server I have created an Arch based KVM VM to run minidlna and mpd. MPD seems to be working - I can see files being added to the library and I can connect to it using a variety of clients. However, there is no sound. Here is the alsa section of my mpd.conf:

audio_output {
        type            "alsa"
        name            "My ALSA Device"
##      device          "hw:0,0"        # optional
##      format          "44100:16:2"    # optional
        mixer_type      "software"      # optional
##      mixer_device    "default"       # optional
##      mixer_control   "PCM"           # optional
##      mixer_index     "0"             # optional
}

I have checked that the card isn't muted and volume is turned up to 100% using alsa-mixer.  Alsa seems to detect the card ok (it's an Intel). So what am I missing?

Offline

#2 2013-06-10 10:53:42

scar
Member
From: Hungary
Registered: 2009-10-01
Posts: 449

Re: MPD On A Headless VM. No Sound.

Is there a "PCM" channel if you look at alsamixer?


“The future has already arrived. It's just not evenly distributed yet.”
― William Gibson

Offline

#3 2013-06-10 10:57:41

geekinthesticks
Member
From: England
Registered: 2011-09-21
Posts: 143
Website

Re: MPD On A Headless VM. No Sound.

Yes. Also I get sound OK when streaming from minidlna.

Offline

#4 2013-06-10 14:36:35

t0m5k1
Member
From: overthere
Registered: 2012-02-10
Posts: 326

Re: MPD On A Headless VM. No Sound.

i use the following mpd.conf & all works fine on ubuntu 12.04

┌─[t0m5k1@pr0xy]-[jb:0] 
└─>[~] 
└─>>scat /etc/mpd.conf
[sudo] password for t0m5k1: 

music_directory			"/media/1TB/Music/"
#
playlist_directory		"/media/1TB/Music/playlists"
#
db_file			"/var/lib/mpd/tag_cache"
# 
log_file			"/var/log/mpd/mpd.log"
#
pid_file			"/var/run/mpd/pid"
#
state_file			"/var/lib/mpd/state"
#
bind_to_address		"192.168.1.250"
#
port				"6600"
#
save_absolute_paths_in_playlists	"yes"
#
metadata_to_use	"artist,album,title,track,name,genre,date,composer,performer,disc,comment"
#
follow_outside_symlinks	"yes"
#
follow_inside_symlinks		"yes"
#
zeroconf_enabled		"yes"
#
zeroconf_name			"Music Player on pr0xy"
#
audio_output {
	type		"alsa"
	name		"My ALSA Device"
	device		"hw:0,0"	# optional
	format		"44100:16:2"	# optional
	mixer_device	"default"	# optional
	mixer_control	"PCM"		# optional
	mixer_index	"0"		# optional
}
#
mixer_type			"software"
#
buffer_before_play		"10%"
#
filesystem_charset		"UTF-8"
#
id3v1_encoding			"UTF-8"
#

Last edited by t0m5k1 (2013-06-10 14:37:17)


Aurora R10 (0TYR0X) - Ryzen 7 5800X - 16GB - RX6700XT 12GB - Hyprland (occasionally XFCE) - AOC Q27G3XMN 1440P
EFI Stub Boot
PROUD XLIBRE USER
Linux User: 401820  Steam-Reddit

Offline

#5 2013-06-12 13:28:18

geekinthesticks
Member
From: England
Registered: 2011-09-21
Posts: 143
Website

Re: MPD On A Headless VM. No Sound.

I have now moved everything onto my laptop to try and get it working. mpd reads my music fine. However, I am struggling to configure my sound. mpd is run via systemd and configured as the mpd user. However, it doesn't seem able to connect to my audio devices. In mpd.conf I have:

audio_output {                                                                                                         
       type            "alsa"                                                                                          
       name            "My ALSA Device"                                                                                
       device          "hw:0,0"        # optional                                                                      
#       format          "44100:16:2"    # optional                                                                      
##      mixer_type      "hardware"      # optional                                                                      
        mixer_type      "software"
##      mixer_device    "default"       # optional                                                                      
##      mixer_control   "PCM"           # optional                                                                      
##      mixer_index     "0"             # optional                                                                      
}       

When I try to play back I get the following error:

ALSA lib pcm_hw.c:1669:(_snd_pcm_hw_open) Invalid value for card
Jun 12 13:43 : output: Failed to open "My ALSA Device" [alsa]: Failed to open ALSA device "hw:0,0": No such file or directory

aplay -l shows:

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC269VB Analog [ALC269VB Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I can play sounds with:

aplay /usr/share/sounds/alsa/Front_Right.wav

I must be missing something obvious, but can't see what it is.

Offline

#6 2013-06-12 13:45:31

t0m5k1
Member
From: overthere
Registered: 2012-02-10
Posts: 326

Re: MPD On A Headless VM. No Sound.

have you tried to uncomment the the optional parts of the audio section?
I had to to get mine working which is why I posted it

Last edited by t0m5k1 (2013-06-12 13:46:00)


Aurora R10 (0TYR0X) - Ryzen 7 5800X - 16GB - RX6700XT 12GB - Hyprland (occasionally XFCE) - AOC Q27G3XMN 1440P
EFI Stub Boot
PROUD XLIBRE USER
Linux User: 401820  Steam-Reddit

Offline

#7 2013-06-12 13:54:38

geekinthesticks
Member
From: England
Registered: 2011-09-21
Posts: 143
Website

Re: MPD On A Headless VM. No Sound.

Yes tried un-commenting and trying both hardware and software mixers, plus other sections and still can't find the card:

ALSA lib pcm_hw.c:1669:(_snd_pcm_hw_open) Invalid value for card
Jun 12 14:50 : output: Failed to open "My ALSA Device" [alsa]: Failed to open ALSA device "hw:0,0": No such file or directory
Jun 12 14:50 : avahi: Service 'scamper2 Music Player' successfully established.
Jun 12 14:50 : mixer: Failed to read mixer for 'My ALSA Device': failed to attach to default: No such file or directory

Offline

#8 2013-06-12 14:41:56

t0m5k1
Member
From: overthere
Registered: 2012-02-10
Posts: 326

Re: MPD On A Headless VM. No Sound.

give this a go:

audio_output {
        type            "alsa"
        name            "MPD ALSA"
        mixer_type      "software"
        mixer_device    "default"
        mixer_control   "PCM"
}

or this if you have pulse audio installed:

audio_output {
        type    "pulse"
        name    "My MPD PulseAudio Output"
        #server  "localhost"   # optional
        #sink    "alsa_output" # optional
}

Last edited by t0m5k1 (2013-06-12 14:44:02)


Aurora R10 (0TYR0X) - Ryzen 7 5800X - 16GB - RX6700XT 12GB - Hyprland (occasionally XFCE) - AOC Q27G3XMN 1440P
EFI Stub Boot
PROUD XLIBRE USER
Linux User: 401820  Steam-Reddit

Offline

#9 2013-06-12 15:17:09

geekinthesticks
Member
From: England
Registered: 2011-09-21
Posts: 143
Website

Re: MPD On A Headless VM. No Sound.

Update. The following lets me get sound:

audio_output {
        type            "alsa"
        name            "My ALSA Device"
#       device          "hw 0,0"        # optional                                                                      
        format          "44100:16:2"    # optional                                                                      
##      mixer_type      "hardware"      # optional                                                                      
##      mixer_type      "software"                                                                                      
#       mixer_device    "default"       # optional                                                                      
#       mixer_control   "PCM"           # optional                                                                      
#       mixer_index     "0"             # optional                                                                      
}

Not marking as solved yet until I can get to the bottom of why specifying the device name doesn't work.

Offline

Board footer

Powered by FluxBB