Commit Graph
2187 Commits
Author SHA1 Message Date
JH Laird ceb2fbcd68 Merge pull request #139 from toofishes/math
hairtunes: math and dithering optimisations
2012-02-25 23:00:48 -08:00
Dan McGee db8b181038 hairtunes: implement a simple LCG-based RNG for dithering
We are calling out to libc's rand() function, which has significant
overhead, especially since we are calling it 88200 times per second
(2 channels * 44100 samples).

Implement a very simple linear congruential generator in our code that
is plenty good enough for dithering purposes, and small enough for the
compiler to optimize and inline.
2012-02-25 13:57:46 -06:00
Dan McGee fa95439b98 hairtunes: simplify and reorganize some floating point operations
The math operations are all equivalent, but are simplified a bit for the
benefit of processors with slower floating point performance.

* Don't use float casts when we need to eventually convert to double
  precision anyway.
* Use multiplication instead of division when possible.
2012-02-25 13:55:38 -06:00
Albert Zeyer f12f7a753b Merge pull request #138 from toofishes/cleanup
Cleanup, optimization, and bug fixes
2012-02-24 14:59:44 -08:00
Dan McGee b5a91cbebd Tabs to spaces conversion 2012-02-24 16:15:21 -06:00
Dan McGee 59d26d3a7c Use static where appropriate in shairport.c
Most functions don't need to be public outside of this file, so move all
the forward declarations out of shairport.h.
2012-02-24 16:14:43 -06:00
Dan McGee 435a866816 Add static to some functions in alac.c 2012-02-24 16:02:47 -06:00
Dan McGee 0b4c7ad4be hairplay: various small code cleanups 2012-02-24 15:53:30 -06:00
Dan McGee cd957048cb Use the audio buffer mutex appropriately
We need to use this any time we write to or access any of the
audio-buffer related variables. This also removes the need to use
'volatile', which cripples the compiler optimizations.
2012-02-24 15:53:28 -06:00
Dan McGee 8b1728d946 Use a pthread mutex around the volume settings
Using the `volatile` qualifier in multithreading code is never the right
answer. Mutexes should be used as was attempted with the audio buffer
code. Here, we implement a new mutex for the volume and fix_volume
globals, and grab a lock on it when necessary, which is for both reads
and writes.
2012-02-24 15:52:54 -06:00
Dan McGee 0a446a421d Return the correct value from biquad_filt()
If you turned set `debug = 1` in hairtunes, you'd quickly get a mess of
debug messages that showed bf_est_drift in bf_est_update() going quicky
out of range toward a float NaN value (usually negative). Clearly the
presence of this `out` variable in biquad_filt was meant to be used, not
marked as unused.
2012-02-24 15:52:54 -06:00
Dan McGee 74ed9c6fa2 hairtunes: use static keyword appropriately
This allows the compiler to do a much better job on this file, as it
currently can't inline most of the functions because they are
technically visible outside the file. Mark most functions and variables
static to let the compiler work.
2012-02-24 15:52:53 -06:00
Dan McGee 565b223bb0 Don't require extern usage of frame buffering value
This makes things a bit cleaner and easier to grasp.
2012-02-24 14:33:05 -06:00
Dan McGee 82e7cf8490 Fix dependency issue in Makefile
Make the dependency and compile command match in the resources used.
2012-02-24 14:24:10 -06:00
B. van BerkumandDan McGee be145fa704 Removed typo in Makefile 2012-02-24 14:20:06 -06:00
Stef SimoensandDan McGee d9964383e6 Improve resending of frames (and avoid missed frames)
- when requesting a packet, do not request an already received packet
- move the last-chance resend to buffer_get_frame
- check more often for missing frames
  own checks show that some frames need to be requested up to 4 times
  on bad connections
2012-02-24 14:18:52 -06:00
Dan McGee 7fcfd3ddac Small socketlib static and return value tweaks 2012-02-24 14:17:30 -06:00
Dan McGee f5e7e87c51 Remove dead code in alac.c 2012-02-24 14:13:23 -06:00
Albert Zeyer d2b2a34311 Merge pull request #135 from alenichev/master
Fix compilation error
2012-01-12 07:26:36 -08:00
Dmitry Alenichev 0d0299dcfa OpenBSD installation instructions 2012-01-12 11:59:43 +04:00
Dmitry Alenichev 58f307eab4 fix gentoo & openbsd compilation errors 2012-01-11 19:57:41 +04:00
JH Laird 4172b696e0 Merge pull request #123 from juhovh/master
RSA and AES cleanup
2012-01-08 15:22:12 -08:00
James Laird 6ce7675820 Reap child processes in shairport.c 2012-01-09 10:18:17 +11:00
Juho Vähä-Herttua 0fdae6f521 Cleanup the AES decryption code a bit 2011-11-10 15:50:51 +02:00
Albert Zeyer 83c1b71645 install.md: debian/ubuntu also needs build-essential 2011-11-10 00:36:48 +01:00
Juho Vähä-Herttua 2b8602bdc0 Remove trash bytes from the RSA private key 2011-10-30 16:13:52 +02:00
Albert Zeyer 2d8f4aff7e Merge pull request #120 from stefdude/master
1 x bugfix, 1 x improvement, 1 x new feature
2011-10-10 04:26:22 -07:00
Stef Simoens 9796ac354c new feature: run program on first connection / run program on last
disconnection

I was looking to trigger an action when I connect to shairport.
Basically, I want to switch on the stereo when I start playing music
over shairport (and I want to switch if off when I stop streaming).

Because my set-up will be different than any other set-up, I thought
about making it generic.

Two new command-line options --play_prog and --stop_prog take one
argument: the command line to start when the first connection is made or
when the last connection quits.

Example:
$ shairport.pl --play_prog="amixer set PCM 100%"
2011-10-10 09:26:43 +02:00
Stef Simoens 800453f62b Send "last-chance retry" only once
The last-chance resend was sometimes fired up to 6 times (probably while
receiving multiple new packets while playing the same buffer-data).

The following patch corrects this: only one retry is sent out.
For this to happen, I change abuf->ready to -1 ("1 retry sent out") and
by changing the other comparisons of abuf->ready to != 1.

Probably, this could be improved, by implementing a first check at t-30,
t-20, t-10, ...
2011-10-10 09:23:19 +02:00
Stef Simoens 62607b2b5e BUFFER_FRAMES needs to be a power of 2 because of the way BUFIDX(seqno) works 2011-10-10 09:16:20 +02:00
Albert Zeyer ca6dcc7406 hw_addr from apname 2011-10-06 14:48:47 +02:00
abrasive d6b1c0a82d Remove random hardware ID.
This means you can't run multiple shairports under the same name,
barring a portable way to get the real interface ID.
2011-10-06 12:38:46 +11:00
Albert Zeyer d345b02215 Merge pull request #114 from symm/master
Fixed an issue with the init script
2011-09-17 10:07:47 -07:00
Gareth Jones 3e6cc0e45f Fixed an issue with init script stop action.
Unable to stop the daemon because a pid file was not being created.
2011-09-17 17:08:22 +01:00
Albert Zeyer 9583d83824 Merge pull request #112 from doubledrones/master
Gentoo installation HOWTO
2011-09-06 10:12:26 -07:00
Marcin Nowicki 5af8fe8a42 Add Gentoo/Funtoo installation howto. 2011-09-06 16:45:54 +02:00
Albert Zeyer 346db95445 Merge pull request #108 from lgarron/master
Small Mac commenting fixes to INSTALL.md
2011-08-11 03:07:28 -07:00
Lucas Garron bf81943a86 Perl installations seemed to require sudo for me. 2011-08-11 03:03:47 -04:00
Lucas Garron 36fb64d174 Added more # comment delimiters to the Mac instructions (to make copy-pasting safer/easier). 2011-08-11 02:58:57 -04:00
Albert Zeyer e633ccb8c8 Merge pull request #105 from sbleon/master
Install documentation fix for recent Debian/Ubuntu releases.
2011-08-02 19:42:31 -07:00
sbleon 7646a02a70 Removed libao2 package from Debian/Ubuntu package install list since the package name varies on different releases. The proper version will always be installed because libao-dev depends on it. 2011-08-02 21:13:54 -03:00
Albert Zeyer 4b0f579bd3 Merge pull request #104 from propaganda23/master
Perl strict mode error
2011-07-21 15:51:02 -07:00
Jan Ortgies 94007b71e5 Fix global symbol error (perl strict mode) 2011-07-21 19:53:03 +02:00
Albert Zeyer 8a0fda207a Merge pull request #103 from meurkens/master
Fix for https://github.com/albertz/shairport/issues/101
2011-07-21 05:53:15 -07:00
Stijn Meurkens ac66238fd7 Fixing password-problem on iOS 2011-07-21 14:41:13 +02:00
Albert Zeyer 8435f6af7b Merge pull request #98 from yuvalt/master
ipv6 was broken again...
2011-06-17 02:15:58 -07:00
Yuval Tal 33a8091ed7 byte order was wrong for ipv4 address on top of ipv6 2011-06-14 09:52:39 +03:00
Albert Zeyer 587f217967 Merge pull request #96 from kayahr/port
Added port option.
2011-06-05 03:20:00 -07:00
Klaus Reimer 565d2819b4 Added port option. 2011-06-05 11:56:50 +02:00
Albert Zeyer 6867754f33 Merge pull request #94 from Jonty/master
Documentation fix for Debian install
2011-06-01 15:11:54 -07:00