-
Notifications
You must be signed in to change notification settings - Fork 64
Audio works but only for one sound at a time #27
Comments
I've submitted PR #28 . When you fix all compiler warnings I'll take another look. |
The way I added
which will promote all warnings to errors that terminate compilation. |
Right after I approved the pull, I noticed that it was for the master branch. My audio trouble is in the ao-curses branch. I'm working on the warnings right now. |
That patch should be on all branches :). |
I've fixed most of -Wall's complaints. There remain two in src/curses/ux_text.c having to do with the Z-machine's handling of character sets. I don't believe they have anything to do with audio. A test game is at http://661.org/if/soundtest.blb. In the game, the C64, when turned on, will play an OGG file. The Amiga will play a MOD file. The red, green, and blue buttons on the little handheld device will play AIFF samples. All of these files are embedded in the .blb (Blorb) file. The "off" button is supposed to stop all sounds. The dial is a volume control. Any one of these noises will play alone, but if you turn on the Amiga and then press a colored button, then you'll hear distortion, slowdown, and Frotz will segfault. |
In my own code, I usually work to remove all warnings unless those warnings occur due to header files from outside my project. Ok, so I'd like to test this. What do I do to reproduce the problem you are seeing? |
Download http://661.org/if/soundtest.blb and type "frotz soundtest.blb". Then press the colored buttons on the handheld device first so you know what they sound like alone. Then turn on one of the computers. Then press one of the colored buttons. The audio will get distorted for a second or two and then Frotz will crash with a segfault. I presume the distortion is related to the segfault. |
I built frotz with the thread sanitizer using:
and then ran it using:
Once running, I start either the Amiga or the C64 emulation, let it run for a while and then stop it. The "thread-errors.txt" then contains:
The "thread leak" is probably caused by the main thread not waiting for the other leaked thread to terminate before exiting. Its worth fixing but probably not a major issue. The two data races are important and should be fixed. , start either the Amga or the C64 emulation, let it run for a while and then stop it, when the program exits curses, there are a large number of threading errors in the terminal. |
Thread sanitizer said After fixing |
Partial fix applied by @fundamental in d88e730. Thanks! |
I've managed to get audio playback working for AIFF, OGGV, and MOD, but this only works for one sound being played at a time. According to the specs, AIFF can be played at the same time as an OGGV or MOD, but at no time may an OGGV and MOD play at the same time. My code seems to enforce this restriction, but I am having lots of trouble getting AIFF and OGGV/MOD streams mixed. When I start a long-lasting OGGV or MOD clip, then cause an AIFF to play, I get distortion, slowdown, and finally a segfault. I can't figure out what the problem is or even any reference code on doing this the right way.
@erikd, this is what I described to you around a month ago in #xiph. Please take a look at it. The relevant branch is ao-curses.
The text was updated successfully, but these errors were encountered: