Commit graph

948 commits

Author SHA1 Message Date
Lennart Poettering
8a2a6b2004 adjust various data/library paths automatically if we are run from a build tree 2009-08-21 03:43:53 +02:00
Lennart Poettering
9f97b7cbe1 sink-input: add callbacks that are called whenever the mute/volume changes 2009-08-21 02:56:17 +02:00
Wim Taymans
6076cef209 remap: make the MMX code pretier 2009-08-20 20:00:50 +02:00
Wim Taymans
6e5dbed51e remap: add MMX mono to stereo 2009-08-20 19:46:06 +02:00
Wim Taymans
e961efc130 remap: init the do_remap function to NULL 2009-08-20 18:32:51 +02:00
Wim Taymans
28baa53d55 remap: allow specialisations to install NULL
Fallback to the default C implementation when the remap init function did not
set a function.
2009-08-20 18:29:02 +02:00
Wim Taymans
ac1f2e0a2e remap: move remapping code in separate file
Move the remapping code into a separate file. Have functions to install custom
init functions that can install optimized versions, when they want.
2009-08-20 18:23:42 +02:00
Wim Taymans
a3f4a4f6ba resamples; refactor the channel remapping bits
Move the channel remapping bits into a separate structure. We'll make this
structure global so that optimized versions can use it to perform the channel
remapping.
2009-08-20 17:54:45 +02:00
Wim Taymans
05fef5f551 sconv: allow for setting custom functions
Add methods to override the default conversion functions.
2009-08-20 15:50:02 +02:00
Wim Taymans
f8ffe0dabc svolume: cleanups
Use PA_MAX
Use pa_rtclock_now() for benchmarks
2009-08-20 12:30:48 +02:00
Wim Taymans
f09b51198f whitespace fixes 2009-08-20 11:31:04 +02:00
Wim Taymans
3cc1278dcf resampler: avoid some multiplies when we can 2009-08-20 11:31:04 +02:00
Wim Taymans
aeae567f88 svolume: add comment 2009-08-20 11:31:04 +02:00
Wim Taymans
8aa86f5247 arm: implement ARM cpu detection 2009-08-20 11:31:04 +02:00
Wim Taymans
078bde1b49 x86: keep the cpu flags local 2009-08-20 11:31:04 +02:00
Wim Taymans
370016c0e7 svolume: fix compilation in 32bits 2009-08-20 11:31:04 +02:00
Wim Taymans
548b735ccf resampler: fix identity check
Fix the identity matrix check for mono to stereo.
Help the compiler generate better code for the C implementation of the channel
remapping code.
2009-08-20 11:31:04 +02:00
Wim Taymans
d04a6e935f resample: fix counters 2009-08-20 11:31:04 +02:00
Wim Taymans
b4e9942c2f resample: refactor the channel remapping a little
Factor out the channel remap matrix code into a separate function.
Keep a pointer to the channel remapping function so we can install custom
functions.
Catch the common mono->stereo remapping case and install a custom, more
optimized function.
2009-08-20 11:31:04 +02:00
Wim Taymans
bd49d43bd3 svolume: add CPU guards around code
Mark code that should only be compiled on x86 CPUs with proper defines.
2009-08-20 11:31:03 +02:00
Wim Taymans
951bf1b28d svolume: add ARM optimized volume scaling 2009-08-20 11:31:03 +02:00
Wim Taymans
a98fa950d2 svolume: remove unneeded compare
We don't need the compare because the sub operation already set the right flags
for us.
2009-08-20 11:31:03 +02:00
Wim Taymans
601e5f1867 resampler: cache integer channel_map
Calculate and cache an integer version of the channel map so that we don't have
to regenerate it when dealing with s16 samples.
2009-08-20 11:31:03 +02:00
Wim Taymans
25724cdd40 Get rid of liboil
Get rid of the liboil dependency and reimplement the liboil functions with an
equivalent C implementation. Note that most of these functions are deprecated in
liboil and that none of them had  any optimisations. We can further specialize
our handrolled versions for some extra speedups.
2009-08-20 11:31:03 +02:00
Wim Taymans
591baacba5 volume: remove ref functions 2009-08-20 11:31:03 +02:00
Wim Taymans
f24c24c14b volume: improved comments 2009-08-20 11:31:03 +02:00
Wim Taymans
a1235446a7 volume: make the benchmark more meaningfull
MMX is about 6x faster, SSE around 15x on my machine.
2009-08-20 11:31:03 +02:00
Wim Taymans
dcae9a3113 svolume: add some comments 2009-08-20 11:31:03 +02:00
Wim Taymans
e396fe67fb cpu-x86: guard header with ifdef 2009-08-20 11:31:03 +02:00
Wim Taymans
563cb2dea9 main: hook up cpu detection code
Add CPU detection code to activate the various optimisations.
Move some method definitions around.
Use compatibility macros when we can.
2009-08-20 11:31:03 +02:00
Wim Taymans
a83f5524fb cpu-x86: add cpu detection code and helpers
Add CPU detection code and various macros and typdefs to make it easier to write
64 and 32 bit code.
2009-08-20 11:31:02 +02:00
Wim Taymans
5998cf99b0 svolume: improve SSE and MMX code 2009-08-20 11:31:02 +02:00
Wim Taymans
7086784573 volume_sse: add sse optimisations 2009-08-20 11:31:02 +02:00
Wim Taymans
08f3e16c84 volume_mmx: fix mmx code a bit 2009-08-20 11:31:02 +02:00
Wim Taymans
3a0b012ee0 volume: add first mmx optimized function
Add code for an mmx optimized version of s16ne volume scaling. Install the
custom function.
2009-08-20 11:31:02 +02:00
Wim Taymans
2d73f13567 samples-util: add padding to volume array
Pad the volume array with a copy of the start. We'll need this later to be able
to write optimized functions.
2009-08-20 11:30:55 +02:00
Wim Taymans
3d008961c0 sample-util: move volume code to separate file
Move the volume code into a separate file with the reference C implementations.
Add a function to retrieve the volume function and one to install a new one.
2009-08-20 11:29:48 +02:00
Wim Taymans
e71e644eb6 sample-util: move some functions around
Move some stuff around before splitting it into a separate file.
2009-08-20 11:29:47 +02:00
Wim Taymans
5b8b6544e2 sample-utils: coding style cleanup
Make the coding style match the rest of pulseaudio more.
Remove some liboil functions, they seem unoptimized and likely slower than our
handrolled versions here.
2009-08-20 11:29:47 +02:00
Wim Taymans
26839c4b9e sample-utils: split out functions from case
Move the volume functions out of the switch case and use a table indexed by the
sample format to find the volume function.
2009-08-20 11:29:47 +02:00
Lennart Poettering
c5bd72509e core: check return value of getgrnam_r() instead of errno
According to POSIX getgrnam_r() returns the error code as return value,
and not in errno. Honour that.

Pointed out and inspired by a patch from Ted Percival.
2009-08-20 00:20:03 +02:00
Lennart Poettering
8c31974f56 sink: volume handling rework, new flat volume logic
- We now implement a logic where the sink maintains two distinct
  volumes: the 'reference' volume which is shown to the users, and the
  'real' volume, which is configured to the hardware. The latter is
  configured to the max of all streams. Volume changes on sinks are
  propagated back to the streams proportional to the reference volume
  change. Volume changes on sink inputs are forwarded to the sink by
  'pushing' the volume if necessary.

  This renames the old 'virtual_volume' to 'real_volume'. The
  'reference_volume' is now the one exposed to users.

  By this logic the sink volume visible to the user, will always be the
  "upper" boundary for everything that is played. Saved/restored stream
  volumes are measured relative to this boundary, the factor here is
  always < 1.0.

- introduce accuracy for sink volumes, similar to the accuracy we
  already have for source volumes.

- other cleanups.
2009-08-19 02:55:02 +02:00
Lennart Poettering
24e582808c source: rework volume handling
- drop the 'virtual_' prefix from s->virtual_volume since we don't
  distuingish between reference and real volumes for sources

- introduce an accuracy for source volumes: if the hardware can control
  the volume "close enough" don't necessarily adjust the rest in
  software unless it is beyond a certain threshold. This should save a
  little bit of CPU at the expensive of a bit of accuracy in volume
  handling.

- other minor cleanups
2009-08-19 01:35:43 +02:00
Lennart Poettering
2838b78e59 macro: extend comments a bit 2009-08-19 01:03:09 +02:00
Lennart Poettering
8f928b2e57 macro: simplify page/word alignment macros a bit 2009-08-17 19:17:10 +02:00
Lennart Poettering
fe3a21f6a5 macro: add PA_ROUND_UP/PA_ROUND_DOWN macros 2009-08-17 19:15:33 +02:00
Lennart Poettering
01e4b61a91 aupdate: implicitly call _write_swap() if it wasn't called explicitly 2009-08-16 02:02:51 +02:00
Lennart Poettering
8dd0d871a7 core: add to FIXMEs 2009-08-16 00:45:56 +02:00
Lennart Poettering
4c29ba9c33 modules: add various checks to avoid selecting objects that are not linked or in another unclear state 2009-08-16 00:45:23 +02:00
Lennart Poettering
011add1c83 thread-mq: do final q flush only when we aren't dispatching anyway 2009-08-15 22:23:42 +02:00