the sound stops working when resuming from hibernation

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
andreasaspenberg
Traffic Manager
Traffic Manager
Posts: 159
Joined: 26 May 2020 18:33

the sound stops working when resuming from hibernation

Post by andreasaspenberg »

i can not post on the bug tracker as that is on github whose account system is locked behind a paywall. sound effects stops working until i restart the game. music still works however.
Last edited by andreasaspenberg on 28 Jun 2020 09:42, edited 1 time in total.
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7249
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: the sound stops working when resuming from hibernation

Post by Redirect Left »

andreasaspenberg wrote: 27 Jun 2020 23:28 i can not post on the bug tracker as that is on github whose account system is locked behind a paywall
I have a github account, I can assure you it does not charge for simply registering an account. The paying comes for when you're a big team or lack the ability (or skills) to make your own Git repository on your own hardware.

I've tried to recreate this on a Windows 10 machine, and i cannot do so (in either vanilla OpenTTD, or the JGR patchpack i usually use), it may be helpful if you give us your system spec, at least what version of Windows (or indeed Mac or Linux) you use.
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
jfs
Tycoon
Tycoon
Posts: 1758
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: the sound stops working when resuming from hibernation

Post by jfs »

I can confirm that a regular Github account is free to create and free to maintain.

Your issue can be highly dependent on actual hardware and possibly driver versions.
Are you using an on-board sound output, or an external one? (On-board could be laptop built-in speakers, or an analog speaker or headphone connection on the mainboard, or an analog connection on a PCI/PCIe sound card.)
If you're using an external sound device, is it connected via USB? Bluetooth? HDMI?
Regardless of on-board or external, the system mainboard can make a difference in which order and how fast devices are re-initialised after a resume operation.
andreasaspenberg
Traffic Manager
Traffic Manager
Posts: 159
Joined: 26 May 2020 18:33

Re: the sound stops working when resuming from hibernation

Post by andreasaspenberg »

i have windows 10. i usually leave the game running when i hibernate and when i resume, the sound is gone. it is not a serious problem to me but, it is still a bug. it only affects the sound effects however and not the music. the music still works.
User avatar
jfs
Tycoon
Tycoon
Posts: 1758
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: the sound stops working when resuming from hibernation

Post by jfs »

andreasaspenberg wrote: 28 Jun 2020 09:44 i have windows 10. i usually leave the game running when i hibernate and when i resume, the sound is gone. it is not a serious problem to me but, it is still a bug. it only affects the sound effects however and not the music. the music still works.
Please answer ALL of these questions:

What kind of computer are you using, a desktop computer, a laptop, or a tablet/convertible?

How are you listening to the sound, via speakers built into the computer, via external speakers, via speakers built into the screen, or via headphones?

If you are using external speakers or headphones, how are they connected, via analog cable, via USB, or wirelessly?
If you are using speakers built into your screen, do they get the audio via HDMI cable or via a separate connection?
andreasaspenberg
Traffic Manager
Traffic Manager
Posts: 159
Joined: 26 May 2020 18:33

Re: the sound stops working when resuming from hibernation

Post by andreasaspenberg »

i am using a sound card built into the graphics card, which transfers the sound through display port, to the monitor. it is not however relevant, because only the sound effects stops working. if the problem had been hardware based, the music would also have stopped working but, the music keeps working.
User avatar
jfs
Tycoon
Tycoon
Posts: 1758
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: the sound stops working when resuming from hibernation

Post by jfs »

Well no, it can matter. The sound effects are played directly, either via XAudio or via DirectSound, while the music is (by default) played through the DirectMusic MIDI synthesizer, which is managed differently. It may be that Windows is able to automatically restart the music synth's output, while it expects OpenTTD to manually detect that the sound effects output has broken and needs to be restarted.
andreasaspenberg
Traffic Manager
Traffic Manager
Posts: 159
Joined: 26 May 2020 18:33

Re: the sound stops working when resuming from hibernation

Post by andreasaspenberg »

if what you say is correct, then there is something that the developers of openttd can do.
User avatar
jfs
Tycoon
Tycoon
Posts: 1758
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: the sound stops working when resuming from hibernation

Post by jfs »

It's a fixable problem, but developing the fix might be problematic, since it depends on two things especially: Having a developer able to reproduce the bug, so they will be able to verify if an attempted fix works. And finding a reliable way to detect that the audio device needs to be restarted.

It may be worth trying to change your sound driver for the game: Find your openttd.cfg file, find the sounddriver= line, and set it to either "win32" or "xaudio".
(I remembered wrong writing my previous post, the two sound drivers available on Windows use either Win32 WaveOut or XAudio. There is no DirectSound one.)
User avatar
jfs
Tycoon
Tycoon
Posts: 1758
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: the sound stops working when resuming from hibernation

Post by jfs »

I made an issue for this: #8248
There's several unknowns still, if you can help fill in some of those it's more likely someone will be able to reproduce the bug, and hence also fix it.
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 34 guests