LADI
/
spa
1
Fork 0
Commit Graph

10857 Commits

Author SHA1 Message Date
Wim Taymans 216d788ce5 filter: implement set_active()
Make a node implementation and export it, just like we do for the
stream. This way we can use the node to implement set_active().

Tweak the draining logic like pw_stream.
2023-04-28 12:50:11 +02:00
Wim Taymans d0ac5c2e1d stream: move pw_impl_node to private.h
The listener is there as well.
2023-04-28 12:39:06 +02:00
Wim Taymans 472a948974 loop: keep loop and system around
So that we don't have to go through the context all the time.
2023-04-28 11:12:02 +02:00
Wim Taymans 8f7acb717c audioconvert: clear format and buffers on start error.
When we get an error, clear the ready state again and also clear the
format a buffers that we might have negotiated before starting.
2023-04-28 10:47:30 +02:00
Wim Taymans 9e7921b37d module-jack: improve xrun reporting 2023-04-27 18:10:41 +02:00
Wim Taymans 381aa90b54 module-jack-tunnel: improve some docs 2023-04-27 17:22:05 +02:00
Wim Taymans b262812643 audioconvert: always allow peaks resampler
When we're using the peaks resampler, allow resampling, even when it is
disabled in the config.

The peaks resampler is just for GUI and would not really change the
signal, so we can allow this.
2023-04-27 17:10:41 +02:00
Wim Taymans ab0cee29dd doc: add jack-tunnel to docs 2023-04-27 17:03:10 +02:00
Wim Taymans 73f5f7ae65 jack-tunnel: add a new 0-latency JACK sink/source module
Add a new JACK sink/source pair that translates to a single JACK
client.

The JACK playback port appears as PipeWire source and is processed
directly, synchronously, through the complete pipewire graph into
the PipeWire sink that is then made available on the JACK capture
ports.

Because all this happens in the same JACK cycle with no delay, the
latency is 0. A jack_iodelay on the JACK server has exactly the same
latency as the jack_iodelay on the PipeWire side.

The PipeWire sink and source are forced into the same rate and
buffer_size as the JACK server and can't dynamically change.

This only supports Audio for now.
2023-04-27 16:27:54 +02:00
Wim Taymans 0844f72f50 private: improve ensure_loop debug message
The result can be 0 when the loop is not running or when the current
thread is not the thread loop. Make a better message than "Success" in
that case.
2023-04-27 15:18:26 +02:00
Wim Taymans 9eb1633b02 protocol-native: don't remove all fds in clear
When we consumed all the buffer data, don't clear all the fds but only
those that were already consumed in the message. It is possible that we
already have fds for the next message and we don't want to discard
those.

Fixes some intermittend memory map errors.
2023-04-27 11:03:53 +02:00
Wim Taymans 0ac465854b jack: improve error reporting 2023-04-27 09:52:35 +02:00
Wim Taymans 3cae535da0 impl-node: calculate stats at cycle start
Calculate the stats at the start of the new cycle. The results will be
about the previous cycle but this gives more accurate results because
we can also include awake and finish times of remote nodes.

Make sure not to change the status of the activation in the ready event
so that we don't overwrite the status of the last cycle yet.

This means we can always set the AWAKE and awake_time, the remote node
might update it when triggered but that's ok.

After processing we can update the FINISHED state for non-remote nodes,
the remote nodes will update it after they complete the process
function.
2023-04-27 09:34:07 +02:00
Wim Taymans e7a9dcfacc impl-node: improve profile reporting
Handle the update of the activation status before calling resume_node()
because we can call this when starting a cycle or when completing
a node.

Only set the AWAKE status and time in process_node when not exported or
not driving. For an exported driving driver, the server will have
already updated the values before it triggered our last process and then
completed the graph. If we update again in the client, the server will
read wrong values.

Because there is not really a way yet to get the finish time of the remote
driver the awake and finish times are too early. We might be able to fix
this later by making the stats at the start of the cycle from the
previous values.

Keep 2 extra variables to record the driver start and previos driver
start values. This way we can measure the period. This used to be done
with a little hack, using the finish_time of the driver, which was set
previously in resume_node().

For exported driving nodes, the TRIGGERED time is set in the remote-node
before it writes the eventfd to trigger the node_ready event. For
non-exported nodes, we need to set this ourselves.

For non-driver nodes that trigger node_ready, mean that they did an
async resume of the node. This means the node is finished and we can set
the finish_time accordingly.
2023-04-26 16:46:13 +02:00
Wim Taymans 4df2982ba1 impl-node: refactor gettime 2023-04-26 16:43:01 +02:00
Wim Taymans 5e6dc48013 impl-node: initialize the driving state correctly
A new node is driving only when it is a driver.
2023-04-26 16:37:01 +02:00
Wim Taymans 5303fced50 client-node: pass the ready status in the activation state
Pass the ready status to the client-node using the state array.

Don't just SPA_STATUS_HAVE_DATA on the server side but use the value
from the client.

This avoids some potential extra work when a driver sink pulls in data
with the NEED_DATA ready callback but then the server performs the
actions (tee) as if it were SPA_STATUS_HAVE_DATA.
2023-04-26 15:56:29 +02:00
Wim Taymans 989f597860 client-node: update the driving node status
Look at the clock and position to see if we are selected as the driver
or not.
2023-04-26 15:47:41 +02:00
Pauli Virtanen 420f7cb48e bluez5: select BAP audio locations in SelectProperties
Do BAP audio location selection properly in SelectProperties, now that
BlueZ provides the supported locations there. Remove a previous
workaround.

The audio location in SelectProperties determines the audio channel
allocation, which determines the channel positions.
2023-04-25 21:44:38 +03:00
Wim Taymans 815501cc1f jack: improve jack-sink and jack-source
Add more properties to sink/source to make them always process and
have the right priorities. Make sure the sink has higher priority than
the source so that we can pull in samples through the graph.

Only trigger the graph cycle when driving the graph.

Make sure to return something from process to signal that the graph can
continue processing.
2023-04-25 20:17:11 +02:00
Wim Taymans b9381a9da6 audioconvert: use a new boolean to check if ready
Use a new boolean to check if the follower is allowed to emit a ready
event. This can be done right after negotiating.

Set the started field to true after we finish setting the state of the
converter and follower. This fields is used to block calling into the
process function before we complete the setup.

This avoid a crash in always-process nodes when the node is scheduled
before the audioconverter completes setup.
2023-04-25 20:16:28 +02:00
Jonas Holmberg ecbb1b0c4c pipewire-alsa: Propagate stream errors
Propagate stream errors and check for successful negotioation or error
in _prepare(). This will return an error from _prepare() if there is no
target node to link to (unless PIPEWIRE_AUTOCONNECT=false).

It would be preferable to also set PW_STREAM_FLAG_INACTIVE to not start
processing until _start() is called but then it would not be possible to
signal successful negotiation.
2023-04-25 17:04:54 +02:00
Wim Taymans a544c5d4ad impl-node: don't move rate/quantum when moving drivers
When we move a node from one driver to another, don't move the rate
and quantum because this tricks the new driver into thinking it's
already in the correct rate and it will skip doing a complete rate
switch.

This causes some nodes to fail to switch to the new rate, like in this
scenario:

1. mpv (node.always-process = true) appears and is added to the dummy
   driver with rate/quantum of 48000/512
2. mpv is linked to an equalizer, linked to a sink, nodes are moved
   to the new sink, target rate/quantum is copied to the new sink.
3. sink and followers are started in 48000/512, all is good. The sink
   is now configured in 48000/512.
4. mpv is stopped, sinks and eq (input, not output) suspend
5. mpv appears again with 44100/512 and is added to dummy driver, which
   is then configured in 44100/512
6. mpv is linked again to eq, nodes are moved, the sink rate/quantum
   is copied and the sink thinks it's in 44100/512
7. sink and followes are started but no rate switch is happening because
   rate/quantum was copied in step 6. Some followers are not suspended
   and don't apply the rate change correctly (eq output).

By eliminating the rate/quantum copy when moving drivers, the sink will
correctly perform the rate change on all nodes.

Fixes #3159
2023-04-25 10:13:02 +02:00
Wim Taymans 78e54b1b2a jack: make spa_return macros log a warning
.. instead of using fprintf to stderr.
2023-04-24 13:23:40 +02:00
Wim Taymans 5a65d67f3a jack: we don't need a completed link in jack_port_connected
Return true from jack_port_connected() right after jack_connect(), there
is no reason to wait for the completed state of the link.

See #2638
2023-04-24 12:59:32 +02:00
Wim Taymans b87f7251d8 jack: activate/deactivate should trigger port register
Port added before activate should trigger a port_register callback when
the client is activated.

When calling jack_deactivate, the port_register callback should be
called.

See #2638
2023-04-24 12:55:56 +02:00
Wim Taymans 0f0d56e783 jack: avoid registering same port names twice
Don't register port names that are too long or that already exist.

See #2638
2023-04-24 12:53:56 +02:00
Daniel Houck c20e7788c5 Add 3M WorkTunes Connect to bluez-hardware.conf 2023-04-24 07:20:05 +00:00
Pauli Virtanen ed82f9b83b bluez5: media-source: remove unnecessary workaround
The duplex polling issue was due to spa_loop_add_source failing
when source and sink were both using the same fd. We now dup, so the
issue no longer exists.

Remove the now unnecessary workaround, and check the return values from
spa_add_source.
2023-04-23 18:43:05 +03:00
Pauli Virtanen f7b57d87d6 bluez5: backend-native: fix off-by-one in at+xevent 2023-04-22 13:26:54 +03:00
Wim Taymans 12bc69a469 raop-sink: only set volume when connected
Only attempt to set the volume when connected. Apply the current
volume after connecting.

Based on patch by Tycho Haemers

Fixes #3175
2023-04-22 11:16:55 +02:00
Wim Taymans 68664adcd4 filter-chain: improve debug 2023-04-21 18:25:01 +02:00
Wim Taymans 64aae9d551 module-echo-cancel: set rec/source/play_info fields correctly
In the fallback case we need to set them all to the same format as
the playback.
2023-04-21 18:23:53 +02:00
Wim Taymans 84a6f38ea6 jack: on do shutdown on EPIPE
There are core errors that should not trigger a shutdown, like invalid
or destroyed proxy replies. Only do shutdown when we get EPIPE, which is
when the server is stopped.

See #3070
2023-04-21 16:28:01 +02:00
Wim Taymans 8cfa5ccd79 mixer: increase mixer ports from 128 to 512
Don't allocate the mixer arrays on the stack but include in the
implementation structure.
2023-04-21 15:58:38 +02:00
Wim Taymans b9cf2638b3 client-node: remove hardcoded limit for io areas
When we run out of io_areas, just allocate another memblock and continue
with the new block.
2023-04-21 15:45:25 +02:00
Wim Taymans 76c793128b jack: Add jack.max-client-ports config option
Limit the amount of ports per client to 768 and add a
jack.max-client-ports option to configure this.
2023-04-21 15:42:57 +02:00
Wim Taymans bf18ba839f protocol-native: add some more debug 2023-04-21 15:07:29 +02:00
Wim Taymans e75fc459b3 jack: add jack.show-midi option
Add an option to show of hide MIDI ports, true by default.

Add jack.show-midi to config
2023-04-21 15:07:26 +02:00
Wim Taymans a643ac7d7a jack: fix some jack test errors
See #2638
2023-04-21 11:43:22 +02:00
Pauli Virtanen 87269e85db bluez5: AT+XEVENT input validation, cleanups & respond OK
Also support AT+XEVENT=BATTERY,%u which some devices apparently send.
2023-04-20 16:03:47 +00:00
delaosa 65ddd0a42b bluez5: Add battery level reporting via AT+XEVENT 2023-04-20 16:03:47 +00:00
Wim Taymans 0333ddff45 pod-builder: move some code around to help gcc 13
Make sure to pop the frame before returning errors to stop gcc13
from complaining with -Wdangling-pointer

Fixes #3171
2023-04-20 17:52:27 +02:00
Wim Taymans 83d2e85f49 parser: add extra check to make coverity happy
Fixes !1473
2023-04-20 12:32:07 +02:00
Wim Taymans 9f7d60c1e8 0.3.70 2023-04-20 10:41:31 +02:00
Wim Taymans 181cbc5c99 pw-config: fix include for isatty 2023-04-20 10:40:47 +02:00
Wim Taymans 7f8e863e9b man: fix underline in pw-config man 2023-04-20 10:26:12 +02:00
Wim Taymans e90e948166 man: add pw-config man page 2023-04-20 10:24:29 +02:00
Wim Taymans 2d388c6908 properties: add color support for dumping properties 2023-04-20 10:02:08 +02:00
Wim Taymans dd21ebf6b8 module-rtp: just log generic sendmsg error debug log 2023-04-19 21:34:39 +02:00