I tracked down the revision with the fix for the 1.5 hour audio bug; it was 1591. The little pops and clicks are present there, but they're also present in the revision prior to that, so that's not the cause. EDIT: I said something different here before but investigated further. It appears that I'm not consistently getting more of the clicks in the later revisions than I am in 322. They seem more prone to it, but it doesn't always happen. I haven't heard these sounds in other games, but I don't play many. I believe Xenoblade Chronicles has been reported as suffering from this problem, but I don't have it or I'd see if I have the same experience.
How/why does Dolphin generate sound frequencies above 17 KHz?
|
11-10-2013, 01:47 PM
I believe that's fairly normal with up-sampling, and often a low-pass filter is added to try and remove the unexpected data.
Looking at the code it's just doing a linear interpolation, without any kind of low pass filter on it, hence it going over 16khz (half the original sample rate). I happened to be looking in that code just to see if there was anything in there causing audio break-ups, appears that it's not that area that's the problem, it's run out of samples in the mixer and so just repeats the last data (my old i7-920 isn't quite up to running things at full speed ) Attached is a patch that might help a little bit, I add a special case for 32k to 48k conversions. By special casing the code it looks at the next 2 samples, and makes 3 samples from them (it's still a linear interpolation). It then applies a really basic low pass filter at 16khz. To do the low pass filter properly would need a better algorithm for the conversion (at least it's in a different thread so could take the time to do something different) Note that the patch isn't anywhere near as clean (or tidy) as I'd like, but I figured it might give you something to play with, and is against the git master from today. 11-10-2013, 02:17 PM
Ah, how fortunate. Would you mind compiling that for Windows x64 for me? Searching for how to apply a patch I find the pauldacheez quote, "Applying patches is some complex shit. Unless you're willing to learn how to use Git and compile Dolphin yourself, you're out of luck."
11-10-2013, 10:56 PM
(11-10-2013, 02:17 PM)nothingtosay Wrote: Ah, how fortunate. Would you mind compiling that for Windows x64 for me? Searching for how to apply a patch I find the pauldacheez quote, "Applying patches is some complex shit. Unless you're willing to learn how to use Git and compile Dolphin yourself, you're out of luck."Ah, guess the developer in me think it's not that complex to use git and have visual studio compile it I'll have to find a file sharing thing to upload via (forum limit is 1MB, but the zip is 7MB). but on my brief analysis of the intro to zelda TP the frequency analysis shows a change in the frequency response (adacity frequency analysis shows slightly lower response at the top), and I think slightly less popping, however, it's hard to know am I hearing a slight difference because I want to I'll do some more work to try and find a better low pass filter that can kill most of the noise over 16khz. 11-11-2013, 05:49 AM
MediaFire is good, fast, and free. Don't know if there are any places that let you upload without an account anymore.
If the problem is introduced from a sub-optimal resampling algorithm, one of the best resamplers is open source: SoX. I don't know if incorporating it into Dolphin would be sensible, feasible, or efficient, but the idea is the only contribution this layperson can make. Maybe just a part of its code could be used or an idea gained by looking at it. 11-11-2013, 07:51 AM
(11-11-2013, 05:49 AM)nothingtosay Wrote: MediaFire is good, fast, and free. Don't know if there are any places that let you upload without an account anymore.I didn't see SoX when looking around, I did find a resampler and libresampler. With a bit of messing around, I've managed to change the the conversion code to do a better resampling job. SoX does look like it's got a better API (assuming the endianness of the DSP PCM data can be accounted for) Something to look at another day. In the meantime, I've uploaded a build to: https://drive.google.com/folderview?id=0...Ho3SVJZSUE You should be able to click the zip file, and then download it. The diffs are a mess at the moment, however, I'm more interested in if it actually solves the problem, if it does I'll look at how to tidy up the code, and also at SoX. As it might be better to use a library that provides all the necessary goodness, and copes with the various hardware configs out there. Certainly in my testing this build pretty much drops anything over 16khz (it does have a slope though, so there is some up to about 17khz) 11-11-2013, 10:18 AM
Mere Wrote:I didn't see SoX when looking around, I did find a resampler and libresampler.Yeah, I linked directly to the resampler portion of the larger program. I think it's the most popular part so they separated it for the convenience of people who want to use only it. Thank you very much for your efforts and for compiling for me. I'll test anything you try out. Mere Wrote:Certainly in my testing this build pretty much drops anything over 16khz (it does have a slope though, so there is some up to about 17khz)There is a slope to the real Wii as well, going up to about 18 kHz. Is the slope configurable in any way so that it could be made to more closely emulate the hardware? The Wii lowpass seems to cut hard at 18 kHz, whereas SoX lets some through. (This is a pretty minor thing since I doubt it will change sound quality at all, but I figure it's worth doing if it can be done easily.) Here is a comparison of a 10-second channel intro (Shiren the Wanderer again) on hardware and with your patch. Spoiler: Spoiler:
The slope can be tuned I think.
Hmm, the glitch looks more like it stepped back in time for one sample. Having had you point it out, if I use the spectro view and zoom into one of the spikes I can clearly see it. Certainly odd. It could be my logic to try and keep the offset into the timeline is going askew and rolls back one sample now and again... Ok the glitch should be fixed, I'm not seeing them in the zelda TP intro. Turned out to be a wrapping issue which meant the code was throwing away the time offset into, and it was reset, which meant it was reading the same sample point again. The reason for the irregularity is that the buffer had to wrap, and the time offset be non zero (due to the 2/3 ration of 32/48 there was a 1/3 chance). (I'd actually assumed the spectro graph spikes were when the emulator couldn't keep up ) There's a new version on the drive share: resampler_fix_x64-2013-11-11.zip I've also changed turned the aggressiveness of the filter, not sure if it's better or worse, but it does run till around 18khz now. 11-12-2013, 05:06 PM
(11-09-2013, 11:53 AM)delroth Wrote: Do you have some programming skills? If so, you should try to patch Dolphin to dump audio before the AudioCommon Mixer does stuff to it. If not, hope that a developer will do that so that we can have more info on why Dolphin generates these frequencies. My guess: resampling done in the AudioCommon mixer introduces these problems (and we already know it's very broken).Here you go. There's the Dolphin resampled audio, the audio before resampling, and the audio before resampling resampled by Audacity. Spoiler: 48 KHz: https://mega.co.nz/#!rdVRCCya!C2zphkf1Mc...QHLDqb-YBM |
« Next Oldest | Next Newest »
|
Users browsing this thread: 1 Guest(s)