Commit graph

1652 commits

Author SHA1 Message Date
Lennart Poettering
59835d955b explain why a rewind was requested
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2357 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-03 01:36:05 +00:00
Lennart Poettering
82caf5a886 when rewinding after the end of an underrun, make sure to rewind as much as we can, so that we deal properly with changed latencies of the sink
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2356 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-03 01:34:45 +00:00
Lennart Poettering
3167e0f999 follow _unlink() changes from sink-input
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2355 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-03 01:33:33 +00:00
Lennart Poettering
d2da344fee send PA_SINK_MESSAGE_REMOVE_INPUT only when an asyncmsgq is available, reset resampler only when we really need to
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2354 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-03 01:32:57 +00:00
Lennart Poettering
d2be471ed2 make sure to call sink->update_requested_latency() always when we change latency, same for source
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2353 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-03 01:31:39 +00:00
Lennart Poettering
59a7467a64 don't require a module name when resolving a dl symbol
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2352 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-03 01:30:40 +00:00
Tanu Kaskinen
ff09fa391a Fix typo: "now"->"not".
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2351 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-02 13:12:51 +00:00
Tanu Kaskinen
43a30a2ff1 Fix setrlimit() return value comparsion.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2350 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-02 13:08:15 +00:00
Lennart Poettering
bb4f83b901 only send PA_SINK_MESSAGE_SET_STATE if there's still an asyncmsqg around to do so
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2347 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-02 01:26:10 +00:00
Lennart Poettering
bfb2691fac a few modernizations
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2346 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-02 01:25:22 +00:00
Lennart Poettering
06b9140e10 reorderer a few things
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2345 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-02 01:24:47 +00:00
Lennart Poettering
792ef5c244 fix a compiler warning
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2344 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-02 01:24:01 +00:00
Lennart Poettering
775bc6c108 some modernizations
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2343 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-02 01:23:32 +00:00
Lennart Poettering
7d6269e57a add multiarch paths to default LADSPA search path
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2342 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-02 01:21:22 +00:00
Lennart Poettering
49b1b15ef0 don't enable prebuffering if we just call is_readable()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2341 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-02 01:20:46 +00:00
Lennart Poettering
52e3628c3e Yes, yet another evil all-in-one commit of intervowen changes. I suck.
* Drop "state" directory, fold that into "runtime directory"
* No longer automatically rewind when a new stream connects
* Rework sound file stream, to cause a rewind on initialisation, shorten _pop() code a bit
* Fix reference counting of pa_socket_server in the protocol implementations
* Rework daemon initialization code to be compatible with non-SUID-root setups where RLIMIT_RTPRIO is non-zero
* Print warning if RT/HP is enabled in the config, but due to missing caps, rlimits, policy we cannot enable it.
* Fix potential memory leak in pa_open_config_file()
* Add pa_find_config_file() which works much like pa_open_config_file() but doesn't actually open the config file in question. Just searches for it.
* Add portable pa_is_path_absolute()
* Add pa_close_all() and use it on daemon startup to close leaking file descriptors (inspired from what I did for libdaemon)
* Add pa_unblock_sigs() and use it on daemon startup to unblock all signals (inspired from libdaemon, too)
* Add pa_reset_sigs() and use it on daemon startup to reset all signal handlers (inspired from libdaemon as well)
* Implement pa_set_env()
* Define RLIMIT_RTTIME and friends if not defined by glibc
* Add pa_strempty()
* rename state testing macros to include _IS_, to make clearer that they are no states, but testing macros
* Implement pa_source_output_set_requested_latency_within_thread() to be able to forward latency info to sources from within the IO thread
* Similar for sink inputs
* generelize since_underrun counter in sink inputs to "playing_for" and "underrun_for". Use only this for ignore potential rewind requests over underruns
* Add new native protocol message PLAYBACK_STREAM_MESSAGE_STARTED for notification about the end of an underrun
* Port native protocol to use underrun_for/playing_for which is maintained by the sink input anyway
* Pass underrun_for/playing_for in timing info to client
* Drop pa_sink_skip() since it breaks underrun detection code
* Move PID file and unix sockets to the runtime dir (i.e. ~/.pulse). This fixes a potention DoS attack from other users stealing dirs in /tmp from us so that we cannot take them anymore)
* Allow setting of more resource limits from the config file. Set RTTIME by default
* Streamline daemon startup code
* Rework algorithm to find default configuration files
* If run in system mode use "system.pa" instead of "default.pa" as default script file
* Change ladspa sink to use pa_clamp_samples() for clamping samples
* Teach module-null-sink how to deal with rewinding
* Try to support ALSA devices with no implicit channel map. Synthesize one by padding with PA_CHANNEL_POSITION_AUX channels. This is not tested since I lack hardware with these problems.
* Make use of time smoother in the client libraries.
* Add new pa_stream_is_corked() and pa_stream_set_started_callback() functions to public API
* Since our native socket moved, add some code for finding sockets created by old versions of PA. This should ease upgrades


git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2329 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 19:51:05 +00:00
Lennart Poettering
f94fae3da3 move unlinking code to operation_unlink()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2328 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 19:26:41 +00:00
Lennart Poettering
f3cc178b92 some minor updates
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2327 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 19:25:24 +00:00
Lennart Poettering
11559a6386 parse boolean parameters as boolean instead of int wherever applicable. add new function pa_cli_command_execute_file_stream()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2326 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 19:24:09 +00:00
Lennart Poettering
414f1d956f install gccmacro.h properly, drop unused core-def.h file
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2325 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 19:22:35 +00:00
Lennart Poettering
d7cc1f5a12 change pa_rtpoll_set_timer_absolute() to take a pa_usec_t instead of struct timeval
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2324 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 19:17:52 +00:00
Lennart Poettering
5816871117 save and restore errno in log functions
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2323 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 19:16:55 +00:00
Lennart Poettering
b93ea1840c minor reformat
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2322 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 19:16:25 +00:00
Lennart Poettering
4f99c431d0 check for $PULSE_INTERNAL before enabling padsp
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2321 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 19:15:49 +00:00
Lennart Poettering
18ad6f845e don't allow overwriting of callback pointers when we're already dead
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2320 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 19:15:08 +00:00
Lennart Poettering
b70edf77da port pa_sample_clamp() to liboil
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2319 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 19:13:53 +00:00
Lennart Poettering
9dd8f6ceb7 add new function pa_sample_clamp()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2318 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 19:09:03 +00:00
Lennart Poettering
264385aae4 strip CRLF line breaks from read CLI commands. This should fix the cli interface for people accessing it via telnet.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2317 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 19:06:15 +00:00
Lennart Poettering
f49df7a3b0 * Increase history set to 64 to simplify reduction of indexes
* Decrease memory consumption a bit by using bitfields for some bools
* Rework reduction code
* Drop an unnessacary counter
* Before adding a new entry to the history, try to figure out if we already have an existing entry with the same x value and replace that. This fixes a division by zero
* Fix up input x for all functions, according to the time offset


git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2316 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 19:04:42 +00:00
Lennart Poettering
563f4b63cd make check for $DISPLAY=="" more readable, pa_bool_tization
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2315 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 18:59:25 +00:00
Lennart Poettering
06a05bc66c a bit of pa_bool_t'ization
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2314 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 18:57:18 +00:00
Lennart Poettering
b12b8ee160 save errno before calling free()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2313 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-01 18:56:14 +00:00
Lennart Poettering
caf742a076 define minimal and maximal wakeup/sleep times; check for underrun condition only once during buffer fillup
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2312 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-23 23:22:51 +00:00
Lennart Poettering
5353cf45f5 fix size of requested_latency
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2311 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-23 19:55:04 +00:00
Lennart Poettering
067a68abf9 fix build for auxiliary modules
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2310 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-23 19:22:56 +00:00
Lennart Poettering
c8fc223fe9 add stripnul to build
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2309 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-23 18:56:19 +00:00
Lennart Poettering
76031df4a4 Big pile of interdependant changes:
* Fix a deadlock when an asyncq overflows and an RT thread needed to wait until space became available again while the main thread was waiting for a operation to complete and thus didn't free any new items. Now, if the asyncq overflows, queue those items temporarily, and return immediately. Then, when the queue becomes writable again, flush it.
* Modify pa_thread_mq_init() to also set up pa_rtpoll events properly for the MQ
* Some more pa_bool_t'ization
* Unify more common code between alsa-sink and alsa-source
* The upper limit for the tsched watermark is max_use minus one frame
* make module-alsa-source work
* make the alsa modules use pa_alsa_build_pollfd() now
* fix detection of dB scale for alsa-source


git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2308 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-23 18:26:48 +00:00
Lennart Poettering
a197644ea2 add new tool 'stripnul' which can be used to drop leading zeros from a file which is useful to do byte-by-byte comparison of what goes in and comes out of PA
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2307 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-23 18:19:45 +00:00
Lennart Poettering
f2dffb717d pa_bool_t'ization
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2306 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-23 18:17:17 +00:00
Lennart Poettering
0b183fbdc6 respect the resampler's maximum block size to avoid that we get kicked out of the memory pool due to resampling. actually drop data from the delay queue after we used it
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2305 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-23 18:14:25 +00:00
Lennart Poettering
998ed8ede1 add missing header definitions for last commit
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2304 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-23 18:13:11 +00:00
Lennart Poettering
3f57d3aab2 add new function pa_alsa_build_pollfd() to alsa-util to unify a bit more common code from the sink and the source
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2303 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-23 18:12:46 +00:00
Lennart Poettering
ed0af46e69 unify code that fixes up buffering metrics
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2302 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-23 18:11:57 +00:00
Lennart Poettering
af03dd4e4f drop a misplaced newline
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2301 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-23 18:11:14 +00:00
Lennart Poettering
3c8e83fb3e do not fix automatic buffer attrs anymore, the new protocol version doesn't need this anymore and it creates more problems than it solves. Also drop the initial timing info query. Correct programs shouldn't depend on it anyway
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2300 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-23 18:10:34 +00:00
Lennart Poettering
5e6aacdbe2 * don't increase tsched_watermark on underrun without limits
* fix the watermark when we change the latency
* fix latency measurement
* move rewinding code into its own function
* make use of new function pa_alsa_recover_from_poll() were applicable


git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2299 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-22 02:50:55 +00:00
Lennart Poettering
6b4b95beed show configure latency metrics
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2298 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-22 02:48:24 +00:00
Lennart Poettering
1adbe822b8 some beautification updates, show msec instead of usec everywhere
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2297 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-22 02:47:47 +00:00
Lennart Poettering
cdb077b6c0 if no timer was armed, we don't need to disarm it
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2296 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-22 02:47:05 +00:00
Lennart Poettering
4a1971a535 if no latency was configure for a sink/source, fill in the max latency automatically
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2295 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-04-22 02:46:19 +00:00