Commit graph

22 commits

Author SHA1 Message Date
Wim Taymans
11f1298f53 spa: make a function to make a channel short name
Make a function that can generate and parse a short name for
the positions that are not in the type list, like the AUX channels.
2025-10-22 13:04:53 +02:00
Wim Taymans
8bbca3b8f3 spa: add spa_audio_parse_position_n
Add a function that accepts the size of the position array when reading
the audio positions. This makes it possible to decouple the position
array size from SPA_AUDIO_MAX_CHANNELS.

Also use SPA_N_ELEMENTS to pass the number of array elements to
functions instead of a fixed constant. This makes it easier to change
the array size later to a different constant without having to patch up
all the places where the size is used.
2025-10-21 09:59:13 +02:00
Wim Taymans
f7fdafc203 loop: add method to run a function with the lock
Convert some _invoke to _locked
2025-05-29 10:17:16 +02:00
Wim Taymans
e2991f6398 json: add helper function to parse channel positions
Use the helper instead of duplicating the same code.

Also add some helpers to parse a json array of uint32_t

Move some functions to convert between type name and id.
2024-09-18 09:54:34 +02:00
Wim Taymans
3698593481 spa: reuse code to clear the timers
We have set_timeout and enable_flush_timer functions to disable the
timers so use those.
2023-03-24 17:55:15 +01:00
Wim Taymans
7b6680ba57 plugins: simplify target_ handling
Drivers should only read the target_ values in the timeout, update the
timeout with the new duration and then update the position.

For the position we simply need to add the previous duration to the
position and then set the new duration + rate.

Otherwise, everything else should read the duration/rate and not use
the target_ values.
2023-03-24 11:36:15 +01:00
Wim Taymans
6e8625cf96 node: update the duration/rate from the target
Before scheduling the graph from the driver, update the duration and
rate with the new targets.
2023-03-23 18:39:27 +01:00
Barnabás Pőcze
934ab3036e treewide: use SPDX tags to specify copyright information
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.

See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00
Wim Taymans
f44d55f6c2 handle read from timerfd correctly
When reading the timerfd gives an error, we should return right away
because the timeout did not happen.

If we change the timerfd timeout before reading it, we can get -EAGAIN.
Don't log an error in that case but wait for the new timeout.
2022-12-09 17:30:31 +01:00
Wim Taymans
74447acedb Add some more format checks
The format parse functions don't really check if the parsed values
make any sense so we need to to this ourselves.
2022-11-03 13:10:32 +01:00
Demi Marie Obenour
c1920163d5 Fix calls to sendmsg()
Align cmsg buffers properly and use MSG_NOSIGNAL.
2022-09-23 16:33:36 +00:00
Wim Taymans
af4875eb47 avb: remove libavtp dependency 2022-07-12 12:27:21 +02:00
Wim Taymans
c79fddf007 avb: handle xruns better
Don't stop early, fill gaps with silence.
2022-07-12 12:27:21 +02:00
Wim Taymans
87053365ea avb: handle sink follower
We need to flush out the packets when we are a follower and when we get
data because our timer is not running as a sink.
2022-07-12 12:27:21 +02:00
Wim Taymans
4d6c71bf12 avb: use iovec to read from ringbuffer 2022-07-12 12:27:21 +02:00
Wim Taymans
5c3629a165 avb: add follower mode
As a follower we disable our own timer and produce a buffer from what we
have when _process is called.
2022-07-12 12:27:21 +02:00
Wim Taymans
ff5201ef3d avb: check seq
Avoid infinite loops.
Check sequence number and warn
Use 32 frames per pdu in example.
2022-07-12 12:27:21 +02:00
Wim Taymans
200f591a3d avb: add source 2022-07-12 12:27:21 +02:00
Wim Taymans
552a0056b5 avb: more work
Handle properties.
Fix format negotiation.
Wait in underrun.
2022-07-12 12:27:21 +02:00
Wim Taymans
537a38355a avb: more work 2022-07-12 12:27:21 +02:00
Wim Taymans
f95b8263e6 avb: more improvements 2022-07-12 12:27:21 +02:00
Wim Taymans
1adc94df11 start of AVB support 2022-07-12 12:27:21 +02:00