Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When setting volume on one player in multi-mpd setup, others apply the change for the next song #2113

Open
ghmrj opened this issue Sep 10, 2024 · 6 comments
Labels
waiting Waiting for more information from reporter

Comments

@ghmrj
Copy link

ghmrj commented Sep 10, 2024

Bug report

Describe the bug

I'm running multiple mpd instances in a Ubuntu Jammy (22.04) docker container environment (mpd 0.23.5) under a single user ID:

  • Two proxy instances for two separate music databases
  • Four satellite instances (3 on first, 1 on second database proxy)
    Each satellite instance has one own pulseaudio null sink and one own HTTP vorbis steam audio output.

When setting volume on one satellite instance (ex. mpc -p 6601 volume 20) while another instance is playing a playlist, the other instances applies the changed volume when switching to the next track (either when reaching end of a song in the queue, or with mpc -p 6604 next).

Expected Behavior

Volume settings are not interfering: Each player instance keeps own volume setting.

Actual Behavior

When setting volume on one satellite instance (ex. mpc -p 6601 volume 20), other instances apply the changed volume when switching to the next track (either when reaching end of a song in the queue, or with mpc -p 6604 next).

The issue has been reproduced in an isolated environment with the local mpc command line client only, no external client (smartphone etc.) could interfere. Test with mpd 23.14 on Ubuntu Noble (24.04) shows the same behaviour.

Version

Music Player Daemon 0.23.5 (0.23.5)
Copyright 2003-2007 Warren Dukes <[email protected]>
Copyright 2008-2021 Max Kellermann <[email protected]>
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 upnp

Storage plugins:
 local smbclient udisks nfs curl

Neighbor plugins:
 smbclient upnp udisks

Decoders plugins:
 [mad] mp3 mp2
 [mpg123] mp3
 [vorbis] ogg oga
 [oggflac] ogg oga
 [flac] flac
 [opus] opus ogg oga
 [sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
 [audiofile] wav au aiff aif
 [dsdiff] dff
 [dsf] dsf
 [hybrid_dsd] m4a
 [faad] aac
 [mpcdec] mpc
 [wavpack] wv
 [openmpt] mptm mod s3m xm it 669 amf ams c67 dbm digi dmf dsm dtm far imf ice j2b m15 mdl med mms mt2 mtm nst okt plm psm pt36 ptm sfx sfx2 st26 stk stm stp ult wow gdm mo3 oxm umx xpk ppm mmcmp
 [modplug] 669 amf ams dbm dfm dsm far it med mdl mod mtm mt2 okt s3m stm ult umx xm
 [mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
 [sidplay] sid mus str prg P00
 [wildmidi] mid
 [fluidsynth] mid
 [adplug] amd d00 hsc laa rad raw sa2
 [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 rsn sap spc vgm vgz
 [pcm]

Filters:
 libsamplerate soxr

Tag plugins:
 id3tag

Output plugins:
 shout null fifo sndio pipe alsa ao oss openal pipewire pulse jack httpd snapcast recorder

Encoder plugins:
 null vorbis opus lame wave flac

Archive plugins:
 [bz2] bz2
 [zzip] zip
 [iso] iso

Input plugins:
 file io_uring archive alsa curl ffmpeg smbclient nfs mms cdio_paranoia

Playlist plugins:
 extm3u m3u pls xspf asx rss soundcloud flac cue embcue

Protocols:
 file:// alsa:// cdda:// ftp:// ftps:// gopher:// hls+http:// hls+https:// http:// https:// mms:// mmsh:// mmst:// mmsu:// nfs:// rtmp:// rtmps:// rtmpt:// rtmpts:// rtp:// rtsp:// rtsps:// scp:// sftp:// smb:// srtp://

Other features:
 avahi dbus udisks epoll icu inotify ipv6 systemd tcp un

Configuration

Four satellites with below configuration (increase suffix 1 up to 4):

pid_file "/multiroom/mpd-runtime/mra_player_1/mra_player_1.pid"
music_directory "/music/musicserver"
playlist_directory "/data/players/mra_player_1/playlists"
state_file "/data/players/mra_player_1/state/state_mra_player_1.sql"
sticker_file "/data/players/mra_player_1/sticker/sticker_mra_player_1.sql"
database {
    plugin "proxy"
    host "127.0.0.1"
    port "7601"
}
audio_output {
    type "pulse"
    name "Musik für alle"
    sink "mra_player_1"
    always_on "no"
}
audio_output {
    type "httpd"
    name "HTTP vorbis Musik für alle"
    encoder "vorbis"
    port "8801"
    format "44100:16:2"
    max_clients "5"
    enabled "no"
}
bind_to_address "0.0.0.0:6601"

decoder {
    plugin "hybrid_dsd"
    enabled "no"
}
decoder {
    plugin "wildmidi"
    enabled "no"
}

Two proxy instances on port 7601 for two separate music databases:

music_directory    "/music/musicserver"
db_file            "/multiroom/mpd-runtime/musicserver/tag_cache"
pid_file           "/multiroom/mpd-runtime/musicserver/musicserver.pid"

state_file         "/data/players/musicserver/state/state_musicserver.sql"
sticker_file       "/data/players/musicserver/sticker/sticker_musicserver.sql"
user               "multiroom"
bind_to_address    "127.0.0.1"
port               "7601"

decoder {
    plugin "hybrid_dsd"
    enabled "no"
}
decoder {
    plugin "wildmidi"
    enabled "no"
}

audio_output {
    type "null"
    name "musicserver"
}

Log

There are no related logs in mpd instances that apply volume unintentionally. If special logs required, kindly advise on how to get them.

@MaxKellermann
Copy link
Member

Your MPD version is too old and unsupported.

@MaxKellermann MaxKellermann closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2024
@MaxKellermann MaxKellermann added the unsupported Affects an unsupported old MPD version. label Sep 10, 2024
@ghmrj
Copy link
Author

ghmrj commented Sep 10, 2024

Test with mpd 23.14 on Ubuntu Noble (24.04) shows the same behaviour.

I'm sorry, does that mean that only 23.15 is supported, or is there an even newer version? Would you mind pointing out if you expect the reported behaviour to be fixed in 23.15, which isn't even packaged in the latest major Linux distributions?

@MaxKellermann
Copy link
Member

Only 0.23.15 and git master is supported. I will not even look further if I see an older version in a support request, because it's not worth anybody's time.

@ghmrj
Copy link
Author

ghmrj commented Sep 10, 2024

Fair enough. I've downloaded https://www.musicpd.org/download/mpd/0.23/mpd-0.23.15.tar.xz and built it per the user guide. The issue remains the same.

Cloned and built git master, this is mpd --version:

Music Player Daemon 0.24 (v0.23.15-1536-g9ff8e02e5)
Copyright 2003-2007 Warren Dukes <[email protected]>
Copyright 2008-2021 Max Kellermann <[email protected]>
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 upnp

Storage plugins:
 local udisks nfs curl

Neighbor plugins:
 upnp udisks

Decoder plugins:
 [mpg123] mp3
 [mad] mp3 mp2
 [vorbis] ogg oga
 [oggflac] ogg oga
 [flac] flac
 [opus] opus ogg oga
 [sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
 [audiofile] wav au aiff aif
 [dsdiff] dff
 [dsf] dsf
 [faad] aac
 [mpcdec] mpc
 [wavpack] wv
 [modplug] 669 amf ams dbm dfm dsm far it med mdl mod mtm mt2 okt s3m stm ult umx xm
 [mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
 [wildmidi] mid
 [fluidsynth] mid
 [adplug] amd d00 hsc laa rad raw sa2
 [gme] ay gbs gym hes kss nsf nsfe rsn sap spc vgm vgz
 [ffmpeg] 264 265 266 302 3g2 3gp 4xm 669 722 aa aa3 aac aax ac3 ac4 ace acm act adf adp ads adx aea afc aiff aix al alias_pix alp amf amr amrnb amrwb ams anm ans apc ape apl apm apng aptx aptxhd aqt argo_asf argo_brp argo_cvg art asc asf asf_o ass ast au avc avi avif avr avs avs2 avs3 bcstm bethsoftvid bfi bfstm bin bink binka bit bitpacked bmp_pipe bmv boa bonk brender_pix brstm c2 c93 caf cdata cdg cdxl cgi cif cine codec2raw concat cri_pipe dash dat data daud dav dbm dds_pipe dfa dff dfpwm dif digi dirac diz dmf dnxhd dpx_pipe dsf dsicin dsm dss dst dtk dtm dts dtshd dv dvbsub dvbtxt dxa ea eac3 ec3 evc exr_pipe f32be f32le f4v f64be f64le fap far ffmetadata film_cpk fits flac flic flm flv frm fsb fwse g722 g723_1 g726 g726le g729 gdm gdv gem_pipe genh gif gif_pipe gsm gxf h261 h263 h264 h265 h266 h26l hca hcom hdr_pipe hevc hls hnm ice ico idcin idf idx iff ifv ilbc image2 image2pipe imf imx ipmovie ipu ircam ism isma ismv iss it iv8 ivf ivr j2b j2k j2k_pipe jacosub jpeg_pipe jpegls_pipe jpegxl_pipe jv jxl kux kvag laf libgme lmlm4 loas lrc lvf lxf m15 m2a m4a m4b m4v mac mca mcc mdl med mgsts microdvd mj2 mjpeg mjpg mk3d mka mks mkv mlp mlv mm mmcmp mmf mms mo3 mod mods moflex mov mp2 mp3 mp4 mpa mpc mpc8 mpeg mpegts mpegtsraw mpegvideo mpl2 mpo mptm msbc msf msnwctcp msp mt2 mtaf mtm mtv musx mv mvi mxf mxg nfo nist nsp nst nsv nut nuv obu ogg okt oma omg osq paf pam_pipe pbm_pipe pcx_pipe pdv pfm_pipe pgm_pipe pgmyuv_pipe pgx_pipe phm_pipe photocd_pipe pictor_pipe pjs plm pmp png_pipe pp_bnk ppm ppm_pipe psd_pipe psm psp psxstr pt36 ptm pva pvf qcif qcp qdraw_pipe qoi_pipe r3d rco rcv rgb rka rl2 rm roq rpl rsd rso rt rtp rtsp s16be s24be s24le s32be s32le s337m s3m sami sap sb sbc sbg scc scd sdns sdp sdr2 sds sdx ser sf sfx sfx2 sga sgi_pipe shn sln smi smk smush sol son sox spdif sph srt ss2 st26 stk stl stm stp str sub sunrast_pipe sup svag svg_pipe svs sw swf tak tco tedcaptions thd thp tiertexseq tiff_pipe tmv tta txd txt ty ty+ u16be u24be u24le u32be u32le ub ul ult umx usm uw v v210 vag vb vbn_pipe vc1 vidc viv vividas vmd voc vpk vqe vqf vql vt vtt vvc w64 wa wav way wc3movie webm webm_dash_manifest webp_pipe wow wsaud wsd wsvqa wtv wv wve xa xbin xbm_pipe xl xm xmd xmv xpk xpm_pipe xvag xwd_pipe xwma y4m yop yuv yuv10 rtp:// rtsp:// rtsps://
 [pcm]

Filters:
 libsamplerate soxr

Tag plugins:
 id3tag

Output plugins:
 shout null fifo sndio pipe alsa ao openal pipewire pulse jack httpd snapcast recorder

Encoder plugins:
 null vorbis opus lame twolame wave flac shine

Archive plugins:
 [bz2] bz2
 [zzip] zip
 [iso] iso

Input plugins:
 file archive alsa qobuz curl ffmpeg nfs mms cdio_paranoia

Playlist plugins:
 extm3u m3u pls xspf asx rss soundcloud flac cue embcue

Protocols:
 file:// alsa:// cdda:// ftp:// ftps:// gopher:// hls+http:// hls+https:// http:// https:// mms:// mmsh:// mmst:// mmsu:// nfs:// qobuz:// rtmp:// rtmpe:// rtmps:// rtmpt:// rtmpte:// rtmpts:// rtp:// rtsp:// rtsps:// scp:// sftp:// smb:// srtp://

Other features:
 avahi dbus udisks epoll icu inotify ipv6 systemd tcp un

Issue remains. Is it fine to reopen, or do you prefer a new issue report?

@MaxKellermann MaxKellermann reopened this Sep 24, 2024
@MaxKellermann
Copy link
Member

Tell me how you believe MPD applies the volume, and then convince me that this isn't PulseAudio interfering.

@MaxKellermann MaxKellermann added waiting Waiting for more information from reporter and removed unsupported Affects an unsupported old MPD version. labels Sep 24, 2024
@ghmrj
Copy link
Author

ghmrj commented Oct 3, 2024

When scanning the code some time back, I've seen mpd reading back the current volume of the mixer in some of the control paths, might have been the hardware mixer control path, which might be passed at the time of "play" command if I understood the code correctly. I don't recall the code location for this.

I've suspected pulseaudio interfering, too, extended my test setup:

  1. With a single pulseaudio instance but multiple null sinks (one for each mpd instance), setting the volume seems to leave a trace somewhere in pulseaudio which then reaches all other mpd instances on track change once any of the mpd instances has changed it's volume.
  2. With separate pulseaudio instances (debug scenario only), each mpd instance keeps it's volume setting without interference.

That said, I can't convince you :) - it seems pulseaudio interfering. Issue remains for all mixer parameters (software, hardware, null, none). Do you understand what's happening and can you give a hint about it?

Any chance to address this behaviour in mpd? If anybody launches two mpd instances on two soundcards on pulseaudio on a Desktop PC, they'd both interfere there, too, so it's not a nonsense usecase imho...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting Waiting for more information from reporter
Projects
None yet
Development

No branches or pull requests

2 participants