The International Simutrans Forum

 

Author Topic: [120.3r8054] Sound Effect Button Alway Mute  (Read 772 times)

0 Members and 1 Guest are viewing this topic.

Offline keito940

  • *
  • Posts: 3
  • Languages: JP
[120.3r8054] Sound Effect Button Alway Mute
« on: July 07, 2018, 06:26:41 AM »
Hello. I am keito 940.
Actually, at 120.2, a sound effect appeared, but if you update to 120.3 it will not produce a sound effect for some reason. I thought that it was a bug in pak128, but there are sound effects even if you look at the sound folder ....
I noticed that the sound effect mute button was locked.
Is this a bug?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9208
  • Languages: De,EN,JP
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #1 on: July 07, 2018, 01:47:35 PM »
There will be no sound, when there is no noise for the cash sound. When using nosound, then upon reload sounds are not loaded. You could delete your settings.xml to have sound again or use the -r 8540 and up

Offline keito940

  • *
  • Posts: 3
  • Languages: JP
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #2 on: July 08, 2018, 07:50:59 AM »

You could delete your settings.xml to have

ok. My Simutrans File Not Have settings.xml

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5276
  • Languages: EN, NO
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #3 on: July 08, 2018, 08:16:51 AM »
ok. My Simutrans File Not Have settings.xml

If you've run Simutrans, you have a settings.xml in your Simutrans user directory. Where that directory is depends on installation method and operating system.

Offline keito940

  • *
  • Posts: 3
  • Languages: JP
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #4 on: July 11, 2018, 08:45:42 AM »
you have a settings.xml in your Simutrans user directory.
ok. ...But even if setting.xml is deleted, no sound effects will come out.

Offline ACarlotti

  • *
  • Posts: 226
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #5 on: July 13, 2018, 04:10:58 AM »
I'm confused about the intention of r8540. Does it change the meaning of the -nosound command line flag from "Don't load any sound files" to "Start the game with sound muted"? If so, then that change could have a severe impact on the memory requirements, and hence ability to play the game, for certain paksets.

For instance, pak128.britain currently has a size of around 600MB, of which about 300MB is sound. Since I am generally running close to the limits of my RAM+swap (2GB each), not loading those 300MB of sound assets is very important to me, particularly when I am frequently restarting the game during testing.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5276
  • Languages: EN, NO
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #6 on: July 13, 2018, 05:07:54 AM »
300 MB is between about 1/6 and 1/10 of the memory space available to Simutrans under normal conditions (nearly 2-3 GB).

Offline ACarlotti

  • *
  • Posts: 226
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #7 on: July 13, 2018, 05:38:11 AM »
300 MB is between about 1/6 and 1/10 of the memory space available to Simutrans under normal conditions (nearly 2-3 GB).
You assume (incorrectly) that I make all of my memory available to Simutrans while playing. I don't. Usually I will have several other applications open, including a web browser; before I discovered the "-nosound" flag I generally needed to close the web browser to be able to run Simutrans properly.

In any case, not loading sound also reduces the startup time by a factor of two (only half as much data to read into memory).

Offline Trenomor

  • *
  • Posts: 1
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #8 on: July 13, 2018, 11:05:42 AM »
Hello. I am keito 940.
Actually, at 120.2, a sound effect appeared, but if you update to 120.3 it will not produce a sound effect for some reason. I thought that it was a bug in pak128, but there are sound effects even if you look at the sound folder ....
I noticed that the sound effect mute button was locked.
Is this a bug?

I had the same problem, using Windows.
The GDI installer from the download section worked for me.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5276
  • Languages: EN, NO
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #9 on: July 13, 2018, 02:16:35 PM »
You assume (incorrectly) that I make all of my memory available to Simutrans while playing.

No, I didn't. I was strictly speaking of the amount of virtual memory given to a 32-bit process, which Simutrans traditionally is. Even someone with infinite amount of RAM isn't much better off than you when it comes to memory available for the rest of Simutrans.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9208
  • Languages: De,EN,JP
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #10 on: July 14, 2018, 02:59:07 PM »
To elaborate on that: The sounds will sit in the page file but will not affect your performance (unless you have a very small harddisk).

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5276
  • Languages: EN, NO
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #11 on: July 14, 2018, 06:27:24 PM »
To elaborate on that: The sounds will sit in the page file but will not affect your performance (unless you have a very small harddisk).
There is still 300 MB of virtual address space (out of 2048 MB, which is 15%) that can not be used for images, the map or other game data. And ACarlotti has claimed only having 2 GB of swap file space, meaning that the sounds use up almost a 7.5% of the total allocatable memory on the whole system without being used. That is unless Simutrans memory maps the sound files, which I do not think is the case for any sound back-end.

Loading 300 MB into RAM only to write it back out to disk also takes time, at least on the kind of systems that tend(ed) to have 2 GB RAM.

Offline Matthew

  • *
  • Posts: 98
  • Languages: EN, some ZH, DE & SQ
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #12 on: July 14, 2018, 08:18:45 PM »
Hello. I am keito 940.

Welcome to the International Simutrans Forum, keito 940!

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9208
  • Languages: De,EN,JP
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #13 on: July 15, 2018, 02:35:30 PM »
That is why the pak64 sounds are encoded as 8 bit 11 kHz mono, which saves a factor of 16 in space ...

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2819
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #14 on: July 15, 2018, 02:54:00 PM »
So the solution is to use crap sound? That doesn't 'sound' right.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9208
  • Languages: De,EN,JP
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #15 on: July 16, 2018, 01:06:55 PM »
These sounds are usually never playerd at full level (so 8 bit is ok). Also they have no direction, so mono is fine. These two are already 4x saving without imposing on quality in the game. The GDI version could also play mp3 coded wavs, but linux cannot (at least the last time when I tested, which might be already ten years ago ... )

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1297
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #16 on: August 09, 2018, 05:39:32 PM »
When using nosound, then upon reload sounds are not loaded. You could delete your settings.xml to have sound again or use the -r 8540 and up
What is this supposed to mean?  If using -nosound, pre 8540, sounds not being loaded is correct. If the game is subsequently loaded without -nosound, then the previous mute selection is retained. Deleting settings.xml is not required. All 8540 does is bloat memory usage when using -nosound, and more important mute the sounds every time you load!


I'm confused about the intention of r8540. Does it change the meaning of the -nosound command line flag from "Don't load any sound files" to "Start the game with sound muted"?
From what I see, even without -nosound specified, r8540 makes it "Start the game with sound muted". Not sure why that would be desired behaviour...


That is why the pak64 sounds are encoded as 8 bit 11 kHz mono, which saves a factor of 16 in space ...
mono 8bit 11kHz only applies to the files on disk. Once loaded into memory, they are converted to mono 16bit 22kHz.


Anyway, it's possible the OP has ran into an issue with SDL2. If still around, can you clarify what version you were/are running?

On my Win10 system, SDL2 is coming back with F32 as the only available audio format. Since the sdl_sound backend is strangely insisting on S16, dr_init_sound is failing. And since the error messages have been mangled (dbg->important takes different params than dbg->warning et al.), you don't see that.
Allowing F32 since SDL2 can convert at play time (and Simutrans is converting upon wav loading anyway) allows sound to work again.

Attached proposed patch reverting 8540, adding sdl2_sound.cc that requests S16, but allows anything, and converts .wavs to the obtained device output format rather than S16 (eliminate double conversion).


Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2256
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #17 on: August 11, 2018, 03:53:19 PM »
Perhaps add a new flag -mute which would set volume to zero at startup if that's what someone wanted, with -nosound reverting to previous behaviour of sound being completely disabled?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9208
  • Languages: De,EN,JP
Re: [120.3r8054] Sound Effect Button Alway Mute
« Reply #18 on: August 21, 2018, 02:13:17 AM »
The SDL2 sound in the patch does only includes SDL.h? Hmm. And on my computer I get SDL2 sound by just renaming the <SDL.h> to <SDL2.h> and leave everything the same.

And I think on should do a nosound and a mute flag, as it is in r8556.
« Last Edit: August 21, 2018, 02:41:22 AM by prissi »