Lorenzooone / cc3dsfs

A multi-platform capture and display program for the https://3dscapture.com/ N3DSXL, 3DS and DS (old) Capture Cards written in C++
MIT License
9 stars 0 forks source link

Audio Oscillations Occurring Consistently When Using cc3dsfs #5

Open GK6475 opened 1 week ago

GK6475 commented 1 week ago

Even in the latest releases, the audio has a strange oscillation effect that seems to be most noticeable on a speaker system or through headphones. I do not have any audio effects enabled on my computers and my 3DS is set to stereo. The audio "stage" appears to oscillate, sometimes sounding further behind and other times sounding more centered. In this way, it also seems to become less or more crisp when this happens. This does not occur on the 3DS' regular analog output. All 3DS/DS games that I have tested exhibit this issue through the software. I first mentioned this issue on 3dscapture.com. For me, this audio issue is the only major thing wrong with the software currently. I would just use analog to my speakers and headphones, but there is a huge influx of noise when the capture card is plugged into my computer(s). Here is an example of the strange audio oscillations: 3DS Audio Anomaly.zip You should be able to hear the music constantly fade in and out, or change position.

Lorenzooone commented 1 week ago

What I like to do to test audio is using the 240p test suite NDS port, launching the SMPTE color bars test and pressing Select. This produces a constant 1khz sound, which is great for diagnosing stuff like this. 240p_test_suite_nds.zip That aside, I can also reproduce this on Linux. I assume it's because of the conversion openAL is doing to get the 32728.498046875hz to a more usable frequency. I already had plans to change it, so this goes in the list of reasons to do it.

Something which does seem to improve the situation (albeit not fix it) is changing openAL's configuration: I changed the "frequency" from its default to 192000, and that reduces it significantly. It's not a 100% fix, as it is still there, but it's way less noticeable. (Measured the discrepancy before and after, and it was way less) Another thing which you might want to play with is the "periods" setting. Reducing it to 2 lowers the audio latency significantly, even if at the cost of more crackling at the start of the program. In Windows, the settings file should be at: "$AppData\alsoft.ini".

GK6475 commented 1 week ago

Thanks, I'll try some of your suggestions to improve things for now. Also, would it not be possible to use an audio driver like WASAPI's exclusive mode to pass through the 3DS' native sample rate to the audio output? For sound setups that support it, it could be the highest quality option by far, given that there is no resampling being done. RetroArch can do this and it definitely sounds the clearest when compared to resampled audio.

Lorenzooone commented 1 week ago

I may try to do it in the future. However, for now I'd like to improve the audio for all platforms, not just Windows. By the way, I just fixed an audio bug with N3DSXL audio capture (which I realized due to audio issues with O3DS audio capture). This should have reduced the amount of audio pops significantly. I also added an Audio Setting for the Max Audio Latency, as with that fix, the audio is now stable enough to play with that. You can try it out at: https://github.com/Lorenzooone/cc3dsfs/releases/tag/nightly-latest (It does not fix the issue with the audio switching sides)

Lorenzooone commented 1 week ago

Actually, upon further testing I noticed that this oscillation is present in the data from the capture card itself...? Does the audio oscillation also happen if you use Loopy's software?

GK6475 commented 1 week ago

It does also seem to occur with Loopy's software. Maybe he needs to push a firmware update to fix it?