-
Notifications
You must be signed in to change notification settings - Fork 346
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
[question] Noise when playing 16-bit files and using default sample format #542
Comments
Post verbose log of start of playback, and tell me your MPD version number. |
With
With
Config with stripped comments
version
|
Does it work if you use the "alsa" output instead of "pulse"? |
I just tried to force 16 bit output (I should've tried this in the very begginning), and I hear similar noise with 24-bit files. So the issue is with 16-bit output. |
@MaxKellermann , yes, with ALSA I have the same noise, as with PulseAudio. With ALSA though, the noise is much louder (at least on E-MU 0404 USB, I don't have Audinst on me right now) |
Try two more things:
|
|
Another note, with |
Applying software volume (which ReplayGain does, unless you configure it to use a hardware mixer) and converting 24 bit to 16 bit both uses dithering. So the problem may be MPD's dithering code. |
Should we qualify this issue as a bug then? (I'll remove the Is there anything else I can do to help fixing the issue? (except for preparing a PR 😅 , I haven't ever written a line of production-grade C or C++ code) |
Not yet - we don't know for sure if it's a bug. You can't do anything right now, thanks for the information so far, that was useful. (Unless you want to dig into MPD source code, see https://github.com/MusicPlayerDaemon/MPD/blob/master/src/pcm/PcmDither.cxx for the heart of the dithering code) |
I checked the dithering code back and forth, and found no problem. Manipulating the volume on 16 bit samples works just fine, no noise (except for the floor noise caused by dithering, which is the very point of dithering). Same for converting 24 bit to 16 bit. There is a unit test for this; you can run it with Can you record MPD's digital audio from a PulseAudio monitor? I'd like to see the noise. |
Sorry making you wait. Here's how the noise looks like. Recordings are not exactly accurate because monitor, it seems, always records in 44100 Hz (which is also obvious from file sizes) command I used to record
In mpd config I have |
Your file shows dithering as expected. It's just that the levels of "non-silence" audio are extremely low; how can you even hear anything? If you pull your amp's volume knob high enough to be able to hear the actual music, then your amp will have amplified the dithering as well, making it audible as noise (which dithering is, by design). Usually, dithering is not audible. |
@MaxKellermann , do you think it would make sense to adjust dithering algorithm so the output is limited by the amplitude of the original sample? In other words, don't do dithering, if there's silence in original audio. BTW, this change does not require an excessive C++ knowledge, so I would be able to prepare a PR if you're open to the idea. My last argument here would be that other players do not have this issue. Either they do not use dithering or they do some sort of normalization. |
cmus and deadbeef both don't dither at all. |
@MaxKellermann , dithering noise is only audible on high volume levels - true. But I wouldn't say the setup is wrong. And also I've never noticed anything similar with any other player. So I'm blaming MPD here ;) I personally didn't expect to see dithering in MPD. Hence, making dithering configurable is of course an option I'd like to see. The other option I see is revising dithering algorithm. Finally, setting output format to 24-bit resolves the issue for me, so I would be fine with leaving things as they are. But this issue is an interesting issue to tackle, so if you're open to changing this, I'd be eager to offer my help. |
@edio I've tried to implement an optimization for you - please try it and give feedback. |
@MaxKellermann, I apologize for responding just now. Had no chance to look at the change immediately after you made it (was travelling and had no proper setup to test) and then it just slipped my mind. At first, thank you for addressing this! Judging from the date of commit, this should've been included in 0.21.13 release, is this right? I'm currently on 0.21.14, and I still observe a clear difference in sound when I comment/uncomment I also, honestly, can not hear any difference between 0.21.10 and 0.21.14 with This I guess is expected and by design. The dithering that mpd adds didn't go away. And improvement in the precision of software volume control I, apparently, can not hear. But knowing that it has improved gives a pleasent peace-of-mind feeling anyway :) If you want another set of outputs recordings or any other tests performed with regards to this issue, let me know, I'd be happy to work on this. Thanks again! |
No, this is not included in 0.21.13. Why do you think so? Do you see it in the change log? |
My bad. Will test with master later |
On 0.22~git I can still hear difference between I used the same config as I had with 0.21.14, did I miss some configuration option somewhere? |
When listening to 16-bit files on a sound-card that supports 24-bit, while having
audio_output_format
commented out, mpd produces quiet, but yet audible noise. Subjectively I would characterize the noise as having line spectrum, with the base frequency quite low (up to tens of Hz) but certainly having lots of higher harmonics. I could try to record it if necessary, but would be happy to avoid this activity :)Today I discovered, that if I explicitly set sample format to
the noise disappears.
Since the workaround is found and I'm no longer impacted, I wouldn't say, that this is something requiring immediate attention.
But out of pure curiousity I'd like to understand what's going on, why MPD has noise for 16-bit files in its output if output format is not configured.
Please let me know if any additional information is required on this or if you'd like me to perform some tests or to attempt recording the noise.
P.S. I reported this before on an old Mantis tracker, however, couldn't provide good steps to reproduce back in the time.
The text was updated successfully, but these errors were encountered: