-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
"robotic" and glitchy sound #3793
Comments
So the problem only occurs in real-time playback, but not recording via Please run |
Here it is:
|
Wow, that's weird :/ Here is a build with this diff: diff --git a/app/src/audio_player.c b/app/src/audio_player.c
index bba39acbf..fb80d8525 100644
--- a/app/src/audio_player.c
+++ b/app/src/audio_player.c
@@ -5,7 +5,7 @@
#include "util/log.h"
-#define SC_AUDIO_PLAYER_NDEBUG // comment to debug
+//#define SC_AUDIO_PLAYER_NDEBUG // comment to debug
/**
* Real-time audio player with configurable latency
Please retry |
new binary output:
|
The audio callback is not called frequently enough by SDL to consume the samples. Let's try with a bigger audio output buffer: diff --git a/app/src/audio_player.c b/app/src/audio_player.c
index bba39acbf..1f2614dd1 100644
--- a/app/src/audio_player.c
+++ b/app/src/audio_player.c
@@ -5,7 +5,7 @@
#include "util/log.h"
-#define SC_AUDIO_PLAYER_NDEBUG // comment to debug
+//#define SC_AUDIO_PLAYER_NDEBUG // comment to debug
/**
* Real-time audio player with configurable latency
@@ -59,7 +59,7 @@
#define SC_AV_SAMPLE_FMT AV_SAMPLE_FMT_FLT
#define SC_SDL_SAMPLE_FMT AUDIO_F32
-#define SC_AUDIO_OUTPUT_BUFFER_MS 5
+#define SC_AUDIO_OUTPUT_BUFFER_MS 10
#define TO_BYTES(SAMPLES) sc_audiobuf_to_bytes(&ap->buf, (SAMPLES))
#define TO_SAMPLES(BYTES) sc_audiobuf_to_samples(&ap->buf, (BYTES))
|
Wow! That did the trick! No more robotic sound. Simply pure and smooth audio as should be. Thanks a lot, man! |
I think I will keep 5ms by default, but add an option (e.g. |
I submitted an issue on SDL to get more feedback about the problem: libsdl-org/SDL#7450 |
Could please you try the official release with a different audio driver: #3799 |
Directsound sounded as robotic as before (no pun intended) WinMM was even worse... As per wiki SDL v2.0 is being used, right? So it does not make sense trying other drivers for v1.2, I guess... Edit: I don't know if I messed anything up, but I tried that binary you offered me before and now it is robotic as well, but a tiny bit less... |
set SDL_AUDIODRIVER=directsound and adding --audio-buffer=200 to my command line fixed it for me. |
On some systems, the SDL audio callback is not called frequently enough (for example it requests 5ms of samples every 10ms), because the output buffer is too small. By default, we want to use a small value (5ms) to minimize latency, but if it does not work well, the user needs a way to increase it. Refs #3793 <#3793>
On a branch, I implemented an option Please restore the original Then replace this binary:
Confirm that you still get a robotic sound. Then execute Thank you |
Yes, works. |
On some systems, the SDL audio callback is not called frequently enough (for example it requests 5ms of samples every 10ms), because the output buffer is too small. By default, we want to use a small value (5ms) to minimize latency, but if it does not work well, users need a way to increase it. Refs #3793 <#3793>
On some systems, the SDL audio callback is not called frequently enough (for example it requests 5ms of samples every 10ms), because the output buffer is too small. By default, we want to use a small value (5ms) to minimize latency, but if it does not work well, users need a way to increase it. Refs #3793 <#3793>
On some systems, the SDL audio callback is not called frequently enough (for example it requests 5ms of samples every 10ms), because the output buffer is too small. By default, we want to use a small value (5ms) to minimize latency and buffer underrun, but if it does not work well, users need a way to increase it. Refs #3793 <#3793>
I merged this new option |
Environment
Describe the bug
I've tried changing audio buffer to higher values (video buffering too), have also changed audio bitrate and so on, but it always come out as a "robotic" sound with many "clicks" and "impurities" as well (I'm trying my best to describe it, bear with me, please). So, when I decided I was going to place an issue about this, of course I recorded a minuscule sample video to showcase it. I was displeasedly surprised after playing it with perfect sound, not "robotic" or glitchy at all, just smooth audio playback. That's why I didn't consider uploading that sample.
So, I've hunted my Windows audio config to see if anything was causing this strange behavior. I've let go of the thought after many tweaks with no positive (or negative) changes.
Have you or anybody else gone through this before?
The text was updated successfully, but these errors were encountered: