Jump to content
  • 0

No audio working in Linux with ALSA.


Fletch Hasues

Question

Trying to play Project Zomboid, but audio is not working.  Historically, PZ always worked but over a long break, it appears that audio isn't working.  I'm hearing others using Pulse, etc now works, just wanting to make sure there is not new configuration to enable for this to work.  I have added fmod libraries as well.

console.txt

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Don't have that information at the moment, as I've never used FMOD studio directly. The version number spit out into the console from the dll is 20206.

 

We should be on a build from late 2021 / early 2022 due to the aforementioned issues with Windows and the default display device. This might not therefore include the latest fixes for ALSA support.

 

Tbh, this does feel a bit like a niche case -- we've very rarely (possibly never?) seen someone running only ALSA instead of either pulse wire or pulseaudio and ALSA, it'd probably be worth upgrading to support it properly.

Link to comment
Share on other sites

On 2/5/2023 at 7:29 AM, EnigmaGrey said:

Don't have that information at the moment, as I've never used FMOD studio directly. The version number spit out into the console from the dll is 20206.

 

We should be on a build from late 2021 / early 2022 due to the aforementioned issues with Windows and the default display device. This might not therefore include the latest fixes for ALSA support.

 

Tbh, this does feel a bit like a niche case -- we've very rarely (possibly never?) seen someone running only ALSA instead of either pulse wire or pulseaudio and ALSA, it'd probably be worth upgrading to support it properly.


You can't run Pulse or Pipewire without ALSA.  So ALSA by default should be supported :).  If you are stating that its an upgrade to add either, I would disagree.  I'm sure as a developer it is frustrating to have to accommodate all these things, and I won't bore you with the details of how these tools aren't really necessary (similar projects have occurred in the past...ESD, arts, phonon, JACK? So i'll just stick with what is in the Linux kernel itself).

Regardless, I wanted to say I found something else that was important in my configuration, which was fine tuning the period and fragment sizes going to the sound devices.  This is why some people may have issues and some won't...the defaults for the driver are hopefully sane.  When it comes to the `snd-hda-intel` driver, it is odd as it has a lot of personalities.  I still think it would be in the best interest for a project like this to allow a user to specify the hardware/sound device vs. using the default.  Anyway, everything is working fine for me now.  Thanks again for your ear.

Link to comment
Share on other sites

On 2/2/2023 at 5:56 AM, Beard said:

LOG  : General     , 1675268555488> 1675268555488 fmod: FMOD::Studio::System::Initialize() result: Error initializing output device.

Seems like fmod does seem to fail at initializing the device. It should just work on Linux from the box, unless you have any specific Audio settings in Pulse / Pipewire that might cause weird issues with it, or if your hardware has very high Sampling rates above 48 000hz, as those are not supported by Fmod as far as I am aware.

 

> unless you have any specific Audio settings in Pulse / Pipewire that might cause weird issues with it,

I'm not using PulseAudio or Pipewire.  I'm using straight ALSA as that is what both of those require, and really both of those are unnecessary.  I'm using a sampling rate of 44100.  I know this works with FMOD, however.  As other games that use FMOD work with it (a good example is Don't Starve Together).  One thing that I note that many games don't do is allow the selection of what audio device to use. My guess is however Project Zomboid via FMOD selects the audio device, it is selecting the incorrect device and this is not initializing it correctly. 
 

I can assert that my operating system isn't the problem because I have three hosts running the same and the other two work correctly.  This one specifically is not working with Project Zomboid.  This makes me think there !might! be a configuration issue for the sound on this host.  I'll investigate.  I just want to point out, however, that it may be worth looking into the code to review how the audio devices are being selected on Linux or at least allow the user to select the appropriate one.  I'll comment back here once I investigate.

Link to comment
Share on other sites

iirc, there's a bug with the version of FMOD that we use that causes it to select a disabled device, resulting in that error. It probably can't be fixe until FMOD is updated at some point in the future. 

 

The solution, at least on Windows, is to set the default sound device to whatever's active. Sometimes Windows will continue trying to output to a disabled device otherwise. 

Link to comment
Share on other sites

Found this:

 

> This is apparently fixed in FMOD since about a year ago, see 21/12/21 2.02.05 - Studio API minor release (build 122665):

  • "Core API - Linux - PulseAudio now attempts to load and connect for detection rather than running 'pulseaudio --check'. This improves PipeWire compatibility."

Digging into FMOD's docs I found plenty of fixes surrounding ALSA:

 

https://www.fmod.com/docs/2.02/api/welcome-revision-history.html

 

Additionally, I reconfigured my devices as well.  I've exported the FMOD_ALSA_DEVICE variable:

export FMOD_ALSA_DEVICE=default
 

No dice.  Also tried the workaround of making a symlink for pulseaudio as well, no dice.

 

So my next question was going to be me asking what release of Studio was being used.   But thanks for getting back to me @The Indie Stone. 

Link to comment
Share on other sites

Okay, so I have sound coming through my headphone port at least.  I'm not sure why it is working that way, but I imagine it has something to do with how FMOD interacts with Alsa device detection at a very granular level.  I have a mainboard that attempts to disable audio to one port if the headphone port is enabled, but I can tell ALSA to disable that muting feature.  For whatever reason, that functionality is not working so it is not coming through both my speakers and headphones...just the headphones.

 

I made sure to make my default PCM device an asym so it has playback and recording capabilities, and that device connects to my mainboard output and my USB mic.  Once breaking out individual configuration, and ensuring I had devices named as a "default" name.  This is an old requirement of ALSA, but if you put an exclamation point on the name, it would override that name as being what the "default" device.  Setting the name as default seems to help.

 

So anyway, I'd love to revisit this if this game is updated with a newer FMOD and such.  I believe it would be a great idea to allow the user to select what the output device is because this can be controlled and not relied on the default devices.  Anyway, thanks again.

Link to comment
Share on other sites

LOG  : General     , 1675268555488> 1675268555488 fmod: FMOD::Studio::System::Initialize() result: Error initializing output device.

Seems like fmod does seem to fail at initializing the device. It should just work on Linux from the box, unless you have any specific Audio settings in Pulse / Pipewire that might cause weird issues with it, or if your hardware has very high Sampling rates above 48 000hz, as those are not supported by Fmod as far as I am aware.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...