[Commits] [wesnoth/wesnoth] 674a6b: sound: Include SDL_Mixer channel layout in debug o...

GitHub noreply at github.com
Sat Mar 15 04:37:00 UTC 2014


  Branch: refs/heads/1.12
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 674a6bcfa9a621917f7247727b960d4d1454ad67
      https://github.com/wesnoth/wesnoth/commit/674a6bcfa9a621917f7247727b960d4d1454ad67
  Author: Ignacio R. Morelle <shadowm at wesnoth.org>
  Date:   2014-03-15 (Sat, 15 Mar 2014)

  Changed paths:
    M src/sound.cpp

  Log Message:
  -----------
  sound: Include SDL_Mixer channel layout in debug output


  Commit: de7686d32ef8998c909bf083f23bd52cc6bf2c1a
      https://github.com/wesnoth/wesnoth/commit/de7686d32ef8998c909bf083f23bd52cc6bf2c1a
  Author: Ignacio R. Morelle <shadowm at wesnoth.org>
  Date:   2014-03-15 (Sat, 15 Mar 2014)

  Changed paths:
    M changelog
    M src/sound.cpp

  Log Message:
  -----------
  sound: Increase the mixer channel allocation from 16 to 32

This raises the sound effect (SOUND_FX) channel group size from 5 to
21.

The rationale for this change is that the current SFX channel group size
is not enough in some situations (particularly during cutscenes and with
accelerated animations enabled), and decreasing the channel group size
for sound sources (currently 8, preserved as-is in this commit) doesn't
seem like the best solution at this point considering that the sound
source feature is neglected enough as it is. Three other channels are
reserved for the turn bell, turn timer countdown sound, and UI sounds,
and it'd be an even worse idea to drop those.

The SDL_mixer documentation suggests that increased mixer channel
allocations may be a memory usage concern with a high number of channels
("We're talking REALLY high!", their words), but hopefully this small
increase is good enough for our and the UMC making community's purposes
without impacting memory usage or performance on our main supported
platforms. At least Wesnoth's RSS didn't seem to change over a megabyte
when testing this patch on Linux (using ALSA).

Note:

Should this increased limit cause issues on some platform that matters
(hopefully not!) an alternative would be to reengineer the sound channel
selection done in sound::play_sound_internal() so instead of skipping
sounds when all channels are busy, the oldest playing channel is stopped
and reset to the requested sound, for channels in the SOUND_FX group.
However, this seems too complicated to do at this point for 1.12, so yet
another alternative would be to simply reduce the number of channels
reserved for sound sources and give those back to SOUND_FX.


Compare: https://github.com/wesnoth/wesnoth/compare/24a18b29a8e3...de7686d32ef8


More information about the Commits mailing list