Issues with sound and fullscreen

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
Tante2k
Engineer
Engineer
Posts: 11
Joined: 19 Mar 2020 00:34

Issues with sound and fullscreen

Post by Tante2k »

I don't know if this is a known problem or not. I've tried searching, and I can't find anyone with the exact same issues as mine.

Short version:

Sound never works when game is in fullscreen, music sometimes works when game is in fullscreen.

Longer version:

No matter what sound/music packages I use, there is an issue with running the game in fullscreen. It seems completely random whether or not sound works. Music sometimes works in fullscreen, but never sound. It works perfectly when I run the game windowed. It seems to be related to the sound format the game sends. I'm playing it on a NUC connected to a receiver via HDMI. When I boot it up, I can see my receiver tell me my source doesn't contain any channels. However, I can alt-tab out and start something like a YouTube video in the background to get the sound back on, which tells me essentially that unless I feed the Windows Mixer with other sound sources that includes sound channels, the signal coming through the HDMI is some sort of sound stream without an address, or that the game somehow defaults to a sound format that my receiver can't deal with (which is not many, but they exist). I imagine I can fix this if I can find some way to edit what the game sends, but I wouldn't know where to start.

Am I the only one with this problem?

Is there any way to edit what sound formats the game uses?
User avatar
jfs
Tycoon
Tycoon
Posts: 1758
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Issues with sound and fullscreen

Post by jfs »

Since you mention a NUC I'll assume you're using Windows.

There's two sound drivers available on Windows for OpenTTD. The default is the XAudio one, the alternative is the Win32 one. Both accept two parameters for the driver initialisation, "hz" and "bufsize". The default samplerate (hz parameter) is 44100.

Find your openttd.cfg file, open in a text editor. One of the early lines should be "sound =" or "sounddriver =", I can't remember if it's one or the other.

Change the sound driver to:

Code: Select all

win32:hz=48000
For example, to use 48 kHz samplerate instead of 44.1 kHz.
You can also try to change between "xaudio" and "win32" see if that makes a difference.
Tante2k
Engineer
Engineer
Posts: 11
Joined: 19 Mar 2020 00:34

Re: Issues with sound and fullscreen

Post by Tante2k »

This is the result when I tried your line.

https://i.imgur.com/reLdHyf.png
User avatar
jfs
Tycoon
Tycoon
Posts: 1758
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Issues with sound and fullscreen

Post by jfs »

That would indicate you either have no sound devices at all (check your Windows sound settings) or that some other application is using your sound in exclusive mode.
If you can, try testing with a pair of headphones hooked up directly to the computer, and set as the default sound playback device.
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 25 guests