MusicPlayerDaemon / MPD

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

Crossfading only works between files with the same bit depth/sampling rate #1503

Closed Popkornium18 closed 2 years ago

Popkornium18 commented 2 years ago

Bug report

Describe the bug

Crossfading only works between files with the same bit depth/sampling rate. I suspect that this only happens with the PipeWire backend and that it is related to #1465.

Expected Behavior

Crossfading works on each track

Actual Behavior

Crossfading breaks when flac files have different bit depth or sampling rate

Version

Version: ``` Music Player Daemon 0.23.6 (0.23.6) Copyright 2003-2007 Warren Dukes Copyright 2008-2021 Max Kellermann 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 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 [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 pipe alsa ao oss openal solaris pipewire pulse jack httpd snapcast recorder Encoder plugins: null vorbis opus lame twolame wave flac Archive plugins: [bz2] bz2 [zzip] zip [iso] iso Input plugins: file io_uring 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 ```
Log: ``` config_file: loading file /home/user/.config/mpd/mpd.conf server_socket: bind to '0.0.0.0:6600' failed (continuing anyway, because binding to '[::]:6600' succeeded): Failed to bind socket: Address already in use libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator' vorbis: Xiph.Org libVorbis 1.3.7 opus: libopus 1.3.1 sndfile: libsndfile-1.0.31 hybrid_dsd: The Hybrid DSD decoder is disabled because it was not explicitly enabled decoder: Decoder plugin 'wildmidi' is unavailable: configuration file does not exist: /etc/timidity/timidity.cfg simple_db: reading DB input: Input plugin 'qobuz' is not configured: No Qobuz app_id configured curl: version 7.82.0 curl: with OpenSSL/1.1.1n state_file: Loading state file /home/user/.local/share/mpd/flac-state event: RTIOThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted client: [0] opened from [::1]:43370 client: [0] process command "commands" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "tagtypes" client: [0] command returned 0 client: [0] process command "list "genre"" client: [0] command returned 0 client: [0] process command "list "albumartistsort" "group" "albumartist"" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "list "albumsort" "albumartist" "Kazuya Nagaya" "group" "date" "group" "album"" client: [0] command returned 0 client: [0] process command list client: process command "tagtypes "clear"" client: command returned 0 client: process command "tagtypes "enable" "albumartist"" client: command returned 0 client: process command "tagtypes "enable" "album"" client: command returned 0 client: [0] process command list returned 0 client: [0] process command "find "albumartist" "Kazuya Nagaya" "album" "Dream Interpretation" "date" "2020" "window" "0:1"" client: [0] command returned 0 client: [0] process command "tagtypes "all"" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command list client: process command "tagtypes "clear"" client: command returned 0 client: process command "tagtypes "enable" "track"" client: command returned 0 client: process command "tagtypes "enable" "disc"" client: command returned 0 client: process command "tagtypes "enable" "title"" client: command returned 0 client: process command "tagtypes "enable" "artist"" client: command returned 0 client: process command "tagtypes "enable" "album"" client: command returned 0 client: process command "tagtypes "enable" "date"" client: command returned 0 client: process command "tagtypes "enable" "genre"" client: command returned 0 client: [0] process command list returned 0 client: [0] process command "playlistinfo" client: [0] command returned 0 client: [0] process command "tagtypes "all"" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [1] opened from [::1]:43372 client: [1] process command "subscribe "mpdscribble"" client: [1] command returned 0 client: [1] process command list client: process command "status" client: command returned 0 client: process command "currentsong" client: command returned 0 client: [1] process command list returned 0 client: [1] process command "idle player message" client: [1] command returned 1 client: [0] process command "random "0"" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "play "21"" playlist: play 21:"Download/WEB/16-44/C418/(2013) Minecraft - Volume Beta/1-12 - Floating Trees.flac" client: [0] command returned 0 playlist: queue song 22:"Download/Rip/Blood Incantation/(2022) Timewave Zero/1 - Io.flac" decoder_thread: probing plugin flac decoder: audio_format=44100:16:2, seekable=true output: OutputThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted output: opened "My PipeWire Output" (pipewire) audio_format=44100:16:2 replay_gain: replay gain mode has changed off->album replay_gain: scale=1 replay_gain: scale=0.51760685 client: [1] process command list client: process command "status" client: command returned 0 client: process command "currentsong" client: command returned 0 client: [1] process command list returned 0 client: [1] process command "idle player message" client: [1] command returned 1 client: [1] process command list client: process command "status" client: command returned 0 client: process command "currentsong" client: command returned 0 client: [1] process command list returned 0 client: [1] process command "idle player message" client: [1] command returned 1 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "seekcur "222.25375288683603"" playlist: queue song 22:"Download/Rip/Blood Incantation/(2022) Timewave Zero/1 - Io.flac" client: [0] command returned 0 client: [1] process command list client: process command "status" client: command returned 0 client: process command "currentsong" client: command returned 0 client: [1] process command list returned 0 client: [1] process command "idle player message" client: [1] command returned 1 decoder_thread: probing plugin flac decoder: audio_format=44100:16:2, seekable=true replay_gain: replay gain mode has changed off->album replay_gain: scale=1 replay_gain: scale=0.63241184 player: played "Download/WEB/16-44/C418/(2013) Minecraft - Volume Beta/1-12 - Floating Trees.flac" replay_gain: scale=0.63241184 playlist: queue song 23:"Download/Rip/Blood Incantation/(2022) Timewave Zero/2 - Ea.flac" client: [1] process command list client: process command "status" client: command returned 0 client: process command "currentsong" client: command returned 0 client: [1] process command list returned 0 client: [1] process command "idle player message" client: [1] command returned 1 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "lsinfo "Download/Rip/Blood Incantation/(2022) Timewave Zero/3 - Chronophagia.flac"" client: [0] command returned 0 client: [0] process command "lsinfo "Download/WEB/24-44/Andrew Heath/(2022) Quiet Noise/02 - The Arms of Morpheus.flac"" client: [0] command returned 0 client: [0] process command "play "24"" playlist: play 24:"Download/Rip/Blood Incantation/(2022) Timewave Zero/3 - Chronophagia.flac" decoder_thread: probing plugin flac decoder: audio_format=44100:16:2, seekable=true client: [0] command returned 0 playlist: queue song 25:"Download/WEB/24-44/Andrew Heath/(2022) Quiet Noise/02 - The Arms of Morpheus.flac" client: [1] process command list client: process command "status" client: command returned 0 client: process command "currentsong" client: command returned 0 client: [1] process command list returned 0 client: [1] process command "idle player message" client: [1] command returned 1 client: [0] process command "currentsong" client: [0] command returned 0 replay_gain: scale=0.63241184 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "seekcur "1633.5392863741338"" playlist: queue song 25:"Download/WEB/24-44/Andrew Heath/(2022) Quiet Noise/02 - The Arms of Morpheus.flac" client: [0] command returned 0 client: [1] process command list client: process command "status" client: command returned 0 client: process command "currentsong" client: command returned 0 client: [1] process command list returned 0 client: [1] process command "idle player message" client: [1] command returned 1 decoder_thread: probing plugin flac decoder: audio_format=44100:24:2, seekable=true player: played "Download/Rip/Blood Incantation/(2022) Timewave Zero/3 - Chronophagia.flac" playlist: queue song 26:"Download/WEB/24-44/Andrew Heath/(2022) Quiet Noise/03 - The Man who became his Painting.flac" output: opened "My PipeWire Output" (pipewire) audio_format=44100:24:2 replay_gain: replay gain mode has changed off->album replay_gain: scale=1 replay_gain: scale=0.64047176 client: [1] process command list client: process command "status" client: command returned 0 client: process command "currentsong" client: command returned 0 client: [1] process command list returned 0 client: [1] process command "idle player message" client: [1] command returned 1 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "currentsong" client: [0] command returned 0 client: [0] process command "stop" playlist: stop player: played "Download/WEB/24-44/Andrew Heath/(2022) Quiet Noise/02 - The Arms of Morpheus.flac" output: closed "My PipeWire Output" (pipewire) client: [0] command returned 0 client: [1] process command list client: process command "status" client: command returned 0 client: process command "currentsong" client: command returned 0 client: [1] process command list returned 0 client: [1] process command "idle player message" client: [1] command returned 1 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 client: [0] process command "ping" client: [0] command returned 0 state_file: Saving state file /home/user/.local/share/mpd/flac-state ```
MaxKellermann commented 2 years ago

This is a documented limitation: https://mpd.readthedocs.io/en/stable/user.html#cross-fading How would you, technically, expect MPD to cross-fade songs with a different audio format?

Popkornium18 commented 2 years ago

I see, I assumed it was an issue since it is very similar to the volume problem.

How would you, technically, expect MPD to cross-fade songs with a different audio format?

By not knowing the first thing about how this is implemented.

Popkornium18 commented 2 years ago

Would it be possible to change audio_output_format at runtime? This way clients could implement a "Force crossfade" option that reduces the quality but always works. If it would be possible I'll open a FR.