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
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.
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.
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.
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.
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.
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.
`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")
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
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.
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
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.
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.
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.
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
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.
This fixes an issue introduced in 771f71f622
where the quantum is forced and may break applications the specify their
own quantum.
Signed-off-by: Lukas Rusak <lorusak@gmail.com>
Because we now have a dedicated queue per thread, we can simply add our
invoke item to the queue and then flush all the queues when we are
running in the thread of the loop.
This simplifies some things and removes potential out-of-order messages
that got queued while flushing.
Keep a thread local queue. This makes it possible for multiple threads
to write to the ringbuffer.
There is a lock to protect the list of queues. It can only be contended
when new queues are created in the threads but this can be done at
thread startup.
Fixes#3983
Make an internal queue object that implements the invoke queue.
Because we can not do invokes concurrently from different threads, this
is required to make per-thread invoke queues later.
Debug and trace log messages are often written based on the stderr
logging, where code location is always visible.
journalctl does not show the code location without extra tricks,
which makes user-submitted debug logs from journal more cryptic.
Make journal log more similar to stderr logs by prepending the code
location and log level in the log message when the log topic
level is >= DEBUG.