quadra-game / quadra

An addictive action puzzle game with single player and multiplayer capabilities (Internet or LAN).
GNU Lesser General Public License v2.1
28 stars 18 forks source link

sound is distorted on Ubuntu Intrepid Ibex #96

Closed pphaneuf closed 10 years ago

pphaneuf commented 10 years ago

What steps will reproduce the problem?

  1. Start the game
  2. Any sound it makes 3.

What is the expected output? What do you see instead? The sounds that the game makes are not normal it sounds like a static TV set whenever you hover over any button or when you get lines in the game.

What version of the product are you using? On what operating system? 1.2 RC7 Hubuntu Intrepid 8.10 2.6.27-11-generic

Please provide any additional information below.

pphaneuf commented 10 years ago

I recently upgraded one of my computers to Intrepid Ibex, I'll look into this.

pphaneuf commented 10 years ago

Hmm, this one, I couldn't reproduce, though... Could you put the output of "cat /dev/sndstat" here? Try experimenting with the options in System > Preferences > Sound, maybe?

Does an older version of Quadra work right?

pphaneuf commented 10 years ago

No reproduction information, I'll keep open, but we'll go ahead without this.

pphaneuf commented 10 years ago

There is no /dev/sndstat on my system, and I found out online that this device file is obsolete and without replacement. Is there another way to debug the sound ? Do you need a strace ?

With the quadra sdl version the sound works fine, and also I have amarok running at the same time, which doesn't work in quadra 1.2 because the device is busy.

pphaneuf commented 10 years ago

I have the source code of quadra 1.1.8 and an old rpm from that version. The source doesn't compile any more, maybe because it requires older libraries. The rpm doesn't work either:

erreur: Dépendances requises: libpng.so.2 est nécessaire pour quadra-1.1.8-1.i386 libstdc++-libc6.2-2.so.3 est nécessaire pour quadra-1.1.8-1.i386

And these versions of the libraries are no more available in my distribution (OpenSUSE 11.1)

pphaneuf commented 10 years ago

On my Ubuntu system, the /dev/sndstat is there, but is actually a symlink to /proc/asound/oss/sndstat, which should be present on your system too (at least, once the OSS/ALSA emulation module has been loaded).

It's quite possible that the OSS emulation has a "single opener" limitation, yes.

I think the library requirements of Quadra 1.1.8 are the same as 1.2.0 (the support for Svgalib is in the older version, but should be optional), the problem is mainly that the C++ code is not 100% standard-compliant, and as GCC was made standard-compliant, some of the code constructs became illegal. I think you'd need a GCC older than 3.0!

An strace would be very large, and probably not very helpful (too much to decode, and some of the sound-related ioctls aren't formatted properly by strace), but compiling with passing the "--enable-debug" option to "configure" will make Quadra output debug information to stdout/stderr while running, those might be helpful.

I do have a feeling that the overall simplest way to fix this would be to release an SDL version as quickly as possible. :-)

Thanks for helping out debug this!

pphaneuf commented 10 years ago

And here comes the sndstat:

Sound Driver:3.8.1a-980706 (ALSA v1.0.19 emulation code) Kernel: Linux vincent 2.6.27.21-0.1-pae #1 SMP 2009-03-31 14:50:44 +0200 i686 Config options: 0

Installed drivers: Type 10: ALSA emulation

Card config: HDA Intel at 0x9b300000 irq 22

Audio devices: 0: ALC888 Analog (DUPLEX)

Synth devices: NOT ENABLED IN CONFIG

Midi devices: NOT ENABLED IN CONFIG

Timers: 7: system timer

Mixers: 0: Nvidia ID 3

pphaneuf commented 10 years ago

Here's the debug log. But I didn't find anything related to sound in it.

The sound itself reminds me of past experience with 16-bit raw audio files where I had to choose between little endian and big endian. If I chose the wrong one, it sounded just like quadra does now. You might investigate that.

pphaneuf commented 10 years ago

Quite right, not much useful in there relative to sound...

I did fix an endianness problem when making the SDL port, but it was only revealed to me because I did this port on my Apple PowerBook, which has a PowerPC CPU, and that the endianness of the CPU and of the sound card were different. I'm pretty sure that on an x86, it should have worked fine? Strange...

pphaneuf commented 10 years ago

I have the same sound issue. I am running archlinux on 64bit.

Running "padsp quadra" corrects the sound issue. I guess that means that pulseaudio's oss support is better than the alsa's oss emulation for quadra, or something of the like. I did try pasuspender first - it did not help the problem.

$ cat /proc/asound/oss/sndstat Sound Driver:3.8.1a-980706 (ALSA v1.0.21 emulation code) Kernel: Linux Twin 2.6.32-ARCH #1 SMP PREEMPT Tue Feb 9 15:12:10 CET 2010 x86_64 Config options: 0

Installed drivers: Type 10: ALSA emulation

Card config: HDA Intel at 0xda100000 irq 22 HDA ATI HDMI at 0xda010000 irq 17

Audio devices: 0: STAC92xx Analog (DUPLEX)

Synth devices: NOT ENABLED IN CONFIG

Midi devices: NOT ENABLED IN CONFIG

Timers: 31: system timer

Mixers: 0: IDT 92HD75B3X5 1: ATI R6xx HDMI

pphaneuf commented 10 years ago

What version of Quadra was that for that last report (comment #11)? 1.1.8 or 1.2.0?

Thanks!

pphaneuf commented 10 years ago

What version of Quadra was that for that last report (comment #11)? 1.1.8 or 1.2.0?

Thanks!

pphaneuf commented 10 years ago

Since using PulseAudio instead of ALSA fixed it, I'm guessing that this was some kind of issue in the system. I don't think it's realistic to expect me to go in there and debug this if I do not have reproduction, considering how little time I put on Quadra these days. If someone else comes up with a patch, send it in...