09-04-2020, 07:35 PM
I'm not sure what MPD is using to extract the sample rate and bit depth but the test file that @fmaxwell provided shows the following:
Mediainfo. This is used in the Playback screen and in Audio info. It's slow but since it's only used on-demand for a single file its not an issue.
MPD lsinfo. The Format element will already be in the MPD database when the Library is generated and so using this element is ultra fast as compared to shelling out and executing mediainfo for each file which totally kills the performance of the Library.
The bottom line is that for ALAC encoded m4a files getting the actual bit depth would require using mediainfo which if there were a lot of these files in a collection would totally bog down the Library.
I'd convert the files to FLAC using XLD. It's a lossless process and once in FLAC format the MPD Format element should contain the correct bit depth.
Mediainfo. This is used in the Playback screen and in Audio info. It's slow but since it's only used on-demand for a single file its not an issue.
Code:
pi@rp2:~ $ mediainfo --Inform="Audio;file:///var/www/mediainfo.tpl" /media/VFAT128/Test_mixed/Example24_192/01\ The\ Sound\ of\ Silence.m4a
24
192000
2
ALAC
5224592
MPD lsinfo. The Format element will already be in the MPD database when the Library is generated and so using this element is ultra fast as compared to shelling out and executing mediainfo for each file which totally kills the performance of the Library.
Code:
pi@rp2:~ $ telnet localhost 6600
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
OK MPD 0.21.11
lsinfo "USB/VFAT128/Test_mixed/Example24_192/01\ The\ Sound\ of\ Silence.m4a"
file: USB/VFAT128/Test_mixed/Example24_192/01 The Sound of Silence.m4a
Last-Modified: 2020-09-04T08:56:20Z
Format: 192000:32:2
Time: 187
duration: 187.451
Artist: Simon and Garfunkel
Album: The Graduate (24/192kHz)
Title: The Sound of Silence
Track: 1
Genre: Folk Rock
Date: 2014
OK
The bottom line is that for ALAC encoded m4a files getting the actual bit depth would require using mediainfo which if there were a lot of these files in a collection would totally bog down the Library.
I'd convert the files to FLAC using XLD. It's a lossless process and once in FLAC format the MPD Format element should contain the correct bit depth.