Commit graph

21 commits

Author SHA1 Message Date
Wim Taymans
aa0272f6f3 treewide: remove some obsolete channel checks
The spa_audio_info can not be parsed with too many channels so there
is always enough space for the positions.
2025-10-24 10:31:45 +02:00
Wim Taymans
5e1e3fca1e modules: handle format parsing errors 2025-10-23 18:01:35 +02:00
Wim Taymans
818d1435ce treewide: access the position information using helpers
Make sure we don't access out of bounds and that we use the helpers
wherever we can to access the position information.
2025-10-21 13:06:25 +02:00
Wim Taymans
35b3c8c279 vban: truncate sess.name when too large 2025-08-01 18:17:21 +02:00
Sam James
2cec77e7df *: unify config.h handling
config.h needs to be consistently included before any standard headers
if we ever want to set feature test macros (like _GNU_SOURCE or whatever)
inside. It can lead to hard-to-debug issues without that.

It can also be problematic just for our own HAVE_* that it may define
if it's not consistently made available before our own headers. Just
always include it first, before everything.

We already did this in many files, just not consistently.
2025-05-30 10:24:13 +00:00
Wim Taymans
564c9b1ba5 Use "8 bit raw midi" for control ports again
There is no need to encode the potential format in the format.dsp of
control ports, this is just for legacy compatibility with JACK apps. The
actual format can be negotiated with the types field.

Fixes midi port visibility with apps compiled against 1.2, such as JACK
apps in flatpaks.
2025-05-23 16:46:13 +02:00
Barnabás Pőcze
705c2a652b pipewire: module-vban: fix vban serial header
The expression `VBAN_PROTOCOL_SERIAL | vban_BPSList[14]` is assigned
to an 8 bit field of the header, but, `vban_BPSList[14]` being
115200, it does not fit. Instead, its index, 14, should be
placed in the header.

In addition to fixing the issue, add `-Werror=constant-conversion`,
and clang diagnostic that catches such issues.

Fixes: 1a5514e5cf ("module-vban: create streams per stream_name")
2024-12-14 23:09:45 +01:00
Wim Taymans
804df3389a modules: use pw_stream_set_rate() when we can 2024-11-22 09:49:27 +01:00
Wim Taymans
0833b19a75 module-vban: fill some default channel layouts
VBAN does not really transmit any channel layouts so make some
assumptions about the layout when not explicitly specified.
2024-11-14 11:07:05 +01:00
Wim Taymans
1a5514e5cf module-vban: create streams per stream_name
Always listen on the receive socket. Find the stream with the given
stream_name of the packet and create it if it doesn't exist.

Also take the sample-rate, channels and format from the packet
parameters instead of the config.

Fixes #4400
2024-11-13 16:47:34 +01:00
Wim Taymans
e3a7035e8f spa: make helper to init spa_audio_info_raw from dict
Make a function that can initialize raw audio info from a dict and fill
in the defaults. We can use this in many of the modules when the audio
format is parsed.
2024-09-18 15:48:27 +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
cd81b5f39a spa: add spa_json_begin_array/object and relaxed versions
Add spa_json_begin_array/object to replace
spa_json_init+spa_json_begin_array/object

This function is better because it does not waste a useless spa_json
structure as an iterator. The relaxed versions also error out when the
container is mismatched because parsing a mismatched container is not
going to give any results anyway.
2024-09-16 09:50:33 +02:00
Wim Taymans
d9e7a10b0d modules: accept and produce UMP only 2024-07-30 09:38:40 +02:00
Wim Taymans
41691f8bc9 module-vban: fix some implicit float conversions 2024-06-18 16:05:36 +02:00
Wim Taymans
1ae4374ccf Fix compilation with -Werror=float-conversion
Better make the conversions explicit so that we don't get any surprises.

Fixes #4065
2024-06-18 12:17:56 +02:00
Wim Taymans
9a5609de2b modules: move some spa_debug_mem to the log
Instead of dumping to stderr, write it to the log file.
2024-01-11 17:49:50 +01:00
Wim Taymans
5e750f6fb8 modules: place floats in properties in JSON format
Using %f will result in a locale dependent format and might not parse
with JSON parsers or even our own spa_atof() function.
2023-12-14 11:50:30 +01:00
Wim Taymans
fc68fd2d4a module-vban: tweak rate adaption a little
Adapt quicker by increasing the bandwidth.

See #3380
2023-08-07 17:57:28 +02:00
Wim Taymans
2410660299 modules: add vban midi support 2023-08-01 12:54:19 +02:00
Wim Taymans
ce8f2c5d10 modules-vban: add vban sender and receiver
Fixes #3380
2023-07-25 18:36:48 +02:00