Closed i30817 closed 3 years ago
Anyway i think this is because i upgraded gcc and got a new linked list anti-memory corruption check as a extra. The bug may have existed for a while and only crash on the new gcc.
BTW quest for infamy presents a probably related problem in the 'cart intro' where the very fist dialog 'doesn't stop' at the line that is said and other lines of the npc are said after the line finishes. It appears that the end offset of the voice clips is very very wrong in the 64 packfile parser for the old 32 bit games.
No corrupted 'too fast' sound though.
The crash seems random but i can confirm that both quasar and qfi voice clips no longer stop if you don't click the mouse after (including) that commit. Quasar sound worked fine this time, so i don't even know what's up with that, but on this test QFI crashed with the Allegro signal 11, so... random (at least that early on the bug).
Ah. I missed a comment in Allegro headers, and apparently one thing I am doing in a1329085d94e3723e4cbb960a8b1818c1d9a00dc is forbidden. There's a segment of PACKFILE struct that is not even allocated in memory if custom vtable is assigned. Engine uses one field from that segment to know the sound length. That definitely explains why sounds are longer, and most probably can lead to crashes, as engine writes (once) and reads (multiple times) in either another location or unallocated memory.
I will have to figure out how to pass sound size instead of using this field. If that's not possible because of how 3rd party libraries like aldumb work, then maybe I could just allocate PACKFILE myself the way I need. Looking at allegro code, there's nothing complicated there.
PS. Regarding sound noises, can't tell for sure, but that has been a problem for number of users (me included) for years. Potential solution is to switch to our custom SDL2 audio driver, for which you'd need alleg-sdl2digi.so library. One may be acquired from prebuilt linux binaries attached to any recent release, or built from our allegro branch: https://github.com/adventuregamestudio/lib-allegro/blob/allegro-4.4.3.1-agspatch/src/unix/sdl2digi.c
Huh. Thanks for the information, i'll try the driver later.
@i30817 pushed commit ca5cf89b8c2252097e095a0e74a06be87819de6a please tell if it improved anything.
Right seems to work, except the 'speed up digital sound' which is the other problem.
How do you build that .so? Preferably as a static library. Doesn't seem to have a make file component in ags, and i just cloned lib-allegro and i'm unsure of how to hook it up to ags either. Can i just dump the so file in the same dir as the ags file if i manage to build it?
It's not a direct component of ags, but should be hooked up by allegro as a plugin if there's also modules.lst text file with this so name in a directory where allegro can look for libraries. The example of this may be found in prebuilt linux binary archive. As for building, frankly this is something I did not try to do myself yet. In theory it may be built when you are building allegro with certain flags. I have to investigate this again first to have any answers.
I built allegro right now (it's a cmake thing so i could use cmake-qt-gui), and it appears that that file is inbuilt/included as a .o file not a .so. So i'm kind of suspecting i have to link in the whole allegro 4. dll/so into ags and not depend on the system one.
I suppose i could try a prebuilt one, if i can find a prebuilt linux x86-64 binary somewhere. The Cirrus CI only appears to link to statically linked single ags files though.
This "linux packaging" task on CI should contain all necessary prebuilt libraries for recent master branch: https://cirrus-ci.com/task/6155898517192704
This is too complicated to me. Meanwhile i rebooted and the too fast sound in the alsa driver (running with pulse which may influence things) magically fixed itself. I hate it but i'm going to ignore this error. If you want solve it, i'll be on the lookout for a way to force it happening but i can't guarantee anything.
Describe the bug
Two new problems in Quasar, one of sound, which appears 'somehow' to be occuring even on ancient compiles so i don't know what's up with that (corrupted crackly sound maybe a slight 'fast forward', maybe a pulseaudio problem).
The other a crash after pressing play in the main menu with a normal compile (debug compile doesn't crash but the speech audio just zips forward).
In the cmd line:
WARNING: channel 2 - same clip assigned
. And sometimescorrupted double-linked list (not small)
.The non-debug gdb backtrace:
AGS Version d8810107d83241dc2d6594a5283a15cc709f118f (current master)
Game Starship/Spaceship Quasar, often called 'Quasar' only.
To Reproduce
Desktop (please complete the following information):
Additional context Since this was working when the last 'lip sync problem' https://github.com/adventuregamestudio/ags/issues/761 i also reported was fixed in 870d5d8, i'm doing a bisect, and found that the 'corrupted audio' was already happening then ( but i don't remember it) so i'll probably investigate config alterations for that later, maybe it's pulseaudio. Meanwhile, i bisected the crash.
I'll note that this is 'just' the first commit where the game started quitting on me, not the first where the sound is corrupted (i couldn't find it, may be something in the system), or the final result of a segfault - instead, this early it appears to result in a random (I saw 2 and 11) allegro signal and shutdown.