Commit Graph

254 Commits

Author SHA1 Message Date
Bill Currie 45288a1a7f Fix the ghastly sound quality.
Due to quake's original sound engine using a push model, the actual place
to which the sound data should be written is not necessarily where the
"hardware" dma cursor is, but rather where the last write finished off.
Thus, the correct output location is indicated by snd_paintedtime rather
than snd_shm->framepos.
2011-12-08 11:02:19 +09:00
Bill Currie 881d4babce Fix some undefined symbols in snd_alsa.c.
Serves me right for testing with only my debug build :P
2011-09-08 18:10:09 +09:00
Bill Currie a8ea3aaad9 Allow dma sound targets to specify an xfer function. 2011-09-07 17:00:18 +09:00
Bill Currie 9ffa1f410a Detect the silent death of the jack client thread.
When jackd gets an unhandled xrun, it stops all processing but neglects to
tell the client about it. Thus, add a bit of a watchdog function to
s_update() and assume the client thread is dead if there's no sign of life
after one second. No more hanging on exit.
2011-09-07 15:16:27 +09:00
Bill Currie f75b0a611b Some compile fixes for OpenBSD 2011-08-25 22:35:20 +09:00
Bill Currie 9ccd570105 Fix a problem with linking FLAC libs. 2011-07-23 21:37:34 +09:00
Bill Currie efa0105748 Rename some headers to fix doxygen warnings. 2011-07-23 15:58:45 +09:00
Antti Harri 8d1bd58ade snd_dma.c fixes for non-power-of-two values. From Jacob Meuser. 2011-06-04 09:47:15 +03:00
Bill Currie 74a7e07dfc Use AM_CFLAGS instead of CFLAGS.
CFLAGS is meant to be reserved for the user.
2011-05-10 12:44:44 +09:00
Bill Currie 70783e4bd5 Disable all sound calls if jack could not be contacted.
This fixes the file handle leak when jack is unavailable.
2010-12-25 20:31:14 +09:00
Jeff Teunissen 9defba8d92 Get rid of plugin versioning (again).
automake needs -avoid-version to be in Makefile.am, otherwise it doesn't
make libtool do the right thing...or something. My head hurts. ;)
2010-12-25 04:45:39 -05:00
Bill Currie ce64227a71 Fix for debian wildmidi.
This might break lenny :/
2010-12-24 17:33:09 +09:00
Bill Currie 185e21e4e4 Tweak some developer cvar usage. 2010-11-27 16:53:17 +09:00
Bill Currie 8c4fe2f844 Rename Sys_DPrintf to Sys_MaskPrintf.
We now have finer runtime control over what gets printed. Need to do a
SYS_DEV audit, creating new masks as apropriate.
2010-11-26 16:19:26 +09:00
Bill Currie 1dfb914c46 fix an oopsie (rebase!!) 2010-11-21 14:25:32 +09:00
Bill Currie 4cec187465 zixthree's wav file patch
Wav file were not read correctly when encoutering most chunk type beside the ones used by QuakeForge.

This patch will fix the riff loader code so that unused but defined chunk are skipped. Most wav files should now be loaded correctly fixing some silent sound effect.

Also fixed a typo in wav loader and reordered wav validity check so that format is checked first. The data chunk could be inexistant on some weird format and so an invalid format is a more helpful error text.

! Fix: Skip unsupported chunk in riff loader instead of rejecting riff file.
! Fix: typo in Microsoft name.
! Fix: ordering of wav validity to enable more helpful error text.
2010-11-21 14:18:15 +09:00
Bill Currie 99e87b092b zixthree's stereo swap patch.
Modified slightly for formatting and cleaner swapping.
2010-11-21 14:09:23 +09:00
Bill Currie 37fb8d22da Don't open a streamed sfx when there's no sound driver.
This happens when qf fails to connect to jackd (possibly other times).
There is probably a better solution to the problem, but not opening a
stream when the sample rate is reported as 0 definitely fixes the inifinite
recursion in read_samples().
2010-11-14 20:46:29 +09:00
Bill Currie 5a6e66b23e hopefully, correct plugin linking options
how we got away with this for so long is beyond me, but it seems libtool
really wants -rpath even for plugins (otherwise it refuses to install them)
2010-08-21 13:01:35 +09:00
Bill Currie 4449f10c0a get alsa and sdl working, though sdl seems to be mono only 2010-08-15 05:15:47 +00:00
Bill Currie bc4a3e79dc d'oh, bogus $ 2010-08-14 02:48:53 +00:00
Bill Currie 81ac779b7f forgot to add libsamplerate to the default renderer 2010-08-14 02:38:19 +00:00
Bill Currie cc697236e5 bah, forgot that libsamplerate doesn't check for errors 2010-08-13 01:48:48 +00:00
Bill Currie 54fc922f6c better error checking while reading streamed data 2010-08-13 01:48:20 +00:00
Bill Currie ce5658416d add support for up to 8 channels in sound effect files
The sounds are down-mixed to 2 channels (qf does not (yet) support more than
2 channel output), but this allows pretty much anything to be used for a
source of music. Only 5.1 (6 channel), stereo and mono have been tested, but
the others should work (any issues would be mis-interpretation/implementation
of the channel layout).
2010-08-12 02:28:27 +00:00
Bill Currie b1620616b9 reset the "resampler" when seeking 2010-08-11 23:47:31 +00:00
Bill Currie 22e8698827 resampling now works
However, no fallback for when libsamplerate is missing.
2010-08-11 23:47:03 +00:00
Bill Currie 1c985bc925 bah, forgot these 2010-08-11 23:46:28 +00:00
Bill Currie 0e3b395943 ok, non-resampled flacs now work beautifully 2010-08-11 23:45:32 +00:00
Bill Currie 7502cd9ec5 making slow progress on sound quality
streamed oggs playback cleaning when not resampling, but flacs are still crap
2010-08-11 23:45:09 +00:00
Bill Currie 65a748fc3c floating point mixer now working
the resampler is being badly abused for streams, and it's not yet properly
autoconfiscated, but things are working. Better yet, at the correct pitch and
speed.
2010-08-11 23:44:34 +00:00
Bill Currie 2bb2d14b89 make "sample counts" frame based rather than mono sample based
that was always horribly confusing
2010-08-11 23:43:35 +00:00
Bill Currie d0906f1453 conditionally build the sound format support files
Rather than using an ifdef around the entire code, get autoconf to do the work
for us. For one thing, this allows doxygen to produce decent docs. It also
makes for less compalation when building without support for various formats.
2010-08-11 23:42:42 +00:00
Bill Currie c0a8c6c695 properly prefix all functions, static or not
makes doxygen produce better docs
2010-08-11 23:41:04 +00:00
Bill Currie ac44950a69 sanitize the code by using defines for old flac libs 2010-08-11 23:40:35 +00:00
Bill Currie 46a067b2f6 Do proper error handling when loading sound files.
This fixes the segfault grg got when trying to play a 5.1 channel file.
2010-08-08 03:02:55 +00:00
Bill Currie 0dfff8fd58 ignore stuff 2010-08-07 10:42:09 +00:00
Bill Currie adee45d22b add a comment about the valid range of samples 2010-08-06 01:58:12 +00:00
Bill Currie 98a0da742a Prefill the sfx stream buffer to ensure the decoders have allocated any memory they might need. Problem found using jack_interposer (http://repo.or.cz/w/jack_interposer.git). 2010-08-06 00:41:42 +00:00
Bill Currie 6e2a8f1e3d Do not allow sounds to start when we have no connection to the jack server. This fixes the shutdown hang when the connection to the server is lost. 2010-08-05 07:20:50 +00:00
Bill Currie 997102fea8 audit the usage of "only"
There are still a few iffy places (notably around certain prepositions), but
the relevant sentences are now much easier to read.
2010-01-13 06:42:26 +00:00
Bill Currie f315a122e5 attempt to handle jack shutdown. this should avoid locking up on client shutdown when jack disappears 2009-12-24 06:35:15 +00:00
Bill Currie 0af43cf016 make the resampling state a little more self-contained. this should make 2009-01-08 07:48:08 +00:00
Bill Currie 9c9f79d05c provide the ability to control which jack server to connect to 2007-07-03 10:30:13 +00:00
Bill Currie d93670df3b cleanup some cruft 2007-06-09 07:48:44 +00:00
Bill Currie c6d7a19851 Move all the cd plugins into the audio subdir so things can be built in the correct order (as cd_file depends on libQFsound). 2007-05-31 06:30:46 +00:00
Bill Currie e6a5994cd0 patch from raorn for new flac 2007-05-30 22:06:47 +00:00
Bill Currie 201f01b66c hopefully speed up byte swaps 2007-05-26 23:18:46 +00:00
Bill Currie 253795ca7f better handling of missing sound files. fixes the seg when the cd track isn't available. 2007-05-21 21:40:59 +00:00
Bill Currie 1be73a528a don't seg when non-jack isn't available either :P 2007-05-21 21:39:59 +00:00