MusicPlayerDaemon / MPD

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

NetEase cloud music upnp mpd+upmpdcli tear sound #2037

Closed lazybat closed 4 months ago

lazybat commented 4 months ago

Bug report

Describe the bug

The hardware used is Raspberry PI 4b The decoder : holo spring2 、Sony TA-ZH1ES NetEase cloud music(android app) pushed is 96k, but the mpd output is recognized as 44.1k and the sound is tearing. Using aprenderer-arm32 and gmrender-resurrect sound is normal

Rip sound only in upnp mode, it is normal to play if the song is downloaded.

Expected Behavior

sound is normal

Actual Behavior

sound is tearing

Version

Music Player Daemon 0.23.14 (0.23.14) Copyright 2003-2007 Warren Dukes warren.dukes@gmail.com Copyright 2008-2021 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

Storage plugins: local udisks curl

Decoders plugins: [mad] mp3 mp2 [oggflac] ogg oga [flac] flac [dsdiff] dff [dsf] dsf [hybrid_dsd] m4a [faad] aac [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:// [pcm]

Filters:

Tag plugins: id3tag

Output plugins: null fifo pipe alsa recorder

Encoder plugins: null wave flac

Archive plugins: [iso] iso

Input plugins: file archive alsa curl ffmpeg

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

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

Other features: dbus udisks epoll iconv inotify ipv6 tcp un

Configuration

cat /etc/mpd.conf

pid_file "/var/run/mpd.pid" log_file "/tmp/mpd/log"

audio_output { type "alsa" name "TA-ZH1ES" device "hw:1,0" mixer_type "null" dop "yes" }

Log

mpd -v

config_file: loading file /etc/mpd.conf May 04 18:48 : 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 May 04 18:48 : hybrid_dsd: The Hybrid DSD decoder is disabled because it was not explicitly enabled May 04 18:48 : config: Found database setting without music_directory - disabling database May 04 18:48 : curl: version 8.6.0 May 04 18:48 : curl: with OpenSSL/3.2.1

cat /tmp/mpd/log

May 04 18:48 : client: [0] opened from 127.0.0.1:57314 May 04 18:48 : client: [1] opened from 127.0.0.1:57318 May 04 18:48 : client: [1] process command "status" May 04 18:48 : client: [1] command returned 0 May 04 18:48 : client: [0] process command "idle playlist player mixer options" May 04 18:48 : client: [0] command returned 1 May 04 18:49 : client: [1] process command "play" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "status" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "clear" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "repeat "0"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "random "0"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "single "0"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "consume "0"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "addid "http://m701.music.126.net/20240505031437/8dbf40ea2c214d1f2d42b4128add8787/jdymusic/obj/wo3DlMOGwrbDjj7DisKw/26272768756/eac2/3d0c/b70b/e145cc0b982db64db5ebd7e0e285f7fa.flac" "0"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "addtagid "1" "Artist" "徐誉滕"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "addtagid "1" "Album" "滕爱Teng Love"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "addtagid "1" "Title" "等一分钟 Wait One Minute"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "addtagid "1" "Track" """ May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "addtagid "1" "Comment" "client=upmpdcli;"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "status" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "play "0"" May 04 18:49 : playlist: play 0:"http://m701.music.126.net/20240505031437/8dbf40ea2c214d1f2d42b4128add8787/jdymusic/obj/wo3DlMOGwrbDjj7DisKw/26272768756/eac2/3d0c/b70b/e145cc0b982db64db5ebd7e0e285f7fa.flac" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "status" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "currentsong" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "playlistinfo "1"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "status" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "currentsong" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "playlistinfo "1"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "status" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "currentsong" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "playlistinfo "1"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : decoder_thread: probing plugin mad May 04 18:49 : decoder: audio_format=8000:24:1, seekable=false May 04 18:49 : client: [1] process command "play" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "status" May 04 18:49 : alsa_output: opened hw:1,0 type=HW May 04 18:49 : alsa_output: buffer: size=16..88200 time=362..2000000 May 04 18:49 : alsa_output: period: size=8..44100 time=181..1000000 May 04 18:49 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000 May 04 18:49 : alsa_output: format=S32_LE (Signed 32 bit Little Endian) May 04 18:49 : alsa_output: buffer_size=22050 period_size=5513 May 04 18:49 : output: opened "TA-ZH1ES" (alsa) audio_format=44100:32:2 May 04 18:49 : output: converting in=8000:24:1 -> f=8000:24:1 -> out=44100:32:2 May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "currentsong" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "playlistinfo "1"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [0] process command "idle playlist player mixer options" May 04 18:49 : client: [0] command returned 1 May 04 18:49 : client: [1] process command "status" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "currentsong" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "playlistinfo "1"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "status" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "currentsong" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "playlistinfo "1"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [0] process command "idle playlist player mixer options" May 04 18:49 : client: [0] command returned 1 May 04 18:49 : client: [1] process command "status" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "currentsong" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "playlistinfo "1"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "status" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "currentsong" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "playlistinfo "1"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "status" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "currentsong" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "playlistinfo "1"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "status" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "currentsong" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "playlistinfo "1"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "status" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "currentsong" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "playlistinfo "1"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "status" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "currentsong" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "playlistinfo "1"" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "status" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "currentsong" May 04 18:49 : client: [1] command returned 0 May 04 18:49 : client: [1] process command "playlistinfo "1"" May 04 18:49 : client: [1] command returned 0

MaxKellermann commented 4 months ago

NetEase cloud music(android app) pushed is 96k

According to your log, your music file has a sample rate of 8 kHz, not 96 kHz. Provide evidence that the file is really 96 kHz.

but the mpd output is recognized as 44.1k

No, that's just the sample rate that your sound chip accepts. MPD asked it to play 8 kHz (matching your input file), but your sound chip refused that and suggested 44.1 kHz instead.

and the sound is tearing.

What does that mean, exactly?

lazybat commented 4 months ago

NetEase cloud music(android app) pushed is 96k

According to your log, your music file has a sample rate of 8 kHz, not 96 kHz. Provide evidence that the file is really 96 kHz.

but the mpd output is recognized as 44.1k

No, that's just the sample rate that your sound chip accepts. MPD asked it to play 8 kHz (matching your input file), but your sound chip refused that and suggested 44.1 kHz instead.

and the sound is tearing.

What does that mean, exactly?

The sound is broken and deformed noise, which is only played by upnp using NetEase Cloud Music app. Player software address: https://music.163.com/#/download

MaxKellermann commented 4 months ago

Did you read my last sentence only?

lazybat commented 4 months ago

Did you read my last sentence only?

I am sorry that my English is poor and I can only use translation software to describe the problem.

You look at the url address in the log, is the flac file url when NetEase cloud music upnp is played, those urls can be downloaded when played, but after a period of time can not be downloaded.

It was only after downloading that I found out that the files were 96khz, but when I played them with NetEase Cloud's upnp decoder, it showed 44.1khz. But those downloaded files are played locally using mpd, which is normal.

This problem needs to be reproduced when NetEase cloud music upnp is played to mpd+upmpdcli. I hope you'll give it a try.

I don't know if you can access the download page, I send out the url of the Android version, you can download it directly.

https://d1.music.126.net/dmusic/NeteaseCloudMusic_Music_official_9.0.76.240429145737_3264.apk

MaxKellermann commented 4 months ago

I'm not interested in installing this proprietary software, and since you still didn't produce the evidence I asked for, I can't help you.

lazybat commented 4 months ago

I'm not interested in installing this proprietary software, and since you still didn't produce the evidence I asked for, I can't help you.

I tested moode and volumio, two mpd webGUIs that also use mpd+umpmdcli. Their upnp sound with NetEase Cloud music app is also abnormal, only the sound played on Silent Angel M1T is normal, M1T uses Raspberry PI +mpd+upmpdcli, they fixed the problem.