fundamental [Tue, 21 Feb 2017 20:18:18 +0000 (15:18 -0500)]
Fix Typo When bleep.nsamples < music.nsamples
fundamental [Tue, 21 Feb 2017 15:37:20 +0000 (10:37 -0500)]
Remove Debug Printfs Within Audio Engine
fundamental [Tue, 21 Feb 2017 15:29:22 +0000 (10:29 -0500)]
Add Separate Buffers For Music/FX
This commit:
- Adds a second set of thread signaling semaphores
- Removes pthread_kill() to avoid one lock/unlock race
- Uses *equal length* samples from music/effect streams when mixing
- Temporarily adds a lot of debug prints
The threading logic for this code was rather poor prior to this commit.
As such, I make no claims to the correctness of the threading code
within this commit as the assumptions presented by the code previously
installed in the audio engine are not clearly stated.
The code as presented fixes some of the issues involved in mixing, however
effect + ogg music still seems to pose an issue and the reasons why are
unclear. A rewrite of the architecture of the audio engine is recommended.
fundamental [Tue, 21 Feb 2017 15:28:38 +0000 (10:28 -0500)]
Get Project To Build With Makefile
David Griffith [Thu, 16 Feb 2017 09:56:55 +0000 (01:56 -0800)]
Fix .gitignore
David Griffith [Thu, 16 Feb 2017 07:31:19 +0000 (23:31 -0800)]
Delete src/common/git_hash.h when doing "make clean".
David Griffith [Wed, 1 Feb 2017 03:58:00 +0000 (19:58 -0800)]
Mention the need for libsamplerate.
David Griffith [Tue, 31 Jan 2017 03:32:21 +0000 (19:32 -0800)]
Fix #33: Increase TEXT_BUFFER_SIZE to 275.
Inform7 is capable of overflowing the text (output) buffer by cramming
it with a maximum of 263 bytes. This was discovered by pushing the
limits of the Inform7 compiler. Inform6 won't do this, even if it's
told to print text far exceeding 263 bytes.
This overflow situation is not a security problem because the VM catches
it and aborts. I am unsure if it's a good idea to truncate the attempt
to overfill the buffer and continue.
David Griffith [Tue, 10 Jan 2017 12:45:21 +0000 (04:45 -0800)]
Fix #34: Exit if screen is wider than 255 instead of giving width of zero.
David Griffith [Tue, 10 Jan 2017 12:36:10 +0000 (04:36 -0800)]
Possible incorrect use of print_string() in os_reset_screen().
If print_string() and probably by extension print_char() are used before
the Z-machine is running, a few random garbage characters are printed
instead of the intended text. I'm not clear why this happens.
David Griffith [Fri, 23 Sep 2016 09:27:15 +0000 (02:27 -0700)]
Fixed a problem with segfault on attempting to load a nonexistant file.
ux_blorb_init() needs to be revisited to make sure all common blorb
filename extensions are supported.
David Griffith [Sun, 17 Jul 2016 06:25:07 +0000 (23:25 -0700)]
Make Git hash, tag, and branch info available to Frotz.
David Griffith [Wed, 15 Jun 2016 08:06:01 +0000 (01:06 -0700)]
Add UNUSED() macro to ux_audio_none.c.
David Griffith [Sat, 11 Jun 2016 09:03:40 +0000 (02:03 -0700)]
Merge pull request #30 from erikd/ao-curses
Add two new locks
Erik de Castro Lopo [Sat, 11 Jun 2016 07:57:06 +0000 (17:57 +1000)]
Add two new locks
David Griffith [Sat, 11 Jun 2016 06:16:13 +0000 (23:16 -0700)]
Better way of keeping -Wall quiet.
David Griffith [Sat, 11 Jun 2016 04:06:28 +0000 (21:06 -0700)]
Merge branch 'erikd-ao-curses' into ao-curses
David Griffith [Sat, 11 Jun 2016 04:05:22 +0000 (21:05 -0700)]
More compiler warning fixes using Martin Pool's UNUSED macro.
Erik de Castro Lopo [Sat, 11 Jun 2016 03:16:03 +0000 (13:16 +1000)]
Fix more compiler warnings
Erik de Castro Lopo [Sat, 11 Jun 2016 02:14:04 +0000 (12:14 +1000)]
Makefile: Separate out CFLAGS
David Griffith [Sat, 11 Jun 2016 01:57:16 +0000 (18:57 -0700)]
Corrected most of -Wall's complaints.
David Griffith [Sun, 15 May 2016 06:58:50 +0000 (23:58 -0700)]
Fix unlock of an already unlocked mutex.
David Griffith [Fri, 16 Oct 2015 07:33:09 +0000 (00:33 -0700)]
09485e3a caused subsequent bleeps to be distorted. Segfaults back again.
David Griffith [Fri, 16 Oct 2015 06:06:54 +0000 (23:06 -0700)]
Crap
David Griffith [Fri, 16 Oct 2015 05:53:50 +0000 (22:53 -0700)]
Make -Wall and -Wextra happy
David Griffith [Fri, 16 Oct 2015 05:00:25 +0000 (22:00 -0700)]
No more segfaults when playing an AIFF when an OGG is already playing.
Sound of any kind is distorted after this.
David Griffith [Thu, 1 Oct 2015 08:00:29 +0000 (01:00 -0700)]
Update and cruft-removal for the manpages.
David Griffith [Thu, 17 Sep 2015 06:20:00 +0000 (23:20 -0700)]
Now OGGV playback works.
David Griffith [Wed, 16 Sep 2015 23:29:08 +0000 (16:29 -0700)]
Remove unnecessary memmmove() calls.
David Griffith [Sun, 6 Sep 2015 00:10:33 +0000 (17:10 -0700)]
Removed unnecessary startup chatter.
David Griffith [Mon, 31 Aug 2015 00:48:40 +0000 (17:48 -0700)]
Change some exit() calls to simple returns.
David Griffith [Mon, 31 Aug 2015 00:44:01 +0000 (17:44 -0700)]
Going back to calling libvorbisfile directly because libsndfile doesn't
support reading OGGV embedded in other files. OGGV playback sort of
works (slow and distorted). Turning it off isn't exactly right.
David Griffith [Thu, 27 Aug 2015 07:16:28 +0000 (00:16 -0700)]
Trying using the playaiff code for OGGV. It should work, right? Nope. Why not?
David Griffith [Mon, 10 Aug 2015 08:39:21 +0000 (01:39 -0700)]
Alternating MODs with AIFFs now work completely. Still no mixing yet.
David Griffith [Mon, 10 Aug 2015 03:31:03 +0000 (20:31 -0700)]
Mods play correctly. No mixing yet.
David Griffith [Tue, 30 Jun 2015 10:50:28 +0000 (03:50 -0700)]
README tweaks.
David Griffith [Mon, 22 Jun 2015 09:54:47 +0000 (02:54 -0700)]
First stab at playing MODs with AIFFs. Plays slow and only once.
David Griffith [Mon, 22 Jun 2015 02:46:37 +0000 (19:46 -0700)]
It seems that in Debian 7, -lpthread was automatically being used.
David Griffith [Mon, 22 Jun 2015 02:09:50 +0000 (19:09 -0700)]
Update manpages and conf-big.
David Griffith [Thu, 21 May 2015 07:25:35 +0000 (00:25 -0700)]
Remove old-style save file format support.
David Griffith [Thu, 21 May 2015 07:24:45 +0000 (00:24 -0700)]
Bump version number to 2.45pre (Please don't package 2.45pre, FreeBSD people)
David Griffith [Fri, 15 May 2015 06:18:37 +0000 (23:18 -0700)]
Fixed problem with background color not being set correctly.
David Griffith [Fri, 15 May 2015 04:30:56 +0000 (21:30 -0700)]
Fixing restart in games that have zcode in blorb files.
Copied from pull request from Bill Lash <william.lash@gmail.com> for the
master branch.
David Griffith [Thu, 14 May 2015 05:23:14 +0000 (22:23 -0700)]
Improper writing of variables and eval stack led to corrupt saves.
David Griffith [Wed, 13 May 2015 21:03:19 +0000 (14:03 -0700)]
Don't allow multiple playaiff() threads.
If there's already a playaiff() thread going when another playaiff()
thread is to be started, tell the first one to stop and clean up, then
join to it when it terminates before proceeding to start another
playaiff() thread. This will cleanly handle a barrage of samples called
to start in quick succession. For example, suppose your game has
several buttons that make noises. Doing "PRESS GREEN BUTTON. PRESS BLUE
BUTTON. PRESS RED BUTTON. PRESS YELLOW BUTTON" will not cause playaiff()
to trip over itself. Instead all the samples will be played briefly
except the one for the yellow button, which will play until the player
does something else noisy at the next command prompt. What's actually
heard is the last button noise. Such a reaction probably isn't
desirable, but is well-within the responsibility of the game author to
decide if and how AIFF samples will be allowed to stomp on one another.
The business about allowing only one AIFF at a time and one OGG/MOD at a
time, but mix the two comes from the fact that all other Z-machine
emulators with audio capability behave this way. The Z-machine spec
clearly says that only one sample (AIFF) may be played at once. I don't
know where the idea that allowing an OGG/MOD to be mixed came from or
who decided it was okay. The Blorb specs seem silent on the issue of
having multiple AIFFs and OGG/MODs playing at once.
David Griffith [Wed, 13 May 2015 08:20:43 +0000 (01:20 -0700)]
Stereoize monaural AIFF playback so that the mixer always gets stereo data.
David Griffith [Wed, 13 May 2015 07:32:27 +0000 (00:32 -0700)]
Fix some stupidity.
David Griffith [Wed, 13 May 2015 07:11:00 +0000 (00:11 -0700)]
Now providing the mixer with floats for ease of mixing later on.
David Griffith [Wed, 13 May 2015 05:35:56 +0000 (22:35 -0700)]
Added os_warn() to complement os_fatal().
David Griffith [Wed, 13 May 2015 04:59:11 +0000 (21:59 -0700)]
Added os_init_sound() stub to make the common code happy when building dfrotz.
David Griffith [Mon, 4 May 2015 23:38:19 +0000 (16:38 -0700)]
Update address of FSF and stuff.
David Griffith [Tue, 28 Apr 2015 07:00:17 +0000 (00:00 -0700)]
Cleaned up Makefile
David Griffith [Mon, 27 Apr 2015 21:51:45 +0000 (14:51 -0700)]
Fix line spacing and stuff.
David Griffith [Sat, 25 Apr 2015 09:58:10 +0000 (02:58 -0700)]
Using Erik's example code (modified) to do sample rate conversion
David Griffith [Sat, 25 Apr 2015 08:41:07 +0000 (01:41 -0700)]
Thank-you to Erik de Castro Lopo.
David Griffith [Wed, 22 Apr 2015 08:29:25 +0000 (01:29 -0700)]
Some -Wall fixes.
David Griffith [Sun, 19 Apr 2015 06:40:35 +0000 (23:40 -0700)]
Allow for os_stop_sample() to work properly, more or less.
David Griffith [Fri, 17 Apr 2015 11:44:24 +0000 (04:44 -0700)]
Replaced stupid use of usleep() with a semaphore.
David Griffith [Fri, 17 Apr 2015 08:46:25 +0000 (01:46 -0700)]
Putting this back in for a bit.
David Griffith [Thu, 16 Apr 2015 23:33:27 +0000 (16:33 -0700)]
Added missing sem_init()s and pthread_mutex_init()
David Griffith [Wed, 15 Apr 2015 08:25:04 +0000 (01:25 -0700)]
Beginnings of os_stop_sample()
David Griffith [Wed, 15 Apr 2015 07:47:54 +0000 (00:47 -0700)]
Playing AIFF samples in the background works now with some weird code.
After fooling around in ddd for quite some time, I discovered that the
code would work only if I put a delay in os_start_sample() just after
spawning the thread to run playaiff(). At this hour, I'm at a loss to
explain why this is happening.
David Griffith [Sun, 12 Apr 2015 07:58:25 +0000 (00:58 -0700)]
Now AIFF samples play correctly.
David Griffith [Sun, 12 Apr 2015 07:58:01 +0000 (00:58 -0700)]
At long last, a .gitignore file...
David Griffith [Sun, 12 Apr 2015 07:56:20 +0000 (00:56 -0700)]
Quiet down the Makefile.
David Griffith [Fri, 10 Apr 2015 09:12:44 +0000 (02:12 -0700)]
Roll back thread crap. Trying another angle for a while.
David Griffith [Fri, 10 Apr 2015 08:50:56 +0000 (01:50 -0700)]
Reworked the Makefile. There may be more changes like this.
David Griffith [Mon, 6 Jan 2014 09:09:24 +0000 (01:09 -0800)]
Attempting to get threads really working.
David Griffith [Mon, 6 Jan 2014 08:32:49 +0000 (00:32 -0800)]
Eliminated unnecessary opens and closes of sound device (eliminating pops).
David Griffith [Mon, 6 Jan 2014 08:19:47 +0000 (00:19 -0800)]
Minor advance in bleep processing.
David Griffith [Mon, 6 Jan 2014 04:12:56 +0000 (20:12 -0800)]
Bleeps starting to work with threads.
David Griffith [Mon, 6 Jan 2014 03:46:18 +0000 (19:46 -0800)]
Adding os_init_sound() for the core to call.
Delete prototype for os_speech_output().
David Griffith [Wed, 1 Jan 2014 09:55:29 +0000 (01:55 -0800)]
Pass a struct to playaiff() and friends.
David Griffith [Wed, 1 Jan 2014 03:13:19 +0000 (19:13 -0800)]
Falling back to blocking audio in preparation for an attempt with pthreads.
David Griffith [Tue, 31 Dec 2013 10:18:09 +0000 (02:18 -0800)]
Signal sanity.
David Griffith [Tue, 31 Dec 2013 08:58:35 +0000 (00:58 -0800)]
Comment out debug printf
David Griffith [Tue, 31 Dec 2013 06:16:27 +0000 (22:16 -0800)]
Kill all sound effects if os_stop_sample(0) is used (ie, when quitting).
David Griffith [Tue, 31 Dec 2013 06:16:00 +0000 (22:16 -0800)]
Trying cutting over to the AIFF instead of mixing it with the OGG.
David Griffith [Tue, 31 Dec 2013 05:00:45 +0000 (21:00 -0800)]
Trying floats
David Griffith [Mon, 30 Dec 2013 11:33:04 +0000 (03:33 -0800)]
Let's see if an ntohs() call helps with mixing AIFFs.
David Griffith [Mon, 30 Dec 2013 10:49:43 +0000 (02:49 -0800)]
A bit more farting around.
David Griffith [Thu, 26 Dec 2013 06:48:59 +0000 (22:48 -0800)]
AIFFs playing as 16-bit. Still need to match rate.
David Griffith [Thu, 26 Dec 2013 01:32:57 +0000 (17:32 -0800)]
Crude mixing with AIFF and OGG works. Need to match sample size and rate.
David Griffith [Fri, 20 Dec 2013 08:34:11 +0000 (00:34 -0800)]
Stopping sounds implemented. Mixing bleeps with music, not so much.
David Griffith [Fri, 20 Dec 2013 08:32:39 +0000 (00:32 -0800)]
Pass a resource number to os_start_sample() and friends.
Needed to support sound mixing.
David Griffith [Fri, 20 Dec 2013 07:26:31 +0000 (23:26 -0800)]
MODs and OGGs play (can't stop them yet).
David Griffith [Fri, 20 Dec 2013 07:26:04 +0000 (23:26 -0800)]
Just this for a while
David Griffith [Fri, 20 Dec 2013 07:25:09 +0000 (23:25 -0800)]
Update the TODO list
David Griffith [Tue, 17 Dec 2013 06:58:25 +0000 (22:58 -0800)]
Runtime endian determination.
David Griffith [Tue, 17 Dec 2013 04:48:24 +0000 (20:48 -0800)]
Oops with zgetopt.
David Griffith [Tue, 17 Dec 2013 04:48:08 +0000 (20:48 -0800)]
Not used anymore.
David Griffith [Tue, 17 Dec 2013 03:42:52 +0000 (19:42 -0800)]
Random cleanup and marking stuff static
David Griffith [Tue, 17 Dec 2013 03:13:21 +0000 (19:13 -0800)]
Not using this file anymore.
David Griffith [Mon, 16 Dec 2013 11:21:22 +0000 (03:21 -0800)]
Nobody uses this anymore.
David Griffith [Mon, 16 Dec 2013 10:50:28 +0000 (02:50 -0800)]
Updates and cleanups. Now things are more or less self-consistant.
David Griffith [Mon, 16 Dec 2013 10:33:19 +0000 (02:33 -0800)]
Preliminary changelog
David Griffith [Mon, 16 Dec 2013 10:32:49 +0000 (02:32 -0800)]
Docs cleanup and updates
David Griffith [Mon, 16 Dec 2013 10:30:27 +0000 (02:30 -0800)]
Shiny new Makefile.
David Griffith [Mon, 16 Dec 2013 08:54:55 +0000 (00:54 -0800)]
Forgot to change returns to exits. Added commentary.
David Griffith [Mon, 16 Dec 2013 08:22:01 +0000 (00:22 -0800)]
This approach seems to work better. Just AIFF for now.