Project

General

Profile

Bug #691747

Some 2.6 SDL2_mixer builds' sounds sound muffled compared to 2.5/SDL1.2_mixer

Added by Jacob Nevins 3 months ago. Updated 3 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Client
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

The sound quality in the 2.6 msys1 builds I just tried sounds muffled (fewer high frequency components?) compared to other builds run at the same time.
  • 2.6.0-beta0+29c84a15cb msys1 Gtk3, Qt: muffled
  • 2.5.8 msys1 Gtk3: less muffled
  • 2.6.0-beta0+c8cad4d8dd msys2 Gtk3: less muffled

(Main test case is stdsounds footsteps. For 2.6 also heard start music.)

Could it be that the msys1 package's SDL2_Mixer defaults to an unhelpful sample rate, and we're relying on that default?

26_sdl2_sdl12_warriors.wav.xz (1.28 MB) 26_sdl2_sdl12_warriors.wav.xz Jacob Nevins, 2017-08-26 09:48 PM

History

#1 Updated by Marko Lindqvist 3 months ago

Can you test with S2_6 msys1 sdl-client. It uses sdl1.2-mixer unlike other S2_6 clients which use sdl2-mixer.

#2 Updated by Jacob Nevins 3 months ago

I have not yet tried that. However, I have noticed that I can reproduce the problem on Linux.

S2_5 (gtk2) sounds less muffled than S2_6 (gtk2, built with SDL2 mixer). If I rebuild S2_6 with --enable-sdl-mixer=sdl1.2, it changes to sounding like S2_5.

Freeciv uses MIX_DEFAULT_FREQUENCY, which the header files on my system suggest should be the same for both SDL1 and SDL2 mixer, 22050Hz (from SDL mixer docs: "Most games use 22050, because 44100 requires too much CPU power on older computers.")

#3 Updated by Jacob Nevins 3 months ago

Mix_QuerySpec() at the end of sdl_audio_init() says the same thing in both S2_6 cases:

2: opened=1 times  frequency=22050Hz  format=S16LSB  channels=2

#4 Updated by Jacob Nevins 3 months ago

I've created a recording in Audacity that when I play it back demonstrates the difference to my ears.

Captured with PulseAudio "monitor" device. (I set Audacity to 176.4kHz to try to oversample massively, but I've no idea if there's really that much information in the recording pipeline.)

Spectrum of this and other samples I looked at doesn't show any gross difference in top frequency (they both cuts off around 11kHz, consistent with a 22050Hz sample rate), so I no longer think this is a simple sample rate issue.

#5 Updated by Jacob Nevins 3 months ago

...The recording is of Warriors moving with Freesounds soundset (lots of high frequencies).
The first two repeats are S2_6 with SDL2_mixer. The second two are S2_6 with SDL1.2_mixer. (Gtk2 client in both cases.)

#6 Updated by Marko Lindqvist 3 months ago

One difference between S2_5 and earlier, and S2_6 and later code is that former set buffer size to 4096 on Windows builds (search S2_5 audio_sdl.c for WIN32_NATIVE). However, since you reproduced on Linux, it seems like removal of that is not related to the issue at hand.

#7 Updated by Jacob Nevins 3 months ago

  • Subject changed from 2.6 msys1 builds' sounds sound muffled compared to other builds to Some 2.6 SDL2_mixer builds' sounds sound muffled compared to 2.5/SDL1.2_mixer

Since this isn't a gross error like a too-low sample rate but just a difference in the quality of the sound, perhaps we don't need to treat it as a bug. I won't treat it as blocking a release, anyway.

Also available in: Atom PDF