Commit graph

12475 commits

Author SHA1 Message Date
Silviu Florian Barbulescu be3e87f485 Add code to fix problem found at review 2024-05-15 08:11:50 +00:00
Silviu Florian Barbulescu 2bff4a9337 bluez: Configure the BlueZ broadcast source
This is the first draft where the configuration is done based on BIS information loaded from the config file.
2024-05-15 08:11:50 +00:00
Arun Raghavan db365ac855 impl-node: Expose driver id in node.props
Makes it easier for clients to track what the current driver of a node
is.
2024-05-14 20:04:13 +00:00
Wim Taymans 78fbe6f750 protocol-simple: add per stream properties and formats
Add capture.props and playback.props to configure the created streams
with arbitrary properties.

Improve format parsing, make it possible to have different formats peer
stream.

Improve some of the property handling.

This can now also be used to upload a stream to a snapcast server, add
an example of this to the docs.
2024-05-14 17:30:05 +02:00
Wim Taymans 37224ac84c alsa-seq: configure pool sizes better
The default kernel pool size on the input is 200 cells. A cell is
about 28 bytes long so the maximum message that can be received in one
go is about 5600 bytes. This causes problems when using amidi to upload
larger sysex messages because they simply can't be received by the
sequencer.

It if however possible to increase this limit with the set_client_pool()
function. Increase the pool size to at least the quantum_limit * 2.
This ensures we can receive and send at least 2 quantums of raw data,
which should be a fairly long sysex message.

Make a min and max value for the pool size. There is an upper limit of
2000 in the kernel but make this configurable and clamp the final
pool size to the min/max.

Make the MAX_EVENT_SIZE 256, because this is how the sequencer seems to
splits the input data as well and it results in less wasted space in the
output buffer.

See #4005
2024-05-13 15:25:52 +02:00
Wim Taymans ea0ba1162e alsa-seq: warn when receive fails
This can happen when allocation fails or the message is too long.
2024-05-13 15:17:21 +02:00
Wim Taymans cdc150a2c3 jack: copy events to right offset
The larger events need to be copied into the target buffer at the same
offset as the source buffer or else we overwrite the header and make
a corrupt buffer.
2024-05-10 12:15:36 +02:00
Wim Taymans 89edb9f6c5 control: use quantum_limit for midi buffer size
Instead of the arbitrary default.
2024-05-10 11:49:31 +02:00
Wim Taymans 7e87bd9b34 alsa-seq: try to not overflow the output buffer
Keep some room in the output buffer to store the worst case event
and save it for the next cycle.
2024-05-10 11:33:44 +02:00
Wim Taymans e897a8afc4 control: warn when we overflow the control buffer 2024-05-09 19:33:30 +02:00
Wim Taymans d7df3811e1 tools: queue the buffer again in all cases 2024-05-09 19:32:37 +02:00
Wim Taymans cb8330c798 alsa-seq: handle large control events
Handle the case where the control event is large and needs to be
encoded into multiple midi events.
2024-05-09 18:49:00 +02:00
Wim Taymans 7dcfe81690 alsa-seq: improve midi encode some more
snd_midi_event_encode() will reset the encoder when it returns an
encoded event. It is possible that the function returns with an encoded
event when the internal buffer is full, in that case we need to push the
event and continue encoding without reseting the encoder.

0 is not a snd_midi_event_encode() error, so don't handle it like
one.
2024-05-09 18:32:14 +02:00
Wim Taymans 1c056661b6 alsa-seq: handle fragmented midi messages
The messages, mostly sysex, can be split over multiple control message.

This happens when we read large messages from the sequencer, the
snd_seq_event_input function returns split messages that we transfer to
control messages directly.

When we send those messages out, however, the encoder wants the complete
message before it will return a valid event that we can send out. Keep
on calling the encoder with the control events until we get a complete
message that we can send out.

Fixes #4005
2024-05-09 16:18:29 +02:00
Wim Taymans 050976adf6 control: also handle ANY ports for enum_param 2024-05-09 15:23:50 +02:00
Wim Taymans 1c900707a8 v4l2: add bus_info in v4l2_capability if we have it 2024-05-08 17:48:00 +02:00
Wim Taymans b2844201c2 impl-node: update rt flags from rt threads
Update the added and prepared flags from the rt thread.

We also need to check if the node was prepared before we can schedule
it.
2024-05-08 17:14:32 +02:00
Wim Taymans 8b23a8a89e loop: flush items in the order they were added
Add a count to each invoke item that is updated with an increasing
loop atomic counter. Flush items from the queues based on their count
so that items are flushed in the order they were added even if they
were added to different queues.
2024-05-08 12:21:54 +02:00
Wim Taymans fac0d47c23 impl-port: swap io areas instead of doing cycle math
Instead of doing (cycle+1) & 1 for output ports, simply swap the io
areas depending on the port direction (0 = input, 1 = output) and
just to cycle&1 for all ports.
2024-05-08 10:45:53 +02:00
Wim Taymans 03d62dc756 impl-port: input ports read from io cycle & 1
Input ports read from the async buffer cycle & 1 and output ports write
to (cycle + 1) & 1
2024-05-08 10:45:53 +02:00
Sanchayan Maity 9d94db6646 parametric-equalizer: Use field widths in sscanf 2024-05-07 15:43:10 +05:30
Sanchayan Maity 6c6f944e53 Fix doc build pipeline failing with parametric-equalizer module 2024-05-07 09:04:15 +00:00
Wim Taymans dd84557bfb doc: update some more 2024-05-07 11:03:22 +02:00
lunks 722ad358d0 Apply 1 suggestion(s) to 1 file(s) 2024-05-07 08:57:24 +00:00
Cedric Sodhi 34fd3fe2ad Restructured overview.dotx
Merged the information of the original with the didactic structure and overview by Théo Lebrun/bootlin.com.
2024-05-07 08:57:24 +00:00
Wim Taymans 62aa77d469 alsa: remove racy atomic operations
The atomic operations were used in an attempt to limit the amount of
wakeups done on the eventfd. It's however racy and causes trouble in
some cases.

Remove the atomic operations all together, it's probably not worth
optimizing this too much.
2024-05-07 10:07:30 +02:00
Sanchayan Maity 68ed40570d Add a module for loading Parametric EQ
Websites like squig.link or https://www.autoeq.app/ generate a file for
parametric equalization for a given target, but this is not a format
that can be directly given to filter chain module.

This module translates the file to filter chain module arguments and
then loads the filter chain module with these arguments.
2024-05-07 11:37:48 +05:30
Pauli Virtanen 1717b1bebc doc: document some more audioconvert properties 2024-05-06 18:16:07 +03:00
Wim Taymans 6ab10237cd alsa: use semaphore semantics for the eventfd
Because we write from multiple threads, a thread might write a second
wakeup and a concurrent thread might remove all wakeups before seeing
it's error and retrying, which would leave the eventfd in a wrong state.

With a semaphore, things balance out and the eventfd always ends up in
a consistent state.
2024-05-06 16:26:06 +02:00
Wim Taymans a30c27dce0 pulse-server: add pulse.allow-module-loading option
Add an option to disable loading and unloading of modules with the
native protocol.

Document some more options.
2024-05-06 15:28:43 +02:00
Wim Taymans a3ccbd00b4 pulse-server: implement describe-module with core message
Implement the old pacmd describe-module command with a core message:

pactl send-message /core pipewire-pulse:describe-module
module-echo-cancel
2024-05-06 11:39:52 +02:00
Robert Mader b3ff293263 spa: libcamera: fix RGB mappings
Libcamera formats are generally little-endian, matching DMA DRM
fourccs, while PW ones are big-endian. Thus we have to invert the
order.

Only RGB and BGR where tested, as these are the formats currently
supported by the software ISP. This fixes inverted red and blue in
Snapshot on the Librem5 and Pinephone (OG).

See also gstlibcamera-utils.cpp in libcamera.
2024-05-06 07:41:33 +00:00
Barnabás Pőcze 6d7b0284dd pw-dump: destroy all objects not just those matching the pattern
`registry_event_global()` creates an `object` object for every object,
not just those matching `data::pattern`. However, previously
`registry_event_global_remove()` only destroyed those objects
that matched the given pattern. Fix that by destroying
every object.

Fixes #4001
Fixes 47e1f38f03 ("pw-dump: also dump object removal")
2024-05-05 16:39:42 +02:00
Barnabás Pőcze 0c0d520c32 pw-dump: fix string memory leak on error
`object::type` was not cleared in the error path. Fix that
by calling `object_destroy()`, which takes care of it.
2024-05-05 16:38:40 +02:00
Pauli Virtanen f0bfb5ca84 gitattributes: mark test/data/*.txt as text files
They are text files as far as diff is concerned, although contain
invalid utf-8.
2024-05-05 15:17:39 +03:00
Pauli Virtanen 22ac5f85cc json: fix high surrogate escapes
Surrogate escapes must add not or 0x10000, as the specified bits go up
0xfffff.
2024-05-05 15:15:54 +03:00
Pauli Virtanen eea18a8a8a test: fix loading json test data
Multiline results were not loaded correctly.
2024-05-05 09:32:43 +00:00
Stefan Ursella 9c31cf1271 alsa: read hw synced ring buffer position when caller is not the same pcm
When the caller is a different pcm it is not shure that the
IRQs are synchronised. So read the real ring buffer position.
2024-05-05 09:31:54 +00:00
Wim Taymans 056d826c59 core: handle import errors better
Check for NULL when importing a buffer and log a message instead of
trying to deref the NULL pointer and crash.

Add some more logging to mem when importing a bad fd.

See #3998
2024-05-03 15:56:13 +02:00
Tristan Cacqueray 47a71325d6 pw-mon: Add --print-separator option to help streaming parser
When processing the output of pw-mon in real time, it is presently
difficult to know when an event is completed because the last attribute
or property is different for each type of event.

This change corrects that by terminating each event with an empty new line.
2024-05-03 07:10:03 -04:00
Wim Taymans f73d3e4af9 stream: copy position before going to STREAMING
So that get_time_n will return values as soon as we go to STREAMING.

Fixes #3995
2024-05-03 11:53:15 +02:00
Wim Taymans 88e9f7683c conf: an empty condition should evaluate to true
An empty match rule matches nothing and evaluates to false but an empty
condition should evaluate to true.
2024-05-03 10:57:02 +02:00
Barnabás Pőcze 0b3a27b208 pw-mon: fix type confusion in core event handler
All pw_core event handlers (`on_core_*()`) currently receive a pointer
to `struct data`, not `struct proxy_data`; as can be seen from the
`pw_core_add_listener()` call in `main()`.

Fixes: cacdcc1b62 ("pw-mon: add filter param to hide props and/or params")
Fixes #3997
2024-05-03 07:18:43 +00:00
Barnabás Pőcze da1dbc1120 treewide: fix C++20 compilation error wrt. designated initializers
C++20 introduced designated initializers similar to the ones found
in C99, however, in C++ designated initializers cannot be mixed
with non-designated initializers. GCC rejects mixed initializers
with an error.
2024-05-03 07:16:57 +00:00
Barnabás Pőcze 2bc5d0914d gst: fix stream params memory leak
Both the GPtrArray and its contents are leaked in case of success.
`pw_stream_connect()` copies the params as needed, so use `g_autoptr()`
to free the array and with it, its contents.
2024-05-03 07:15:19 +00:00
Wim Taymans c8efa0fae2 context: use first data-loop class when unset
When a node does not specify a data-loop class, use the class of the
first data loop. This makes the nodes spread out over the first
(default) data-loop class.
2024-05-02 09:33:38 +02:00
Wim Taymans 3e760ea7d7 gst: handle some more errors
The threadloop might fail to create because of missing plugins, so
handle that.

The context might fail to create because of some fatal config error or
missing plugin, handle that too instead of crashing.

See #3994
2024-05-01 20:31:39 +02:00
Pauli Virtanen 44d958d397 pulse-server: show warning about snap kernel features only once
Don't spam the warning about kernel missing features required for snap
on every pulseaudio connection, but instead show it only once, as the
situation is not going to improve.
2024-05-01 13:17:31 +03:00
Barnabás Pőcze d80989ab56 treewide: fix errno assignments
Do not set `errno` to a negative value.
2024-05-01 09:28:17 +00:00
Wim Taymans 7e26fa57e5 impl-node: ensure same data loop inside the node
Make sure the loop used to load the spa plugin matches the loop of the
impl-node and the port mixer loops.
2024-04-30 18:02:59 +02:00