Skip to content
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

[Linux] Sound is played slightly delayed #45

Closed
hadiskeini opened this issue Sep 23, 2014 · 11 comments

Comments

Projects
None yet
7 participants
@hadiskeini
Copy link

commented Sep 23, 2014

Can't confirm if it's all sound that is played, but gunshots are played slightly too late.
The delay feels like 100-200ms.
The startup parameter "SDL_AUDIODRIVER=pulse" is active.

System: https://gist.githubusercontent.com/augenleet/c10630ea92360204be43/raw/483487b9726164a2403a539b9a99b47c6b1fc9cd/gistfile1.txt

Edit: The startup parameter "SDL_AUDIODRIVER=pulse" seems to be unnecessary since the last small update. (390298 › 391217)

@deri82

This comment has been minimized.

Copy link

commented Sep 23, 2014

I think I noticed too sometimes some delay.

@Locat

This comment has been minimized.

Copy link

commented Sep 23, 2014

I notice it too.

Processeur :
Fabricant : GenuineIntel
Famille du processeur : 0x6
Modèle du processeur : 0x3a
Révision processeur : 0x9
Type de processeur : 0x0
Fréquence : 4000 Mhz
4 processeurs logiques
4 processeurs physiques
HyperThreading : Non pris en charge
FCMOV : Pris en charge
SSE2 : Pris en charge
SSE3 : Pris en charge
SSSE3 : Pris en charge
SSE4a : Non pris en charge
SSE41 : Pris en charge
SSE42 : Pris en charge

Réseau :
Vitesse du réseau :

Version du système d'exploitation :
"Arch Linux" (64 bits)
Nom du noyau : Linux
Version du noyau : 3.16.3-1-ARCH
Éditeur du serveur X : The X.Org Foundation
Version du serveur X : 11601000
Gestionnaire de fenêtres X : GNOME Shell
Version d'exécution Steam : steam-runtime-release_2014-08-20

Carte graphique :
Pilote : NVIDIA Corporation GeForce GTX 670/PCIe/SSE2

Version du pilote : 4.4.0 NVIDIA 343.22
Version OpenGL : 4.4
Profondeur de couleur du bureau : 24 bits par pixel
Taux de rafraîchissement du moniteur : 60 Hz
ID fabricant : 0x10de
ID périphérique : 0x1189
Nombre de moniteurs : 2
Nombre de cartes vidéo logiques : 1
Résolution de l'affichage principal : 1920 x 1080
Résolution du bureau : 3200 x 1080
Taille de l'affichage principal : 20.51" x 11.54" (23.50" diag)
                                        52.1cm x 29.3cm (59.7cm diag)
Bus principal : PCI Express 16x
Mémoire vidéo principale : 2048 Mo
Modes MSAA pris en charge : 2x 4x 8x 16x 

Carte son :
Périphérique audio : VIA VT2020

Mémoire :
RAM : 7949 Mo

Divers :
Langue de l'interface : Français
LANGUE : fr_CH.utf8
Micro : Not set
Espace disque total disponible : 148773 Mo
Plus grand bloc disponible sur le disque dur : 109603 Mo

Logiciel installé :

Rapports d'échec récent :
Tue Sep 23 21:54:26 2014 GMT: file ''/tmp/dumps/assert_20140923235416_25.dmp'', upload yes: ''CrashID=bp-0bbfb491-acf3-4764-b857-d922d2140923''

@hadiskeini

This comment has been minimized.

Copy link
Author

commented Sep 23, 2014

I seem to have found a workaround:

Edit the /etc/pulse/daemon.conf and set the following values:

default-fragments = 5
default-fragment-size-msec = 2

Don't forget to remove the comments (";") in those lines.
After that reboot.

Seeing the previous commenter using Arch Linux as well, this is possibly not an issue on other distributions.

Please provide feedback if this fixes the issue if you experienced sound delay.

@hadiskeini hadiskeini changed the title Sound is played slightly delayed [Linux] Sound is played slightly delayed Sep 23, 2014

@Locat

This comment has been minimized.

Copy link

commented Sep 24, 2014

@augenleet It indeed fixed my issue nice find !

@robled

This comment has been minimized.

Copy link

commented Sep 25, 2014

@augenleet your work-around helped me as well. I'm running Debian Jessie.

@robled

This comment has been minimized.

Copy link

commented Sep 26, 2014

At least on my system the work-around may be causing a side effect where music playback is "popping".

@hadiskeini

This comment has been minimized.

Copy link
Author

commented Sep 26, 2014

@robled This workaround reduces the size of your audio buffer. Too low values can cause sound glitches like your popping. The lowest value you can use without glitches is completely dependant on your sound card, so I guess you could try a little higher values and see if it works.

@tpruzina

This comment has been minimized.

Copy link

commented Jun 5, 2015

Sorry for bumping old thread, but pulseaudio is known to increase latency on each audio underrun (which isn't uncommon with CPU hungry game), either you give PA realtime priorities (so audio will get priority over game itself), or PA will be increasing latencies step-by-step as long as the game can't fill the buffer quickly enough.

There is no workaround AFAIK, either stop using pulseaudio or restart PA daemon from time to time so latencies get back to normal (you will have to reset game or go into settings and set some different audio configuration (2speakers -> 5.1 -> 2speakers) to fix.

You can try running 'pulseaudio -k && pulseaudio -vvvv' in console and then watch the PA output as you play to see wheater you are affected by this thing or not.

Anyways, this will afect you even if you set

default-fragments = 5
default-fragment-size-msec = 2

By the way, this is quite absurd setting, extremely CPU hogging (CPU scheduler runs at 1000Hz on most desktops and fragment size 2msec would force every other scheduler cycle to handle audio code, having half of one core busy with audio is probably not what you really want (and if it is, you should use rt-linux kernel and increase default-fragments to higher value).

@Newbrict

This comment has been minimized.

Copy link

commented Jan 18, 2016

This is still an issue.

@davidw-valve davidw-valve self-assigned this Jan 18, 2016

@davidw-valve

This comment has been minimized.

Copy link
Contributor

commented Jan 19, 2016

This is almost certainly an issue with your pulse audio configuration and not with CS:GO itself.

@Newbrict

This comment has been minimized.

Copy link

commented Jan 19, 2016

You are right, I fixed it. Thanks @davidw-valve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.