[Commits] [wesnoth/wesnoth] faaad1: 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/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: faaad1991b4e0e22043d091a5e5ea0a5694bb5a8
      https://github.com/wesnoth/wesnoth/commit/faaad1991b4e0e22043d091a5e5ea0a5694bb5a8
  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: 0763670a3f50eb7f490fe1b34beb53e4652cc273
      https://github.com/wesnoth/wesnoth/commit/0763670a3f50eb7f490fe1b34beb53e4652cc273
  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/37c71008fe4f...0763670a3f50


More information about the Commits mailing list