2017-03-28 06:21 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004471MPDInput Plugins - Filepublic2015-12-29 19:51
Assigned Tocirrus 
StatusclosedResolutionunable to reproduce 
PlatformLinuxOSArchlinuxOS Version64 bit
Product Version0.19 
Target VersionFixed in Version 
Summary0004471: Constant background noise on 16-bit FLAC files via ALSA on Audinst HUD-mini
DescriptionI noticed, that there is quite audible background noise, when listening to 16-bit FLAC files.

Noise isn't there if I encode file to mp3 or ogg. Noise also isn't there if I upcode flac file to 24 bits.

I tried to reproduce this issue generating custom file in Audacity, and it appeared, that noise depenends on the signal being played. I couldn't reproduce for sine tone, but could reproduce for a fading in low-amplitude white noise. Background noise was different though then one I had with the song.
Thus I suspect, probably, some kind rounding error or some noise shaping responsible for that.

A tried with a different player — mocp, and couldn't reproduce the issue for it.
Steps To ReproduceListen to attached files on very high volume (files are very quiet). I do it in headphones (my loudspeakers are not so advanced and emit some noise by themselves).
1. Notice fade in from total silence to signal with 24bit flac
2. Notice quiet but audible noise from the very beginning of 16bit flac

For me better reproducible with the song fragment, than with the noise.
Additional InformationReproduced with Audinst HUD-mini soundcard via ALSA on 2 computers:

1. Lenovo X220 laptop with Archlinux 64bit
$ mpd --version
Music Player Daemon 0.19.1
Decoders plugins:
 [flac] flac

2. Synology DS214 Play with Debian Chroot 32bit
$ mpd --version
Music Player Daemon 0.19.1
Decoders plugins:
 [flac] flac

I'm not sure whether other output systems are affected. There is background noise for pulseaudio too. Noise is there for both 24 and 16 bit flacs but it is different.
TagsNo tags attached.
Attached Files




edio (reporter)

I'm sorry for typo: on Archlinux mpd version is actually 0.19.11. On Debian is 0.19.1.


edio (reporter)

Last edited: 2015-12-05 16:49

View 2 revisions

I've been writing this bug report while experimenting. Apparently, background noise is not constant, but depends on signal, so title is now misleading. Can't edit though.


cirrus (administrator)

There indeed is (very quiet) background noise in both flac 16 and flac 24. I can reproduce this with MPD, mpv, mplayer, audacity, vlc. It is because the noise is encoded in the FLAC file. When I decode the FLAC file to WAV, I can see the noise in a hex editor. The noise is still audible after transcoding to WAV, Ogg and mp3.

Since that noise is part of your files, playing that noise is correct behavior.


edio (reporter)

I'm sorry to reopen this, however, I tried to dig into that a little bit, and I observed some strange things I can't explain.

I tried the following: I created fifo output for mpd. Then I played sspu_flac16 file and its wav decoded version (which is also 16 bit, 44.1 kHz, both files look the same in audacity).

While playing I've been dumping fifo output to a file with the command

$ dd if=/tmp/mpd.fifo of=<output_file>

The first thing I noticed, is that output for wav file is always shorter. I tried other lossless codecs (ape, wavpack), output for those files was of the same length as for flac file. For wav — always shorter.

reference wav file: 44453 samples
flac fifo dump: 44416 samples
wav fifo dump: 40960 samples

I also expected flac fifo dump to be of the same length as the reference wav file.

The second thing, sample data is in fact different.

Probably I just misunderstood the concept of fifo output, probably my testing method is horribly wrong. I expected output data to be exaclty the same regardless of codec used (if its lossless).

I'd highly appreciate your comments on the method I used to reproduce the issue, and on the differences in output I observed.

Just in case, all preamps sections in mpd are commented out, no sw mixer is configured, so no volume adjustment should occure.



edio (reporter)

I attached files used for experiment (sound.flac and sound.wav), their fifo outputs dumped (*.pcm) and wav versions of those pcm files (converted with Audacity via Import Raw Data as 16 bit signed int, then export to wav).


cirrus (administrator)

Post your configuration and a verbose log.


edio (reporter)

In the meantime I calculated correlation between output dumps and reference wive file. It takes its maximum at 0, so I can conclude, there's no delay between signals.

Having that, I calculated difference and spectrum of the difference.

Difference appeared to be 5-bit noise (32 quantiles). See attachments.


cirrus (administrator)

I compared your PCM dumps: fifo_flac.pcm and fifo_wav.pcm contain 100% identical data, and also 100% identical with the raw data from sound.wav.

The only "error" is samples missing at the end, but all samples that are actually present are identical. No difference. (If those missing samples at the end are bothering you, write a new bug report, and I'll check why that happens. But that's a minor problem that has nothing to do with this bug report.)

So whatever you hear, it's not caused by MPD.

I have no idea what those graphs mean. But if the underlying data has no difference, then MPD behaves correctly.

-Issue History
Date Modified Username Field Change
2015-12-05 14:36 edio New Issue
2015-12-05 14:36 edio Status new => assigned
2015-12-05 14:36 edio Assigned To => cirrus
2015-12-05 14:36 edio File Added: mpdnoise.tar
2015-12-05 14:38 edio Note Added: 0009757
2015-12-05 16:40 edio Note Added: 0009758
2015-12-05 16:49 edio Note Edited: 0009758 View Revisions
2015-12-15 21:45 cirrus Note Added: 0009762
2015-12-15 21:45 cirrus Status assigned => closed
2015-12-15 21:45 cirrus Resolution open => not fixable
2015-12-25 22:50 edio Note Added: 0009769
2015-12-25 22:50 edio Status closed => feedback
2015-12-25 22:50 edio Resolution not fixable => reopened
2015-12-25 22:50 edio File Added: mpdfifo.tar
2015-12-25 22:52 edio Note Added: 0009770
2015-12-25 22:52 edio Status feedback => assigned
2015-12-26 06:22 cirrus Note Added: 0009771
2015-12-26 13:24 edio File Added: mpd_log_config.tar.gz
2015-12-26 15:50 edio Note Added: 0009772
2015-12-26 15:51 edio File Added: diff.png
2015-12-26 15:51 edio File Added: spectrum.png
2015-12-29 19:51 cirrus Note Added: 0009773
2015-12-29 19:51 cirrus Status assigned => closed
2015-12-29 19:51 cirrus Resolution reopened => unable to reproduce
+Issue History