MusicPlayerDaemon / MPD

Music Player Daemon
https://www.musicpd.org/
GNU General Public License v2.0
2.16k stars 347 forks source link

Volume can't be set when using pipewire-alsa or alsa-plugins #1222

Closed zsoltiv closed 3 years ago

zsoltiv commented 3 years ago

Bug report

Describe the bug

Can't set MPD's volume via mpc or other clients when using pipewire-alsa or alsa-plugins with PulseAudio.

Output of mpc volume: volume: n/a

Expected Behavior

MPD's volume can be changed from clients (mpc volume 70 for instance).

Actual Behavior

The volume doesn't change.

Version

Music Player Daemon 0.22.3 (0.22.3)
Copyright 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright 2008-2018 Max Kellermann <max.kellermann@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins:
 simple proxy

Storage plugins:
 local

Decoders plugins:
 [oggflac] ogg oga
 [flac] flac
 [audiofile] wav au aiff aif
 [dsdiff] dff
 [dsf] dsf
 [hybrid_dsd] m4a
 [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve rtp:// rtsp:// rtsps://
 [gme] ay gbs gym hes kss nsf nsfe sap spc vgm vgz
 [pcm]

Filters:
 soxr

Tag plugins:
 id3tag

Output plugins:
 null fifo alsa pulse httpd

Encoder plugins:
 null wave flac

Archive plugins:
 [bz2] bz2

Input plugins:
 file io_uring archive alsa curl ffmpeg

Playlist plugins:
 extm3u m3u pls flac cue embcue

Protocols:
 file:// alsa:// ftp:// ftps:// gopher:// hls+http:// hls+https:// http:// https:// mmsh:// mmst:// rtmp:// rtmps:// rtmpt:// rtmpts:// rtp:// rtsp:// rtsps:// srtp://

Other features:
 epoll icu inotify tcp un
MaxKellermann commented 3 years ago

Your MPD version is 7 bug-fix releases behind and thus unsupported. You omitted your configuration and the log.

zsoltiv commented 3 years ago

I apologize, I forgot to check wether I was on the latest version, however, I just updated to 0.22.10 and the issue persists. The logs don't show anything when changing the volume. Here's my mpd.conf:

audio_output {
    type "alsa"
    name "PipeWire"
}

input {
    plugin "curl"
}

music_directory    "/mnt/media/Music/"
db_file "~/.config/mpd/database"
playlist_directory "~/.config/mpd/playlists/"

pid_file "~/.config/mpd/pid"
log_file "~/.config/mpd/mpd.log"

And here is the log:

Aug 09 18:39 : exception: Bad song index
Aug 09 18:44 : exception: Failed to play on "PipeWire" (pulse): disconnected
Aug 09 18:44 : exception: Failed to open audio output
Aug 09 18:44 : player: played "moody/[DREAM_56] - DARKPYRAMID - A Heart Full Of Love/DARKPYRAMID - 12 - Outside The Pyramid.flac"
Aug 09 18:45 : exception: Failed to read mixer for 'PipeWire': no such mixer control: PCM
Aug 09 18:45 : exception: Failed to open mixer for 'PipeWire': no such mixer control: PCM
Aug 09 18:48 : exception: Number too large: 53421231
Aug 09 18:51 : player: played "moody/Wuso/w u s o 命 - You'll Be Okay- I Promise/w u s o 命 - You'll Be Okay, I Promise - 10 You'll Be Okay, I Promise.flac"
MaxKellermann commented 3 years ago

Your log explains it to you:

Aug 09 18:45 : exception: Failed to read mixer for 'PipeWire': no such mixer control: PCM

You did not configure the mixer properly (or rather: not at all), so MPD tries lousy defaults which don't work. See https://mpd.readthedocs.io/en/stable/plugins.html#alsa-plugin for details.

MaxKellermann commented 3 years ago

Hint: MPD git-master has native PipeWire support.

zsoltiv commented 3 years ago

I see, thank you for the hint.