Commit Graph

550 Commits

Author SHA1 Message Date
Bill Currie d265bbf011 Support any sample rate. 2010-12-15 18:48:25 +09:00
Bill Currie df65679028 Remove support for alsa 0.9.
It's way obsolete and I doubt we'll ever need it again. I do wonder what to
do abut sun, sgi etc.
2010-12-15 18:48:25 +09:00
Ragnvald Maartmann-Moe IV 843823de84 testsound depends on libQFutil 2010-12-10 17:07:06 +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 15b423cbe7 Track 0 is used to stop the BGM 2010-11-20 14:32:27 +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 f666f8d27a Get the lib dependency for testsound right.
No need for $(top_builddir) when the lib is in the same directory. Fixes
parallel builds.
2010-09-25 23:07:06 +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 1442273a8f more opaque correctness 2010-08-20 12:58:37 +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 3499f5257f add a test app and a workaround for the clicking in the resamled stream
the proper fix for the clicking is to either use SRC's callback resampler or
fix snd_mem.c to handle not getting the samples it expects, but I think the
callback will be better in the long run.
2010-08-11 23:45:56 +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 dabb720fd1 be a little more honest (don't say "Playing" until we actually can) 2010-08-05 07:23:06 +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 8166af6d47 oss patch from Philippe Troin 2009-12-20 05:58:16 +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
Timothy C. McGrath f850815b8c Fix from raorn for broken compiling. 2007-05-31 14:22:54 +00:00
Bill Currie 6cfaa8a8c5 fix a missing dep (fixes parallel make) 2007-05-31 10:31:21 +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 425fed1a63 don't depend on libQFcd 2007-05-31 06:06:52 +00:00
Bill Currie ce2ba56c47 gcc 4.2 clean 2007-05-31 05:58:33 +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
Bill Currie cfb13eac71 behave properly when using jack but jackd isn't there 2007-05-21 11:20:36 +00:00
Bill Currie 01f7bd440e slightly cleaner 2007-05-08 10:49:54 +00:00
Bill Currie fd6a856ae1 clean out some old debug code that's confusing me 2007-05-08 09:33:24 +00:00
Bill Currie 3c78eaaa49 should fix hikaru's seg 2007-05-07 21:50:31 +00:00
Bill Currie 097be5a093 fix file handle leak 2007-05-07 14:03:36 +00:00
Bill Currie dd1adc0431 remove S_TouchSound: it doesn't seem to be necessary 2007-05-07 12:20:38 +00:00
Bill Currie 72daa2fd2b add some sounds to the menus (not yet finished) 2007-05-07 12:17:12 +00:00
Bill Currie 7af2378e03 turn on graph generation in the doxygen output. very slow, but the diagrams are worth it. Also make the data member of sfx_t a union rather than void so doxygen can see the relationships (and gets rid of a bunch of casts that I never liked anyway). 2007-05-07 05:20:24 +00:00
Bill Currie b5592b3e6e optionally treat tracks as playlists 2007-05-06 11:50:49 +00:00
Bill Currie 2ee461fc24 this seems to fix the sound cutouts. I /think/ this is the correct fix as cached sfxs are shared and thus nulling the buffer pointer isn't a particularly good idea for every release. 2007-05-06 08:35:28 +00:00
Bill Currie 93ee2e489b more vc2005 patches from phrosty 2007-04-11 22:03:36 +00:00
Bill Currie 323052bd2b survive across gamedir changes 2007-04-07 07:44:07 +00:00
Bill Currie ff132bb536 64bit windows patch from phrosty 2007-04-04 07:48:14 +00:00
Bill Currie 3cb9e089ef make -nocdaudio wor 2007-03-31 23:36:13 +00:00
Bill Currie 8d5b5fdf04 cleanup of channel stopping and fix cd_file's pause/resume 2007-03-27 06:15:57 +00:00
Bill Currie f2dc7bd02c Cleanup SND_StaticSound a bit. 2007-03-27 04:12:04 +00:00
Bill Currie 5d73a80887 use ch->sfx in one place only. doesn't really fix anything though. 2007-03-27 03:49:42 +00:00
Bill Currie 72a1aeb74b d'oh 2007-03-27 03:43:52 +00:00
Bill Currie e994e622b5 I'm getting pretty annoyed with this cache-release bug :P 2007-03-27 03:42:11 +00:00
Bill Currie 3bc7921a99 plug a potential channel leak 2007-03-27 00:50:08 +00:00
Bill Currie 522b069433 wow, wasn't thinking well with that one. fixes the seg with the default renderer 2007-03-27 00:49:20 +00:00
Bill Currie b987d5e887 mixer is a bit more reliable, but still getting cut-offs :( 2007-03-26 13:30:56 +00:00
Bill Currie 970408769f opps, that wasn't meant to go in 2007-03-26 11:49:54 +00:00
Bill Currie f2e524491d reduce a lot of duplicated code. should have done it this way in the first place. anyway, now I can get on with fixing the cut-off bug (I hope). 2007-03-26 11:44:52 +00:00
Bill Currie b93615940e remove some debug 2007-03-25 08:30:06 +00:00
Bill Currie 1d1982fddf more improvements to the sound offsetting 2007-03-25 08:12:43 +00:00
Bill Currie 2f7d686a3c make things a little quieter (less likely to clip) 2007-03-25 08:11:52 +00:00
Bill Currie f2d7630ac1 better sound offsetting 2007-03-25 07:45:13 +00:00
Bill Currie 33a7c395dc allow initially silent channels to be active incase they are later audible 2007-03-25 06:48:19 +00:00
Bill Currie 0a142265cc ensure silent channels get freed 2007-03-25 06:42:14 +00:00
Bill Currie 6678e67f05 clamp the default renderer to 44100 too, and spew messages when running out of channels. 2007-03-25 01:02:03 +00:00
Bill Currie cc6ec57772 fix a weird naming issue that caused uninitialized error (weird mostly because it snuck past me) 2007-03-24 11:46:41 +00:00
Bill Currie 984d42df3b fix an unitialized variable (won't fix the bug, though) 2007-03-24 11:11:19 +00:00
Bill Currie da1b11ff3b I'm tired of the cache bug, but it hides nicely behind gamedir changes, so I'll just leave it for now with a FIXME 2007-03-24 10:42:34 +00:00
Bill Currie 02c41feabc make gamedir change a two phase operation so things can be done both before and after the cache is flushed. (still having problems with cached sounds, though) 2007-03-24 10:13:10 +00:00
Bill Currie 54139a1742 don't try to release an sfx when the cache has been flushed: our held sfx gets ripped out from underneath us. 2007-03-24 08:37:04 +00:00
Bill Currie b8c11cc7ec bah, that line was needed after all. still don't know why (it shouldn't be) 2007-03-23 14:41:53 +00:00
Bill Currie 4ccb6675a6 fix the "Cache_Release: already released!" error 2007-03-23 12:33:04 +00:00
Bill Currie 81a57bb3fa patch from phrosty for vc2005 support. includes fixes for a bunch of gcc-isms that crept in over the years. 2007-03-22 23:20:57 +00:00
Bill Currie 9d165f317f fix lost channels (fixes both running out of channels and non-stop loops) 2007-03-22 08:27:54 +00:00
Bill Currie 04639c7ab8 remove some stuff I forgot about 2007-03-21 14:37:16 +00:00
Bill Currie 5a1c57fd87 better channel selection: don't bother. having problems with looped sounds that can't be stopped and getting the wrong sfx at times. 2007-03-21 12:56:43 +00:00
Bill Currie 62df1f2c31 fix some missing symbols 2007-03-21 12:50:41 +00:00
Bill Currie f0a4c4ace5 remove a bogus "done" and use 1 instead of 2 (holdover from a previous itteration of the code) 2007-03-21 11:41:34 +00:00
Bill Currie 7252ef1e54 allow the mixer to run even when sound blocked. prevents sounds piling up 2007-03-21 11:39:01 +00:00
Bill Currie 03e5ae136e print noisy reminder to fix resampler 2007-03-20 13:37:38 +00:00
Bill Currie 988898ca4a fix segfault when setting ambient_level to 0 2007-03-20 13:29:10 +00:00
Bill Currie e52940a3db add snd_force_unblock as an attempt to work around stuck sound on focus changes 2007-03-19 22:20:13 +00:00
Bill Currie 48e7b65f51 don't seg on shutdown when jackd wasn't there 2007-03-18 22:09:51 +00:00
Bill Currie 0f1cd876b2 cleaner sfx handling in dynamic sounds 2007-03-18 13:29:58 +00:00
Bill Currie d9b7ccd5e3 seems to fix going from start to e1m1 in nq 2007-03-18 13:07:20 +00:00
Bill Currie d67cbeae7f bring cd_file in line with the new sound api 2007-03-18 12:54:59 +00:00
Bill Currie 9baefa94bb write 0s to the buffer when sound is blocked 2007-03-18 11:58:54 +00:00
Bill Currie bbdca8428a channel leak plugged 2007-03-18 11:20:47 +00:00
Bill Currie 1315d4178f found the missing retain 2007-03-18 10:45:29 +00:00
Bill Currie 5a0e2460a3 whee, lockless channel management. still have a problem with unbalanced retain/release, though. 2007-03-18 10:32:01 +00:00
Bill Currie 7043dd14f9 forgot to do midi's stream_open 2007-03-18 01:51:37 +00:00
Bill Currie 44aaec4f22 make the cache/stream setup code common. 2007-03-18 01:44:46 +00:00
Bill Currie 8205ac4544 this should fix the asla seg 2007-03-18 01:15:57 +00:00
Bill Currie 3a6ab1ae38 enable blocking control (doesn't fix the thread problems, though) 2007-03-17 09:33:21 +00:00
Bill Currie ee12f44ff6 d'oh. anyway, with midi, sounds great (so long as jackd isn't suffering xruns) 2007-03-17 07:28:32 +00:00
Bill Currie b4cb4afdb0 oops, didn't have wildmidi installed, so this bitrotted a bit 2007-03-17 07:18:01 +00:00
Bill Currie 916a698ac5 it makes noise, but dies due to caching bugs 2007-03-17 07:05:24 +00:00
Bill Currie 9691afb782 connects to jack server and auto-wires the ports 2007-03-17 06:20:52 +00:00
Bill Currie 973cf9acce forgot to add these 2007-03-17 03:14:41 +00:00
Bill Currie cde6e60848 most of the hacking needed to break out the common code from snd_dma.c 2007-03-17 03:10:45 +00:00
Bill Currie 0105754f6f clean out some no-op functions 2007-03-10 14:17:52 +00:00
Bill Currie 99c0954b47 the big dso visibility patch :). Sure, we have to have unique names for static builds, but with controlled visibitly we should get faster program loads (although this isn't C++, so it's not as bad) and complex plugins are cleaner. 2007-03-10 12:00:59 +00:00
Bill Currie 58523becc7 oops 2007-03-10 07:30:12 +00:00
Bill Currie 17875bee39 move the handling of -nosound out of the plugin so it can control loading of the plugin 2007-03-10 07:22:32 +00:00
Bill Currie d8f6d8a5fb split out the resample code from the memory code 2007-03-10 06:38:24 +00:00
Bill Currie 81a5a90450 all static data now 2007-03-10 06:31:50 +00:00
Bill Currie b0543b9ca2 asm's been ditched for sound... 2007-03-10 06:17:09 +00:00
Bill Currie d4719db021 a bunch of docs for snd_render.h and a some cleanup of namepace and old cruft 2007-03-10 04:21:32 +00:00
Bill Currie 99e05d2188 warning cleanup patch from raorn 2007-01-06 21:31:03 +00:00
Bill Currie a2b2261913 this should fix a couple warnings found by raorn 2006-09-11 22:56:16 +00:00
Bill Currie 87cc09233c "long" audit. can't use long when we want 32 bits. May be a few more cases. 2005-10-23 13:19:21 +00:00
Bill Currie 6705140f76 can't adjust dmix's buffer size, so print a message when it seems it's
likely to be an issue
2005-08-12 02:39:37 +00:00
Bill Currie 3fb03fc2be hah, should have been using __attribute__((used)) all that time (rather
than __attribute__((unused))). fixes the missing console in -x11
2005-08-04 15:27:09 +00:00
Bill Currie 72e375d96a this should fix the snd_output_alsa0_9_PluginInfo undefined symbol issue 2005-06-19 05:30:54 +00:00
Bill Currie bcb45a7958 oops, messed up HAVE_VORBIS and HAVE_FLAC (cut&paste error:) 2005-06-19 05:24:19 +00:00
Bill Currie 9b7d8a9eca cached and 8 bit and/or mono flacs now work 2005-06-16 00:35:55 +00:00
Bill Currie d083fb4150 read the samples out of the buffer properly. fixes the horrible sounds :)
streamed flacs now work. cached not tested yet (haven't got any flacs that
small:)
2005-06-16 00:06:37 +00:00
Bill Currie a2f0cd94e8 fix gcc-4 warnings 2005-06-15 22:20:40 +00:00
Bill Currie 13e8b00da5 almost works. samples are mangled 2005-06-15 11:56:03 +00:00
Bill Currie 98f53c2c1c forgot to update the header 2005-06-15 10:06:55 +00:00
Bill Currie dff68bfed0 beginnings of flac support. compiles but untested. if this doesn't crash,
I'll be surprised :)
2005-06-15 10:02:50 +00:00
Bill Currie 2cc2da74ba fix the 0x0 dma buffer mis-reportage 2005-06-14 11:43:42 +00:00
Bill Currie 76305e7e6b attempt to fix choppy audio in alsa caused by non-power-of 2 buffer size 2005-06-14 05:37:26 +00:00
Bill Currie df91ce0275 automaticly select the best available sound output driver as default 2005-06-08 10:12:28 +00:00
Bill Currie 501180aaac gcc-4.0 fixes. even found some bugs :) (names /not/ mangled this time) 2005-06-08 06:35:48 +00:00
Bill Currie 9f0903e4ba wildcode and despair's automake 1.9 patch
This is an imperfect revision of history.
2004-11-18 06:08:00 +00:00
Bill Currie 201252c1c0 FIXME cleanup and a missed win32 compile fix
This is an imperfect revision of history.
2004-11-06 02:21:00 +00:00
Bill Currie c99a011f21 make sure sample length is never 0 2004-04-29 03:00:25 +00:00
Bill Currie c456eb1f80 fix a 64bit warning 2004-04-29 01:13:37 +00:00
Ragnvald Maartmann-Moe IV db1f68347b Fixes compilation with current GCC. Also a safety improvement (if macro should
use param more than once), taniwha tells me.
2004-03-21 04:59:02 +00:00
Ragnvald Maartmann-Moe IV d2a2ac036e Slightly ugly fix for an optimization bug. 2004-03-01 21:09:56 +00:00
Ragnvald Maartmann-Moe IV 08de21404f Space, the final frontier... 2004-03-01 11:51:34 +00:00
Ragnvald Maartmann-Moe IV 2342dfcd8f A couple of small optimizations. If you are exiting early, avoid some stuff
only needed later. And reduce worst-case number of if tests in a few places.
2004-03-01 11:51:01 +00:00