Build 7535 win64, random corrupted audio (loud garbled noise) when ox breeder is working for barbarian tribe.

Bug #1500531 reported by edwardecl
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Medium
Unassigned

Bug Description

This happens about 1/2 the time, sometimes you get the noise you get in build 18, sometimes is a very loud noise as if the sound sample is being played without a decoder.

I am using the unofficial build 7535 win64.

Related branches

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Hi, and thanks for reporting this issue. :)

I was able to reproduce this issue in r7536 on Ubuntu 15.04 (so whatever it is, it's cross platform). I built a cattle breeder (plus a farm and well to keep it supplied) and increased the speed. When the oxen left the building they would sometimes moo and sometimes there would be loud static played.

Changed in widelands:
importance: Undecided → Medium
milestone: none → build19-rc1
status: New → Triaged
tags: added: barbarians sound
Revision history for this message
kaputtnik (franku) wrote :

I couldn't hear anything if an ox leaves the cattlefarm. I could hear all other animals like sheep, birds or the smithies, but no animal sound for the second workers (donkey, horse and ox).

Revision history for this message
kaputtnik (franku) wrote :

There are two sound files for the ox located in sound/farm. Could one say if the sound gets loud on both files or is a specific file causing this?

Revision history for this message
GunChleoc (gunchleoc) wrote :

There used to be additional moos coming from the Farm, which we removed recently. The Cattlefarm should moo every time an Ox is recruited.

Revision history for this message
kaputtnik (franku) wrote :

Hm, strange, i can hear the sounds of ox or donkey if the corresponding building is only on the left side of the screen. I've noticed also similar behavior for farms (using scythe) and sometimes for lumberjacks (cutting trees). Most other sounds are stereo. This would be another bug if somebody can confirm this.

The ox sounds are not noisy here, maybe because of the behavior described above? The sound files are ok and sounds pretty well if you open them in a music player.

kaputtnik (franku)
Changed in widelands:
milestone: build19-rc1 → build20-rc1
Revision history for this message
toptopple (7010622-q-deactivatedaccount) wrote :

This is weird bug! I confirm it for Ubuntu 14.04 64-bit.

My guess is that it has to do with resource availability in the sound service system. On the other side it seems to have to do with file content as well, but not unequivocally. I have identified a file (here: "elk_03.ogg") which has 100% white-snow failure on my system (played on commit 8027 of branch bug-1592692-production_sounds (kaputtnik)). I have exported the same sound source with a different sample rate and quality setting and it seems to work ok. It is however not possible to identify a certain sampling/quality parameter set which leads to the failure.

Perhaps one should check whether the sound playing system offers a resource (channel) availability check that can be polled before a sound is actually delivered or executed.

Sound "elk_02.ogg" works ok now (22050 Hz, 50 kbps).

Revision history for this message
kaputtnik (franku) wrote :

There is a method "play_or_not()" which should decide if a sound should be played. It's quite complicated though:

http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/sound/sound_handler.cc#L358

I did not take a closer look into it.

Revision history for this message
kaputtnik (franku) wrote :

@ toptopple: could you provide a savegame or a map where this happens?

Revision history for this message
toptopple (7010622-q-deactivatedaccount) wrote :

@ kaputtnik: Not required! 1) copy elk_03.ogg into data/sound/animals, 2) rename all other "elk_??.ogg" files into something different, 3) open the map editor and place some elks on the new map. You will soon hear, or not hear, the white snow effect. In my place I never hear the original sound playing but I do hear the disturbing sound playing, my guess is for the length the original sound would take.

Revision history for this message
kaputtnik (franku) wrote :

I did it as you said but the sound is ok here. Attached is the zipped Data-folder where elk_03.ogg (from #6) is added and the other elk-sounds are renamed.

If one want to test this, extract the zip to your local harddrive and run

widelands --datadir=/path/to/extracted/data/Data

Revision history for this message
toptopple (7010622-q-deactivatedaccount) wrote :

1) Anyone publishing test results to this please also state on what system condition, including whether 32 or 64 bit!

2) The map case implies the error isn't likely a running short of resources problem. It may be a lacking resources problem though, but circumstance rather indicates it is some program error in the sound service package. Perhaps the people providing this for Linux should be contacted about it?

3) It has been indicated before the problem is confined to Linux and 64 bit OS. Is this true? It might also be related to hardware, so perhaps unfixable from Wideland's side.

4) Perhaps we can look for a work-around when prove can be given that only certain sounds (content, format) is involved.

Revision history for this message
kaputtnik (franku) wrote :

I am on linux 64bit.

I noticed playing files with aplay do result in white noise. I have tested elk_03.ogg and bird1_00.ogg, on both i hear white noise with aplay. Playing them in a media player all is fine.

The complete datadir was too much to upload on launchpad, so here is only the changed folder 'animals'.

Revision history for this message
toptopple (7010622-q-deactivatedaccount) wrote :

Interesting! So far all of our sound files which I tried to play with aplay (ALSA) resulted in garbled sounds! Guess this is because they convert it to 8000 Hz for a reason we don't understand. I still have to find out how to make aplay play a sound file with the parameters as are native to them!
Conclusions:

1) ALSA is not a reliable tool to test sounds
2) We have to apply a strategy!
3) S1: identify all sound files which cause garbled sounds in Widelands
   (make a collection among developers)
4) S2: if this is a closed set, try to resample the sounds to a format which doesn't garble
5) S3: replace the garbling sounds with non-garbling sounds

Revision history for this message
kaputtnik (franku) wrote :

There is also a tool named ogginfo which prints some of information. Don't know where to find it in Ubuntu, in archlinux it is part of package vorbis-tools. I used it with elk_03.ogg and compared the output with the output of bird1_00.ogg but couldn't find suspicious differences. But i don't know much about sound... Example:
$ > ogginfo elk_03.ogg
Processing file "elk_03.ogg"...

New logical stream (#1, serial: 4ef07e8d): type vorbis
Vorbis headers parsed for stream 1, information follows...
Version: 0
Vendor: Xiph.Org libVorbis I 20101101 (Schaufenugget)
Channels: 1
Rate: 16000

Nominal bitrate: 64,000000 kb/s
Upper bitrate not set
Lower bitrate not set
User comments section follows...
        COMMENTS=plus 10 sec silence
Vorbis stream 1:
        Total data length: 15392 bytes
        Playback length: 0m:13.148s
        Average bitrate: 9,364800 kb/s
Logical stream 1 ended

Revision history for this message
SirVer (sirver) wrote :

I cannot reproduce the sound issues on Mac OS X 64Bit.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

>There is also a tool named ogginfo which prints some of information. Don't know where to find it in Ubuntu, in archlinux it is part of package vorbis-tools.

Looks like the package is called vorbis-tools on Ubuntu/Debian as well.

Revision history for this message
toptopple (7010622-q-deactivatedaccount) wrote :

I hope I mended the Ox sound with my branch https://code.launchpad.net/~7010622-q/widelands/topple-sounds-4, please check it out, in particular if you had the problem before! There was a weird frequency set like 22000, I guess ALSA couldn't digest it. I resampled to 11025.

I suggest we use 22050 and 11025 Hz as our standard sample frequencies and I haven't had any problems with them.

Currently I am not aware of any other sounds with white-snow problem. If you can name some, please do!

GunChleoc (gunchleoc)
Changed in widelands:
milestone: build20-rc1 → build19-rc1
status: Triaged → Fix Committed
Revision history for this message
Steven De Herdt (stdh) wrote :

While checking if this affected me (turns out it was just the boar sound, see #1624857), I noticed some non-standard stuff. These are the non-11025Hz-multiple-sampled and stereo sounds:

stdh@box:widelands$ find data/sound/ -type f -exec file '{}' \; |sort -k7
(...)
data/sound/farm/farm_animal_01.ogg: Ogg data, Vorbis audio, mono, 15000 Hz, ~48000 bps, created by: Xiph.Org libVorbis I (1.1.0 RC1)
data/sound/animals/elk_01.ogg: Ogg data, Vorbis audio, mono, 16000 Hz, ~64000 bps, created by: Xiph.Org libVorbis I
data/sound/taverns/dishes_01.ogg: Ogg data, Vorbis audio, mono, 16000 Hz, ~64000 bps, created by: Xiph.Org libVorbis I
data/sound/farm/horse_01.ogg: Ogg data, Vorbis audio, mono, 20000 Hz, ~50000 bps, created by: Xiph.Org libVorbis I
data/sound/farm/donkey_00.ogg: Ogg data, Vorbis audio, mono, 22000 Hz, ~50000 bps, created by: Xiph.Org libVorbis I
(...)
data/sound/hammering/hammering_01.ogg: Ogg data, Vorbis audio, stereo, 44100 Hz, ~160000 bps, created by: Xiph.Org libVorbis I
data/sound/message_00.ogg: Ogg data, Vorbis audio, stereo, 44100 Hz, ~256000 bps, created by: Xiph.Org libVorbis I
data/sound/message_01.ogg: Ogg data, Vorbis audio, stereo, 44100 Hz, ~256000 bps, created by: Xiph.Org libVorbis I
(...)

And some 48 kHz sounds as well, but I don't suppose that's a problem? I should emphasize that I don't hear any audio problems with any of these frequencies. The direction of hammering_01 I couldn't hear, but that goes for the three hammerings (tested with atlantean builder and shipwright).

Revision history for this message
GunChleoc (gunchleoc) wrote :

I am reopening and retargeting this, so we won't forget to check whether these need fixing.

Changed in widelands:
milestone: build19-rc1 → build20-rc1
status: Fix Committed → Incomplete
GunChleoc (gunchleoc)
tags: added: sounds
removed: sound
Revision history for this message
GunChleoc (gunchleoc) wrote :

We haven't had any reports on this since I last wrote, so let's close this bug.

Changed in widelands:
status: Incomplete → Fix Committed
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.