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

MPD reports wrong bitrate for DSF files (only single channel bitrate) #639

Open
ronalde opened this issue Sep 8, 2019 · 0 comments

Comments

@ronalde
Copy link

commented Sep 8, 2019

Bug report

Describe the bug

When playing a DSF file, the bitrate info field returns the bitrate for a single channel (given that fs=44100):

  • for a 2 channel fs*64*1 (DSD64) = 2822400Hz file: 1 * 2822400 =~ 2822 kbit/s
  • for a 6 channel fs*64*2 (DSD128) = 5644800Hz file: 1 * 5644800 =~ 5645 kbit/s

Expected Behavior

MPD reports the right bitrate value for DSF files, ie the total number of bits per second, consistent with other file formats, eg: channelcount * bitdepth * samplerate (given that fs=44100):

  • for a 2 channel fs*64*1 (DSD64) = 2822400Hz file: 2 * 1 * ( fs * 64 * 1) = 2 * 1 * 2822400 = 5644800 bit/s =~ 5644 kbit/s
  • for a 6 channel fs*64*2 (DSD128) = 5644800Hz file: 6 * 1 * ( fs * 64 * 2) = 6 * 1 * 5644800 = 33868800 bit/s =~ 33869 (kbit/s)

Actual Behavior

MPD reports the wrong value, eg: samplerate * bitdepth.

Version

Music Player Daemon 0.21.14 (0.21.14)
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 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
 [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
 [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
 [gme] ay gbs gym hes kss nsf nsfe sap spc vgm vgz
 [pcm]

Filters:
 libsamplerate soxr

Tag plugins:
 id3tag

Output plugins:
 shout null fifo pipe alsa ao oss openal solaris pulse jack httpd recorder

Encoder plugins:
 null vorbis opus lame twolame wave flac

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

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

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

Protocols:
 file:// alsa:// tidal:// qobuz:// http:// https:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps:// smb:// nfs:// mms:// mmsh:// mmst:// mmsu:// cdda://

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

Log

Sep 08 11:49 : playlist: play 6:"sweep-176400hz-0-22050hz-20s-D128-5.6mhz.dsf"
Sep 08 11:49 : decoder_thread: probing plugin dsf
Sep 08 11:49 : decoder: audio_format=dsd128:2, seekable=true
Sep 08 11:49 : alsa_output: opened hw:0,0 type=HW
Sep 08 11:49 : alsa_output: buffer: size=32..524288 time=166..2730667
Sep 08 11:49 : alsa_output: period: size=16..262144 time=83..1365334
Sep 08 11:49 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000
Sep 08 11:49 : alsa_output: format=S32_LE (Signed 32 bit Little Endian)
Sep 08 11:49 : alsa_output: buffer_size=96000 period_size=24000
Sep 08 11:49 : output: opened "internal intel hda" (alsa) audio_format=192000:32:2
Sep 08 11:49 : libsamplerate: setting samplerate conversion ratio to 0.27
Sep 08 11:49 : output: converting in=dsd128:2 -> f=dsd128:2 -> out=192000:32:2
Sep 08 11:49 : state_file: Saving state file /var/lib/mpd/mpdstate
Sep 08 11:49 : player: played "sweep-176400hz-0-22050hz-20s-D128-5.6mhz.dsf"
Sep 08 11:49 : playlist: stop
Sep 08 11:49 : output: closed "internal intel hda" (alsa)
Sep 08 11:49 : state_file: Saving state file /var/lib/mpd/mpdstate

Sample (dsd128:2) file obtained from: http://samplerateconverter.com/free-files/samples/dsf/sweep-176400hz-0-22050hz-20s-D128-5.6mhz.zip

MaxKellermann added a commit that referenced this issue Sep 8, 2019
decoder/{dsf,dsdiff}: fix displayed bit rate
The formula did not consider the channel count.

Closes #639
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.