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
Bad sound quality when upgrading to Rust 1.45 #303
Comments
Hi! interesting report. You could try to narrow it down by bisecting the rustc: https://github.com/rust-lang/cargo-bisect-rustc/blob/master/TUTORIAL.md Then we'd know what to look for. |
Here's the result I got from it: searched nightlies: from nightly-2020-05-01 to nightly-2020-07-20 |
I just checked the output of the |
It's probably due to some UB caused by the tiny vecs change. Interesting... |
I've confirmed the bug on my laptop as well. The project in question exhibiting the bug is https://github.com/Rua/ferret. |
For what it's worth, looking at the code there's nothing in It would be interesting to check on the other |
@Rua which OS are you using? Windows? Also it would be great to have a self contained example, i.e. one that doesn't need quake wad files. Do the rodio examples work for you? |
Rua had the issue on Linux (Mint, IIRC), and I reproduced it on Debian. |
I cloned a copy of Rodio 0.11.0 and modified it so that in good.txt bad.txt (48 kHz stereo) Clearly, the two files are not the same. So it appears that the fault is somewhere between |
I've narrowed the problem down further to |
I found the problem! In |
Nice, a logic bug... Yeah it should be changed to have outputs independent of the capacity. |
Has any work been done on this? I am thinking how I could fix it myself, but I don't know how the code is supposed to work or why it's using the capacity in the first place. |
It appears that @tomaka was the one who originally wrote the code, maybe he has some insight? |
SampleRateConverter: Fix reliance on Vec internals (see #303)
I updated my toolchain to use Rust 1.45, this has broken the audio playback using Rodio 0.11.0. The sound comes out as somewhat muffled, like it was low-pass filtered. I can restore the correct audio by downgrading Rust back to 1.44.1, so clearly there is something going on with changes made in the compiler and how they interact with Rodio. Perhaps the changes in float-to-integer casts are to blame.
I've attached a sound recording for comparison. First, two sound effects are heard from Rust 1.45, then the same two effects in Rust 1.44.1. (Yes, these are old Doom sound effects, if anyone is wondering :) )
brokensound.ogg.zip
To play this audio, I use a custom
Source
that reads its samples from anArc<[i16]>
, so that I can keep the buffer around after playing it. This is then wrapped in theChannelVolume
,Done
andSamplesConverter
sources, sent to another thread (to avoid the COM initialisation bug on Windows), where it is then played viarodio::play_raw
.The text was updated successfully, but these errors were encountered: