We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3661 - Resampler introduces noise
Summary: Resampler introduces noise
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: audio (show other bugs)
Version: HG 2.0
Hardware: x86 Windows (All)
: P2 blocker
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.6
Depends on:
Blocks:
 
Reported: 2017-06-03 20:47 UTC by Trent Gamblin
Modified: 2017-09-22 00:12 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Trent Gamblin 2017-06-03 20:47:01 UTC
When resampling to a different frequency, slight but noticable noise in introduced. I noticed this when using the WASAPI driver for the first time and requesting a 44100 stream while the hardware was set to 48000 Hz. More info can be found here including a visual: https://discourse.libsdl.org/t/slight-buzz-in-audio-in-mercurial/22553
Comment 1 Ryan C. Gordon 2017-08-09 05:25:35 UTC
(Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.)

Tagging a bunch of bugs as target-2.0.6.

This means we're in the final stretch for an official SDL 2.0.6 release! These are the bugs we really want to fix before shipping if humanly possible.

That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.6 release, and generally be organized about what we're aiming to ship. After some debate, we might just remove this tag again and deal with it for a later release.

Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment.

Thanks!
--ryan.
Comment 2 Ryan C. Gordon 2017-09-21 07:42:20 UTC
I've replaced the resampler with a better one, which should resolve this problem.

https://hg.libsdl.org/SDL/rev/a8382e3d0b54

--ryan.
Comment 3 Trent Gamblin 2017-09-21 22:20:46 UTC
I tested Mercurial with the original problem and it sounds good now. Thanks!
Comment 4 Trent Gamblin 2017-09-21 22:29:48 UTC
Sorry about this but my test was flawed. I was creating the stream with the same sampling rate as the device. When they are different I still hear a lot of high pitched noise that isn't there with SDL 2.0.5. Perhaps I can send you some code that exhibits the problem.
Comment 5 Trent Gamblin 2017-09-21 22:34:42 UTC
Looks like my checkout isn't updated... I'm not familiar with Mercurial. I did an 'hg pull' but I don't have the changes. Guess I'll just trust that it will be OK.
Comment 6 Ryan C. Gordon 2017-09-21 22:43:49 UTC
(In reply to Trent Gamblin from comment #5)
> Looks like my checkout isn't updated... I'm not familiar with Mercurial. I
> did an 'hg pull' but I don't have the changes. Guess I'll just trust that it
> will be OK.

Hg pull gets new data from the server. "hg update" then takes that data and merges it into your local source code with it.

--ryan.
Comment 7 Trent Gamblin 2017-09-21 22:51:48 UTC
Thanks for that. After getting the updates I tested again. The original problem is gone. There was a new problem in that there were some crackles/pops. However using a smaller buffer (not larger, as I tried first) fixes it.
Comment 8 Trent Gamblin 2017-09-22 00:12:29 UTC
I've tested the new code on two PCs. Using a small buffer helps but there is still a lot of noise on wasapi (not the same kind of noise as the original bug) compared to directsound. It's more of a crackling/popping similar to a unfilled buffer every few moments. Probably best to open a new bug though.