update audio section

This commit is contained in:
Honghoa 2021-07-13 17:34:40 -03:00 committed by GitHub
parent 3f7f423306
commit f032cbf621
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,20 +105,20 @@ On top of these kernel changes, bunnei has also been implementing more of the ch
[Maide](https://github.com/Kelebek1) investigated the cause of the crackling and popping in the audio of some titles, and came to the conclusion that not enough audio samples were being fed into the sink in order to be played out in your headset or speakers.
All games call the `RequestUpdateImpl()` to send samples into the sink and also to pass other information, such as the `sampling rate` of the audio signal and the `sample count` (number of samples to be processed).
Some titles — particularly those running at fixed frame rate of 30 FPS — would call this function less frequently than their 60 FPS counterparts, which resulted in not enough audio samples being processed in time and sent into the sink, causing the aforementioned annoying popping.
Some titles — particularly those running at fixed frame rate of 30 FPS — would call this function less frequently than their 60 FPS counterparts, which resulted in not enough audio samples being processed in time and sent into the sink, causing the aforementioned annoying popping.
Here's `Hellblade: Senua's Sacrifice` in the old implementation:
This is how `Hellblade: Senua's Sacrifice` sounded with the old implementation:
{{< audio "./audiobug.mp3" >}}
By [decoupling the processing and sending of audio samples from the update function](https://github.com/yuzu-emu/yuzu/pull/6498), the games now will be able to call the update function every time they need it (a process that yuzu can't control), while a separate audio thread will process the sample data and send it to the sink.
With this new implementation, yuzu is now capable of schedule the rate at which it will be sending this audio information based on the `sample rate` and the `sample count`.
For example: if a game is using a 48 kHz `sample rate` with a `sample count` of 240, yuzu will now send the audio data to the sink at a rate of least 200 times per second — enough to keep the buffers full and prevent popping in the audio, fixing the problem.
By [decoupling the processing and sending of audio samples from the update function](https://github.com/yuzu-emu/yuzu/pull/6498), the games now will be able to call the update function every time they need it (a process that yuzu can't control), while a separate audio thread will process the sample data and send it to the sink. With this new implementation, yuzu is now capable of schedule the rate at which it will be sending this audio information based on the `sample rate` and the `sample count`. For example: if a game is using a 48 kHz `sample rate` with a `sample count` of 240, yuzu will now send the audio data to the sink at a rate of least 200 times per second — enough to keep the buffers full and prevent these problems with the audio.
And here's `Hellblade: Senua's Sacrifice` again with the current fixes:
And this is `Hellblade: Senua's Sacrifice` again, now with the current implementation merged:
{{< audio "./audiofix.mp3" >}}
This change fixed the slow audio in titles such as `ARK`, `Bulletstorm`, and `Megademension Neptunia VII`, while also — on top of improving the quality — it solved the audio softlocks in `Donkey Kong Country Tropical Freeze` and `Xenoblade Chronicles 2`.
## Graphical improvements
Lets start with something nice, `Unlimited FPS`.