You are not logged in.

#1 2018-08-01 12:18:22

anark10n
Member
Registered: 2012-10-13
Posts: 165

[Solved] Distorted sound in Godot with ALSA

Hey there

So i'm following this tutorial on how godot (adding sound is in part 2 at 9:00). The sound plays, but it comes out distorted, as if the audio jack isn't all they way in the socket, and even the sound that does come out is scratchy. This only happens with godot, every other application plays the sound clearly. Before i was getting no sound at all, until i removed the the ~/.asoundrc file, and it was still the same. After i updated godot to the latest, i had to add back to ~/.asoundrc file, as without it i get no sound. The distortion happens with both ogg or wav files.

My ~/.asoundrc

pcm.!default { type hw card 0 device 0 }
ctl.!default { type hw card 0 device 0 }

I'm at a loss as to what to check to resolve. Any pointers would be appreciated.

Last edited by anark10n (2019-01-20 12:40:51)

Offline

#2 2019-01-20 12:40:36

anark10n
Member
Registered: 2012-10-13
Posts: 165

Re: [Solved] Distorted sound in Godot with ALSA

Well, plugged away at this for awhile. And if anyone else encounters this, here's the solution that worked for me.
The problem appears to occur if you have and pulseaudio-alsa installed. So a quick solution to this will be to install godot-pulse (or set pulseaudio=yes in the PKGBUILD).
Godot will still have trouble initialising the ALSA driver and return this error message on the command line:

ERROR: init_device: Condition ' status < 0 ' is true. returned: ERR_CANT_OPEN
At: drivers/alsa/audio_driver_alsa.cpp:80.

Godot will still have trob To get rid this message, I did the following:

  1. Delete ~/.asoundrc

  2. Uninstalled pulseaudio-alsa and pulseaudio

  3. Rebuilt godot with pulseaudio=no

  4. Reinstalled godot

And godot had no problems initialising the driver after that. For some reason.

Offline

Board footer

Powered by FluxBB