Commit graph

76 commits

Author SHA1 Message Date
Wim Taymans
a79d1fc866 pulse: tweak buffer attributes some more
Seems to work well with vlc and firefox other apps now.
paplay without ADJUST_LATENCY reports wrong latency still.
2020-09-25 17:06:46 +02:00
Wim Taymans
8bb4b91e74 stream: present less writable bufferspace
firefox likes that better
2020-09-24 19:25:37 +02:00
Wim Taymans
9d694b7b38 stream: tweak the timings and buffer attributes
Use tlength as the latency.
Round attributes to frame size
Only use the delay in get_time().
Tweak queued, writable and required bytes for callbacks.
2020-09-24 17:57:10 +02:00
Wim Taymans
abf268d168 stream: tweak the timings and buffer attributes
Use tlength as the latency.
Round attributes to frame size
Only use the delay in get_time().
Tweak queued, writable and required bytes for callbacks.
2020-09-24 17:28:30 +02:00
Wim Taymans
995cf66f92 pulse: don't go lower than 8 samples per minreq 2020-09-21 11:21:15 +02:00
Wim Taymans
7a50026a2c pulse: clear queued bytes on flush 2020-09-18 20:44:21 +02:00
Wim Taymans
7c5192bc31 stream: use more accurate queued bytes and maxsize
Make lower latency streams work better.
2020-09-18 17:59:01 +02:00
Wim Taymans
688041b083 pulse: fix drain
The drain operation does not complete with a sync from the server but
with an event from the stream. Set a flag in the operation that it
completes with a sync. Keep all operations without a sync around in
the list.
2020-09-17 11:48:21 +02:00
Wim Taymans
e142e40cfe stream: set latency variable correctly 2020-09-15 13:22:41 +02:00
Wim Taymans
67f4acaf1d pulse: try hard to always create a valid channel map
Unknown channel names are mapped to aux channels.
Add extra AUX channels when we don't know the channel layout.
This makes sure apps always receive valid channel layouts so they
don't abort (pactl).
2020-09-14 11:06:11 +02:00
Wim Taymans
38f8c9c6c8 pulse: always notify of available data
If we have some data available for capture, always report this
to get the lowest latency possible.
2020-09-11 15:34:30 +02:00
Wim Taymans
8f75056689 pulse: improve handling of buffer attributes
Repect minreq and fragsize for playback and capture.
Try to configure tlength at 2 seconds, minreq at around 25ms. Should
greatly improve compatibility with audacious and mpv.
Count since_underrun correctly.

Fixes #278
2020-09-11 13:08:20 +02:00
Wim Taymans
6eb4b552ad stream: unmark Not Implemented methods
_prebuf and _trigger are not implemented but should not really cause
any trouble, so just debug them without warning.
2020-09-11 11:41:29 +02:00
Wim Taymans
3b7f2c527c stream: call _done after operation callback 2020-09-11 11:40:57 +02:00
Wim Taymans
af64666716 pulse: call operation_done at end of callback 2020-09-09 13:48:01 +02:00
Wim Taymans
289a8e86ca stream: move some debug to trace 2020-09-03 13:19:55 +02:00
Wim Taymans
157b15d643 pulse: implement load_module of null-sink
Implement load_module of the null sink
Keep track of sink_input/source_output linked sink/source in a
better way.
Associate the global with our streams and the streams with the
global.
Don't emit the sink_input/source_output before there is a linked device
and before our stream is READY.
Improve server info to make it more look like pulse.
2020-08-20 18:00:00 +02:00
Wim Taymans
cde6b99890 stream: call latency_update callback 2020-08-19 16:49:30 +02:00
Wim Taymans
5037a97690 stream: call started callback when started
.. instead of the suspended callback
2020-08-19 16:49:02 +02:00
Wim Taymans
bb323a82a7 stream: call the moved_callback when moved 2020-08-19 16:48:25 +02:00
Wim Taymans
4e17d4cdf8 pulse: don't leak device_name
Small cleanups
2020-08-19 16:47:52 +02:00
Wim Taymans
1f298cb5bf stream: guard against old timestamps 2020-08-19 16:02:52 +02:00
Wim Taymans
6aa6b4eac7 pulse: improve debug 2020-08-18 12:12:49 +02:00
Wim Taymans
9290137931 pulse: handle NULL pw_stream
The pipewire stream might have been destroyed when the pulse stream
is freed.
2020-08-04 18:20:20 +02:00
Wim Taymans
653465a1b1 pulse: handle device_name of NULL as error 2020-08-04 18:15:19 +02:00
Wim Taymans
979fec288e stream: let the operation emit the TERMINATED state
When we disconnect, let the operation emit the TERMINATED state
because some apps expect this state to be emited asynchronously.

Makes GStreamer pulsesink work.

Fixes #210
2020-08-04 18:13:37 +02:00
Wim Taymans
94c23b7ed1 pulse: handle memory user_data of NULL 2020-08-04 18:11:58 +02:00
Wim Taymans
007c50df56 stream: clear user data on flush
Or else we might add the memory to the free list again when
we free the buffers. Fixes audacity using the pulseaudio backend
in portaudio.
2020-08-03 21:53:51 +02:00
Wim Taymans
2d76a00e20 stream: fix printf modifier 2020-08-03 09:56:37 +02:00
Wim Taymans
a5f85deabe pulse: also use PIPEWIRE_LATENCY as a fallback 2020-07-30 18:23:23 +02:00
Wim Taymans
aee95e76bb pulse: use the right sample spec 2020-07-30 18:22:03 +02:00
Wim Taymans
18b4aee677 Parse format param and store in node 2020-07-29 14:29:03 +02:00
Wim Taymans
55bef12cda pulse: take queued data into account when asking for more
Don't use always ask for the maximum amount of data in the
write_callback but subtract the queued amount of data from it or else
we will queue too much and cause huge lag.

Fixes #258
2020-07-29 09:49:06 +02:00
Wim Taymans
cb91e9c536 stream: improve flags 2020-07-28 10:49:33 +02:00
Wim Taymans
6184c0fe32 keys: add stream to avoid remixing channels 2020-07-28 10:16:04 +02:00
Wim Taymans
cc0727e62f pulse: remove useless leaked property 2020-07-21 17:39:08 +02:00
Wim Taymans
2909786eb2 stream: put target string in node.target 2020-07-20 16:27:50 +02:00
Wim Taymans
5d0a1c4838 stream: remove wrong warning 2020-07-20 13:27:25 +02:00
Wim Taymans
2991a814cd pulse: wait for READY before calling callbacks 2020-07-07 13:42:56 +02:00
Wim Taymans
d560499054 stream: handle NULL context 2020-06-24 12:52:50 +02:00
Wim Taymans
64fc8dda20 stream: check for NULL context
If a stream was killed, the context is cleared. Disconnecting a killed
stream should not crash but return BADSTATE.
2020-06-08 11:58:32 +02:00
Wim Taymans
ee5d6b4451 pulse: add more checks 2020-06-05 12:43:26 +02:00
Wim Taymans
cab645d155 stream: we can get the index before we are ready 2020-05-12 17:50:24 +02:00
Wim Taymans
a7d8e805ac stream: do some extra checks 2020-05-11 14:16:19 +02:00
Wim Taymans
df8ad59e37 stream: fix writable size when no timing info received
Always report that we can write a buffer, even when we have
not yet received timing info. Fixes stalled spotify.

Fixes #238
2020-05-11 11:30:24 +02:00
Wim Taymans
e6ccc72feb fix compiler warnings 2020-05-08 20:40:02 +02:00
Wim Taymans
4e44da6c4b pulse: hide the pa_proplist implementation
Hide the proplist implementation.
Add some more methods to update the proplist
Make sure our integration functions only use exported symbols
so that they even work against the original pulse implementations
in case they are loaded first.

Fixes #236
2020-05-08 14:17:45 +02:00
Wim Taymans
9c1ac4e850 pulse: implement cork now 2020-04-28 12:18:57 +02:00
Wim Taymans
aafd1e7298 improve debug
Improve log so that debug level 3 gives a reasonably readable overview
of what is going on.
2020-04-22 12:47:18 +02:00
Wim Taymans
dfd1adf816 stream: always request one block
Don't request too many bytes in one go but one block at a time.
This slowly fills up the queue.
2020-04-15 17:21:42 +02:00