summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
Commit message (Collapse)AuthorAgeFilesLines
...
* thread-posix: Use pthread_(get|set)name_np() if availableDaniel Mack2011-04-231-0/+9
| | | | | Newer generations of libpthread have functions to set and get the thread names. If available, use them.
* pulsecore:: Define _POSIX_C_SOURCE locally for rtclock on OSXDaniel Mack2011-04-231-0/+4
| | | | | | Defining this macro on a global level is disadvantageous for other APIs, and as we need it for clock_gettime() only on Mac OS X, define it locally in pulsecore/core-rtclock.c only.
* memblockq: decode unset chunks as NULL chunks againLennart Poettering2011-04-213-1/+13
| | | | | This fixes asserts beeing hit when see requests are posted via the native protocol.
* volume: Get more data from volume testsArun Raghavan2011-04-184-57/+147
| | | | | | | This makes the volume tests run in two loops and print the minimum, maximum and standard deviation of readings from the inner loop. This makes it easier to reason out performance drops (i.e. algorithmic problems vs. other system issues such as processor contention).
* pa_poll(): Simplify detection of invalid fds in select() emulation modeDaniel Mack2011-04-181-2/+27
| | | | | | | | | | | | | For systems which have a fcntl() implementation, we can simplify the code which determines whether a file selector is valid in pa_poll(). The old code, which is harder to read and more expensive, stays around for all platforms we need to emulate poll() for using select(), and which don't provide fcntl(). IOW, for Windows. On Mac OS X, however, the detection for bad fds via more select() calls doesn't work, resulting in hung main loops, so the patch fixes a real bug there.
* sink-input: Check flat volume with pa_sink_flat_volume_enabled().Tanu Kaskinen2011-04-181-2/+2
| | | | | Checking just the flag doesn't work if the sink uses volume sharing, because such sinks never have PA_SINK_FLAT_VOLUME set.
* sink-input: Add volume_writable to pa_sink_input.Tanu Kaskinen2011-03-294-34/+14
| | | | | | | | | | This is pretty cosmetic change; there's no actual functionality added. Previously the volume_writable information was available through the pa_sink_input_is_volume_writable() function, but I find it cleaner to have a real variable. The sink input introspection variable name was also changed from read_only_volume to volume_writable for consistency.
* alsa-mixer: Get rid of a compiler warning.Tanu Kaskinen2011-03-282-8/+24
| | | | | | | | | | On 64-bit systems LONG_MAX is greater than the largest possible value of a uint32_t variable, which caused the compiler to warn about a comparison that is always false. On 32-bit systems pa_atou() can return a value that will overflow when assigned to e->volume_limit, which has type long, so the comparison was necessary. This dilemma is resolved by using pa_atol() instead of pa_atou().
* dbus: Do not refcnt the core.Colin Guthrie2011-03-251-3/+1
| | | | | | | We should not call pa_core_ref() anywhere in the code. Doing so will prevent proper daemon shutdown as the only call (in daemon/main.c) to pa_core_unref() should always call free_core() and perform a normal shutdown (i.e. unload all modules gracefully).
* Move compile-time checks around pa_run_from_build_tree to core-utilMaarten Bosmans2011-03-242-3/+5
| | | | To make the code cleaner and have the checks all in one place.
* Merge remote-tracking branch 'zonique/osx'Colin Guthrie2011-03-241-1/+37
|\
| * osx: add routines for real-time thread schedulingDaniel Mack2011-03-211-1/+37
| | | | | | | | | | Code sniplets are based on examples provided by Apple. See http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KernelProgramming/scheduler/scheduler.html
* | Get rid of some warnings: -Wunsafe-loop-optimizationsMaarten Bosmans2011-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | pulsecore/core-util.c: In function ‘pa_hexstr’: pulsecore/core-util.c:1858: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations] modules/alsa/alsa-mixer.c: In function ‘pa_alsa_decibel_fix_dump’: modules/alsa/alsa-mixer.c:3678: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations] modules/alsa/alsa-mixer.c: In function ‘pa_alsa_path_set_new’: modules/alsa/alsa-mixer.c:2640: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
* | Get rid of some warnings: -Wunused-resultMaarten Bosmans2011-03-202-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | modules/module-default-device-restore.c: In function ‘load’: modules/module-default-device-restore.c:67: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] modules/module-default-device-restore.c:88: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] pulsecore/authkey.c: In function ‘generate’: pulsecore/authkey.c:58: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result] pulsecore/core-util.c: In function ‘pa_make_secure_dir’: pulsecore/core-util.c:261: warning: ignoring return value of ‘fchown’, declared with attribute warn_unused_result [-Wunused-result]
* | Merge remote-tracking branch 'mkbosmans/mingw32-build'Colin Guthrie2011-03-2014-214/+114
|\ \ | |/ |/|
| * Fix pa_rtclock_from_wallclockMaarten Bosmans2011-03-191-10/+4
| | | | | | | | | | | | | | | | The HAVE_CLOCK_GETTIME macro protects timespec and related functions, nothing of which is used in pa_rtclock_from_wallclock. And silently just not converting was not the proper solution anyway. Also add an assert in pulse/mainloop.c to report the integer overflow that was triggered by the wrong pa_rtclock_from_wallclock. Without the assert, debugging was painful.
| * Use pulsecore/arpa-inet.h to make arpa/inet.h functionality availableMaarten Bosmans2011-03-1910-124/+59
| | | | | | | | Automatically use replacement function on platforms (win32) where not all arpa/inet.h is available natively.
| * Find modules and config files relative to the installed libraries.Maarten Bosmans2011-03-193-80/+51
| | | | | | | | Do not use replace %PULSE_ROOT% from the environment.
* | log: Add a new log target to a file descriptorVincent Becker2011-03-182-0/+32
| | | | | | | | | | | | | | This patch enables logging of text debug messages (pa_log feature) into a file or a device driver. Example : pulseaudio --log-target=file:./mylog.txt (Minor tweaks by Colin + Arun)
* | Make pulse compile with clangMaarten Bosmans2011-03-181-2/+2
| | | | | | | | | | | | | | | | | | This fixes the checking of supported compiler flags and the following error message for svolume_mmx: pulsecore/svolume_mmx.c:157:76: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions : "+r" (samples), "+r" (volumes), "+r" (length), "=D" ((pa_reg_x86)channel), "=&r" (temp) ~~~~~~~~~~~~^~~~~~~
* | Fix up some double spacesMaarten Bosmans2011-03-1812-38/+38
| |
* | Fixup #include directives according to Coding StyleMaarten Bosmans2011-03-1111-17/+15
| | | | | | | | | | Use #include "header.h" if functionality of header.h is implemented and #include <header.h> if functionality of header.h is used.
* | Fix up according to Coding StyleMaarten Bosmans2011-03-1131-268/+209
| | | | | | | | Only whitespace changes in here
* | volume: Add Orc-based optimised volume scalingArun Raghavan2011-03-054-0/+272
| | | | | | | | | | | | | | | | | | This adds volume scaling for 1- and 2-channel software volume scaling using Orc. While testing the MMX and SSE backends on a Core2, I see an ~2x performance benefit over the hand-rolled MMX and SSE code. Since I haven't been able to test on other architectures, the Orc code is only used when MMX/SSE* is present. This can be changed in the future after testing on AMD and ARM machines.
* | volume: Fix sample array size for testsArun Raghavan2011-03-053-3/+3
| | | | | | | | | | | | Somewhere in the history of the MMX tests, the number of channels was changed from 1 to 2, but the number of samples was not increased to make it even (multiple of the frame size).
* | volume: Make tests use only valid volumesArun Raghavan2011-03-053-3/+3
| |
* | Various fixes for build warningsMaarten Bosmans2011-03-021-2/+2
| |
* | Get rid of some unused-function compiler warningsMaarten Bosmans2011-03-023-1/+7
| |
* | Include <time.h> where necessaryMaarten Bosmans2011-03-012-0/+2
| |
* | Revert "Add new subsystem for applying envelopes (such as volume ramps) to ↵Arun Raghavan2011-02-282-839/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | audio signals" This reverts commit 95a98fe6f2002c9dd448b70bb6944541b5616df3. Conflicts: src/Makefile.am src/pulsecore/envelope.c src/pulsecore/envelope.h src/tests/envelope-test.c (part of a patch series removing all ramping code)
* | Revert "Add volume ramping feature - envelop fix"Arun Raghavan2011-02-282-271/+65
| | | | | | | | | | | | | | | | | | | | This reverts commit 8eaa40b6f4cae749610770c85ba500f326d59b50. Conflicts: src/pulsecore/envelope.c (part of a patch series removing all ramping code)
* | Revert "Add volume ramping feature - sink-input modification"Arun Raghavan2011-02-282-330/+81
| | | | | | | | | | | | | | | | | | | | This reverts commit 5318eb35ef3f91836084382a4f3d5ef08d322554. Conflicts: src/pulsecore/sink-input.c (part of a patch series removing all ramping code)
* | Revert "Add volume ramping feature - sink modification"Arun Raghavan2011-02-281-6/+1
| | | | | | | | | | | | | | | | | | | | This reverts commit 897ef86b7fbb87ef17d30c584e6cd93abfc342bc. Conflicts: src/pulsecore/sink.c (part of a patch series removing all ramping code)
* | Revert "ramping: minor cleanups"Arun Raghavan2011-02-281-10/+2
| | | | | | | | | | | | This reverts commit f202af17b717f5b383ac072f80a6c1327bc3143b. (part of a patch series removing all ramping code)
* | Revert "core: volume ramping fix"Arun Raghavan2011-02-281-1/+1
| | | | | | | | | | | | This reverts commit aa9348441db34b787784711f19882d6c42fa315d. (part of a patch series removing all ramping code)
* | sink: Add casts to some printf arguments to get rid of compiler warnings.Tanu Kaskinen2011-02-281-5/+6
| |
* | sink: Don't send unnecessary PA_SINK_MESSAGE_SET_SHARED_VOLUME messages.Tanu Kaskinen2011-02-281-2/+0
| | | | | | | | If send_msg is false, the message will be sent by the caller.
* | virtual-sink: Fix a crash when moving the sink to a new master right after ↵Tanu Kaskinen2011-02-261-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setup. If the virtual sink is moved to a new master right after it has been created, then the virtual sink input's memblockq can be rewound to a negative read index. The data written prior to the move starts from index zero, so after the rewind there's a bit of silence. If the memblockq doesn't have a silence memchunk set, then pa_memblockq_peek() will return zero in such case, and the returned memchunk's memblock pointer will be NULL. That scenario wasn't taken into account in the implementation of sink_input_pop_cb. Setting a silence memchunk for the memblockq solves this problem, because pa_memblock_peek() will now return a valid memblock if the read index happens to point to a hole in the memblockq. I believe this isn't the best possible solution, though. It doesn't really make sense to rewind the sink input's memblockq beyond index 0 in the first place, because now when the stream starts to play to the new master sink, there's some unnecessary silence before the actual data starts. This is a small problem, though, and I don't grok the rewinding system well enough to know how to fix this issue properly. I went through all files that call pa_memblockq_peek() to see if there are more similar bugs. play-memblockq.c was the only one that looked to me like it might be broken in the same way. I didn't try reproducing the bug with play-memblockq.c, though, so I just added a FIXME comment there.
* | Implement the "volume sharing" feature.Tanu Kaskinen2011-02-264-185/+580
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we have a filter sink that does some processing, currently the benefits of the flat volume feature are not really available. That's because if you have a music player that is connected to the filter sink, the hardware sink doesn't have any idea of the music player's stream volume. This problem is solved by this "volume sharing" feature. The volume sharing feature works so that the filter sinks that want to avoid the previously described problem declare that they don't want to have independent volume, but they follow the master sink volume instead. The PA_SINK_SHARE_VOLUME_WITH_MASTER sink flag is used for that declaration. Then the volume logic is changed so that the hardware sink calculates its real volume using also the streams connected to the filter sink in addition to the streams that are connected directly to the hardware sink. Basically we're trying to create an illusion that from volume point of view all streams are connected directly to the hardware sink. For that illusion to work, the volumes of the filter sinks and their virtual streams have to be managed carefully according to a set of rules: If a filter sink follows the hardware sink volume, then the filter sink's * reference_volume always equals the hw sink's reference_volume * real_volume always equals the hw sink's real_volume * soft_volume is always 0dB (ie. no soft volume) If a filter sink doesn't follow the hardware sink volume, then the filter sink's * reference_volume can be whatever (completely independent from the hw sink) * real_volume always equals reference_volume * soft_volume always equals real_volume (and reference_volume) If a filter sink follows the hardware sink volume, and the hardware sink supports flat volume, then the filter sink's virtual stream's * volume always equals the hw sink's real_volume * reference_ratio is calculated normally from the stream volume and the hw sink's reference_volume * real_ratio always equals 0dB (follows from the first point) * soft_volume always equals volume_factor (follows from the previous point) If a filter sink follows the hardware sink volume, and the hardware sink doesn't support flat volume, then the filter sink's virtual stream's * volume is always 0dB * reference_ratio is always 0dB * real_ratio is always 0dB * soft_volume always equals volume_factor If a filter sink doesn't follow the hardware sink volume, then the filter sink's virtual stream is handled as a regular stream. Since the volumes of the virtual streams are controlled by a set of rules, the user is not allowed to change the virtual streams' volumes. It would probably also make sense to forbid changing the filter sinks' volume, but that's not strictly necessary, and currently changing a filter sink's volume changes actually the hardware sink's volume, and from there it propagates to all filter sinks ("funny" effects are expected when adjusting a single channel in cases where all sinks don't have the same channel maps). This patch is based on the work of Marc-André Lureau, who did the initial implementation for Pulseaudio 0.9.15.
* | core: Add a new hook PA_CORE_HOOK_CARD_PROFILE_CHANGEDColin Guthrie2011-02-252-0/+3
| | | | | | | | | | | | This will allow modules to know when a card profile has changed and take appropriate action. This might prove useful when developing UCM so that the appropriate verb can be set.
* | core: Added new hooks: PA_CORE_HOOK_SOURCE_PORT_CHANGED and ↵Kim Therkelsen2011-02-253-0/+6
| | | | | | | | | | | | | | | | | | | | | | PA_CORE_HOOK_SINK_PORT_CHANGED This allows modules to know when certain ports are changed. This will allow e.g. a filter module (or LADSAP) to only load when a certain port is used on the device (e.g. to only filter headphones and not normal speakers). (Comment from Colin Guthrie: This may also have use in UCM)
* | Merge remote-tracking branch 'mkbosmans/mingw32-build'Colin Guthrie2011-02-2537-123/+270
|\|
| * Use pa_read, pa_write and pa_poll instead of system functionsMaarten Bosmans2011-02-172-12/+12
| |
| * Use pa_* instead of generic functions to improve portabilityMaarten Bosmans2011-02-172-2/+6
| |
| * win32: Implement pa_randomMaarten Bosmans2011-02-171-1/+16
| |
| * win32: Implement rtclock based on QueryPerformanceCounterMaarten Bosmans2011-02-175-6/+30
| | | | | | | | Also remove some unnecessary <time.h> headers.
| * win32: flush stderr after log outputMaarten Bosmans2011-02-171-0/+3
| |
| * Implement some functions for win32Maarten Bosmans2011-02-172-10/+54
| | | | | | | | And disable building binaries for win32 that make no sense there
| * Repair some typosMaarten Bosmans2011-02-173-6/+6
| |
| * Fix dependencies and include necessary headersMaarten Bosmans2011-02-176-1/+6
| |