Commit graph

3688 commits

Author SHA1 Message Date
Gleb Popov
209a5e101c Add Cirrus CI config file for FreeBSD. 2020-04-19 15:34:59 +04: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
Wim Taymans
262d0ee7d2 pulse: count queued bytes 2020-04-15 17:11:49 +02:00
Wim Taymans
bf95887a02 pulse: improve timing
Make writable size more accurate by using the clock. mplayer uses this
to check if the clock is advancing.
Remove requested_bytes, we can use ready_bytes for the ready bytes
and use the queued bytes for playback.
Reset after a flush, wait for a new timing update.
2020-04-15 16:19:42 +02:00
Wim Taymans
e73431d541 resample: use right define to compile sse functions
See #220
2020-04-14 20:29:27 +02:00
Wim Taymans
b09caaadc0 midifile: make it possible to specify output file 2020-04-14 20:12:23 +02:00
Wim Taymans
84b048507b midifile: remove impossible case. 2020-04-14 20:11:51 +02:00
Wim Taymans
d1beeeade0 loop: handle file fd with eventfd
epoll return EPERM for file fds like stdin/stdout because they are
always ready for IO. use an idle source to handle these cases.
2020-04-14 18:05:45 +02:00
Wim Taymans
30fac2b242 stream: improve timing
Dequeue the input buffers so that we can calculate the available
bytes to read.
2020-04-14 16:50:29 +02:00
Wim Taymans
1d0ce27005 stream: remove useless size on input streams
Setting the size on input stream buffers based on the elapsed
ticks does not give a meaningfull value for the queue size so
just leave it to the user to set the size field.
2020-04-14 15:42:25 +02:00
Wim Taymans
d9a18742f4 pulse: guard against invalid fds
Some fds can't be added to epoll (stdin/stdout) and will cause an
error. Make sure we don't try to free the NULL event.
Add some more debug
2020-04-14 15:40:21 +02:00
Wim Taymans
6d24a034fb stream: improve timing
Improve the delay, make sure we don't overflow
Flush and free pending memory
Keep track of requested_bytes
2020-04-14 10:22:34 +02:00
Wim Taymans
4fd43733c2 pulse: more work on timings
The read_index should not include the delay to the device.
Keep a separate lis of memory blocks filled by the app and give
those to the stream when we can. This is because pulse can allocate
an infinite amount of buffers but we must cycle between a fixed
number. Use DYNAMIC_DATA to avoid memcpy.
Use the right requested_bytes in the write_callback. This should
be the tlength - the amount of bytes we already queued.
_get_time() should include the sink latency.
2020-04-13 19:44:12 +02:00
Michael Tretter
fd00d16361 gst: add properties for limits of negotiated buffers
By default, the pipewiresrc tries to negotiate 16 buffers. This value is
hard coded in the pipewiresrc. If the buffers are large, this could lead
to an undesirably high memory usage. Applications that know about the
buffer size and that fewer buffers are sufficient should be able to
configure the limits for the number of buffers that are negotiated.

Therefore, add the min-buffers and max-buffers properties to the
pipewiresrc to enable applications to configure limits for the number of
negotiated buffers.
2020-04-13 07:42:35 +00:00
Wim Taymans
b01c264c5c pulse: improve timing
Keep track of written bytes and use this to calculate the latency.
2020-04-12 20:47:33 +02:00
Wim Taymans
c446dfb1d6 resample: improve debug 2020-04-12 20:46:59 +02:00
Wim Taymans
bfefd76055 stream: only call process when we have a dequeued buffer 2020-04-12 20:46:14 +02:00
Wim Taymans
2bb2e50eef audioadapter: stop when the follower needs data 2020-04-12 20:44:56 +02:00
Wim Taymans
c1f3593ef0 audioadapter: small cleanup 2020-04-12 20:44:19 +02:00
Wim Taymans
b18dacde9a spa: improve draining
Make a new DRAINED status.
Place the DRAINED status on an input IO when a stream is out of
buffers and draining.
All nodes that don't have HAVE_DATA on the input io need to copy
it to the output io and return the status. This makes sure the
DRAINED is forwarded and nodes return DRAINED from _process()
DRAINED on the resampler flushes out the last queued samples and then
forwards the DRAINED in the next iteration.
Emit a new drained signal from the context when a node returns
DRAINED. Use this to trigger the drained signal in the stream.
2020-04-07 17:58:43 +02:00
Wim Taymans
029f431418 alsa: implement drain function
Implement a drain function that blocks and waits for the drain to
complete.
2020-04-07 17:48:28 +02:00
Wim Taymans
70f5abfe35 alsa: report error from server when we can 2020-04-07 17:38:39 +02:00
Wim Taymans
fdb5911e86 resample: use a 0 sized buffer to drain 2020-04-06 18:01:38 +02:00
Wim Taymans
7febf7ea25 improve debug 2020-04-06 18:01:19 +02:00
Wim Taymans
c658574c01 alsa: improve drain 2020-04-06 17:53:46 +02:00
Wim Taymans
7927a66fdd tools: improve error reporting 2020-04-04 20:23:42 +02:00
Wim Taymans
95906ca52e audioconvert: fix compilation 2020-04-04 20:03:11 +02:00
Wim Taymans
a5b0553328 Fix some -Wenum-conversion errors
Make pw_direction and spa_direction the same
Explicitly cast some enums or use the right enums
2020-04-04 20:03:08 +02:00
Wim Taymans
6937ec5e63 audioconvert: compile c version with right flags 2020-04-03 18:12:04 +02:00
Wim Taymans
28b0da626e Add missing file 2020-04-03 18:05:29 +02:00
Wim Taymans
0d1cef6b3a audioconvert: move some things around
To make it easier to add other implementations later.
Improve selection of resampler function
2020-04-03 18:03:42 +02:00
Wim Taymans
bf3ebb67aa neon: add alignment hints 2020-04-03 14:26:02 +02:00
Wim Taymans
167460a9bc fmt-ops: add arm32 optimizations 2020-04-03 14:09:46 +02:00
Wim Taymans
a81e269a7e neon: fix neon detection and compilation 2020-04-03 13:30:08 +02:00
Wim Taymans
ab3a6d3441 Fix some compiler warnings on arm 2020-04-03 13:18:02 +02:00
Wim Taymans
df5721ff47 neon: fix taps arguments 2020-04-03 10:31:55 +02:00
Wim Taymans
a87337cae8 neon: fix fallback 2020-04-03 10:22:58 +02:00
Wim Taymans
22e590c7cc stream: somewhat implement drain better
Abuse the xrun callback in the adapter to emit the drained signal until
almost all data left the resampler. This needs more work with a proper
signal and a buffer flag to signal the drain.
2020-04-02 17:46:50 +02:00
Wim Taymans
ce39c6200d node: add comment 2020-04-02 17:44:03 +02:00
Wim Taymans
1b3aaba206 fmt-ops: set the right flags on optimized functions
Or else we could select an avx2 version on a non-capable CPU.

Fixes #227
2020-04-02 17:34:47 +02:00
Wim Taymans
02dc407752 node: improve debug of activation area 2020-04-02 15:43:36 +02:00
Wim Taymans
c5be7642a3 context: don't recalculate graph for exported nodes
Exported nodes are managed by the remote end so we don't have to.
2020-04-02 15:42:21 +02:00
Wim Taymans
d1091462ab transport: init io_buffers with SPA_IO_BUFFERS_INIT 2020-04-02 15:36:56 +02:00
Wim Taymans
74ab04af26 client-node: use BUFFER_INIT to reset io_buffers 2020-04-02 15:31:58 +02:00
Wim Taymans
c8f435ec41 pulse: also disconnect when we unlink the context 2020-04-02 15:31:20 +02:00
Wim Taymans
f51ba55dae pulse: avoid emiting the NEW event too soon
Let the NEW event be emited when all params are updated.
2020-04-02 15:30:15 +02:00
Wim Taymans
4346cad322 pulse: improve debug of events 2020-04-02 15:28:24 +02:00
Wim Taymans
c20100eabb media-session: Add method to destroy a global
Destroy the stream when it is disconnected and it was marked as
DONT_RECONNECT.
2020-04-02 15:27:23 +02:00
Wim Taymans
a86f70c13d protocol-native: avoid destroying NULL source
The source might have been destroyed before.
2020-04-02 15:25:13 +02:00
Wim Taymans
b87c0a9270 clean up options
make sure we can use -v for verbose mode
2020-04-02 14:34:02 +02:00