Commit graph

40 commits

Author SHA1 Message Date
Wim Taymans
93ee66dcab netjack2: Improve docs
Remove unused option.
Clarify that channels and midi port are chosen by the server.

See #4666
2025-04-28 11:12:48 +02: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
Pauli Virtanen
ec5684302c doc: in user-facing config examples, indicate which file it goes into
Add suggestions for config fragments in config file examples, as
applicable.
2024-09-16 15:51:59 +00: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
0ecac098c7 modules-netjack2-driver: add source.ip and source.port
Instead of binding the socket to 0.0.0.0 with port 0, make some config
options source.ip and source.port to configure this. This makes it
possible to bind to other interfaces or to use a fixed port for the
data messages.

Fixes #4144
2024-08-29 12:44:53 +02:00
Wim Taymans
d9e7a10b0d modules: accept and produce UMP only 2024-07-30 09:38:40 +02:00
Wim Taymans
b5a7a1f224 module-netjack2: improve port names
Let the default port logic make the port names. For network nodes this
will be with a send/recv prefix.
2024-07-19 11:42:51 +02:00
Wim Taymans
c73b56db38 fix compilation 2024-07-18 14:24:53 +02:00
Wim Taymans
280bbd88d4 modules: don't unload module on stream error
Unloading the module on stream errors is a bit too much because a
suspend can clear the stream error again (or the error might not be
fatal)

This can happen for example when negotiation fails on some stream ports
(wireplumber tries to link the midi ports to audio ports) and it's
better to not completely fail on that.

Fixes #4121
2024-07-18 14:15:22 +02:00
Wim Taymans
c3d4abd7f1 modules: use acquire/release loop
Expose the acquire_loop/release_loop functions and use them in the
modules.

Make sure the nodes created from the module use the same data loop as
the module. We need to ensure this because otherwise, the nodes might
be scheduled on different data loops and the invoke or timer logic will
fail.
2024-04-22 16:19:02 +02:00
Wim Taymans
f2f60ee0ec jack-tunnel: convert JACK time to MONOTONIC
JACK current_msec can be in MONOTONIC_RAW or MONOTONIC, depending on how
JACK was compiled (but it's likely MONOTONIC_RAW). PipeWire requires the
nsec field to be in MONOTONIC so take some time snapshots from both
clocks and apply a translation.

Also make sure we only get the nsec time from streams that exist.

See #3886
2024-03-04 15:34:42 +01:00
Wim Taymans
f4e391dd41 stream: add pw_stream_get_nsec() to get current time
Make a method to get the current time to compare agains the pw_time-now
field. This is currently CLOCK_MONOTONIC but make this into a method
so that we can more easily change it later.
2024-03-04 12:59:26 +01:00
Wim Taymans
c0966f026a modules: prefix network-utils methods with pw_net 2024-02-26 15:17:48 +01:00
dsee
4888b35284 Support IPv6 link-local addresses
Use `getaddrinfo` in `parse_address` instead of `inet_pton`.
Display Ipv6 addresses with scope identifiers correctly in `get_ip`
functions using `if_indextoname`.
2024-02-25 18:20:54 +00:00
Wim Taymans
a59a551202 module-netjack2: improve channel positions
If the manager gave us a different channel count than we had by
default or configured, assume everything is AUX channels.

Also handle the case where the manager is sending more than our
MAX_CHANNELS channels.
2024-01-25 17:59:39 +01:00
Wim Taymans
d0a2e6316b spa: small cleanups
Initialize result variable.
Use strncpy to avoid warnings about using non-NULL terminaded strings.
2024-01-10 15:51:01 +01:00
Wim Taymans
de954655bc modules: fix doc 2023-11-22 17:48:05 +01:00
Pauli Virtanen
fdcb02ed75 modules: add Module Name section to the module reference docs 2023-11-20 08:41:13 +00:00
Pauli Virtanen
eca773fc12 modules: strip "PipeWire Module:" from Doxygen page name
Make them appear nicer in the output.
2023-11-19 16:39:15 +00:00
Wim Taymans
4bb3e292c5 netjack2: remove hardcoded buffer size 2023-10-13 13:40:22 +02:00
Wim Taymans
b094057b0b handle NULL latency param
Fixes #3504
2023-09-13 11:13:48 +02:00
Wim Taymans
5e2a7dbc4e modules: remove include of private.h
Remove some includes of private.h
Add some methods to get the mempool of client and context so that we can
remove direct access.
Move some things around.
Use methods to get pw_loop variables.

See #3243
2023-07-11 19:31:27 +02:00
Barnabás Pőcze
34809d3081 pipewire: module-netjack2-driver: remove unused module_schedule_destroy() 2023-07-03 19:40:31 +02:00
Wim Taymans
da86c2030c module-netjack2: improve OPUS fallback 2023-06-12 18:37:47 +02:00
Wim Taymans
0cfd94eb52 module-netjack2: support int and opus in driver 2023-06-12 17:40:16 +02:00
Wim Taymans
19f3e422e1 module-netjack2: add int support 2023-06-12 17:01:13 +02:00
Wim Taymans
8dfb22d12b module-netjack2: add opus support 2023-06-12 11:44:50 +02:00
Wim Taymans
9dd5bab535 module-netjack2: add MIDI send and receive 2023-06-08 16:38:53 +02:00
Wim Taymans
04e17a8b1c module-netjack2: handle driver reconnect
Let the driver keep announcing.
Keep track of when a message was received in the driver. If we don't
receive anything for a while, reconnect.

Don't connect twide in the manager.
2023-06-05 13:30:16 +02:00
Wim Taymans
f2a0df9ac2 module-netjack2: lock and force rate and quantum 2023-06-05 10:36:08 +02:00
Wim Taymans
407ee3940c module-netjack2: set latency param 2023-06-05 10:21:18 +02:00
Wim Taymans
cc82715325 module-netjack2: refactor
Move common code to a separate file.
2023-06-05 10:20:43 +02:00
Wim Taymans
7bd74a67f4 module-netjack2: use frames from graph and sync
The params are the initial period_size, use the ones used to
encode the packets.
2023-06-02 15:43:34 +02:00
Wim Taymans
629e322fac module-netjack2: clear empty buffers 2023-06-02 15:09:31 +02:00
Wim Taymans
287566937e module-netjack2: improve node names 2023-06-02 13:31:38 +02:00
Wim Taymans
2988d9c831 module-netjack2: small improvements
Improve node properties
Improve module parameters and docs
Send send and recv buffer sizes.
Stop follower on connection errors.
2023-06-02 13:24:49 +02:00
Wim Taymans
9727bf3c4b modules: fix some compiler warnings 2023-06-01 19:01:25 +02:00
Wim Taymans
f8aa18c88b module-netjack2: small improvements 2023-06-01 18:36:07 +02:00
Wim Taymans
991a1558dc module: add a netjack2 driver module
The module advertizes itself on multicast and will trigger a new client
in the netjack2 manager. Tested with jack2 and 'jack_load netmanager'.

The driver will receive and send data (no midi yet) from and to the
manager in sync with the manager, without resampling and with a fixed
latency.
2023-05-31 17:22:05 +02:00