Commit graph

11952 commits

Author SHA1 Message Date
Wim Taymans
59fe89d41a 1.0.7 2024-05-24 11:12:36 +02:00
Wim Taymans
5ebb089bfa ffado: add priority.session property
It seems to be required to unselect it as default node in wireplumber.

Fixes #4023
2024-05-24 11:01:06 +02:00
Wim Taymans
3c9bd37fa1 acp: handle some errors better
Handle allocation failure and size overflow.
2024-05-24 11:01:06 +02:00
Pauli Virtanen
6ee9e62787 spa: fix integer overflows etc. in spa_pod_compare_value
Add macro SPA_CMP to do 3-way comparisons safely, and use it to avoid
signed integer overflows.

Fix also float/double comparisons (previously 0.1 == 0.8 since cast to
return type int).

Fix Id/Bool comparisons so they can return negative value.
2024-05-24 11:01:06 +02:00
Jonas Holmberg
9c1760a882 impl-port: update added flag from rt thread
Avoid trying to remove a port before it has been added.
2024-05-16 09:31:26 +02:00
Barnabás Pőcze
861578c4d5 pulse-server: client_queue_subscribe_event(): check message allocation 2024-05-16 09:30:50 +02:00
Wim Taymans
412b379138 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-16 09:30:04 +02:00
Wim Taymans
8eb93b4879 tools: queue the buffer again in all cases 2024-05-16 09:29:22 +02:00
Wim Taymans
1b8b683a6d 1.0.6 2024-05-09 10:06:02 +02:00
Wim Taymans
37a12fab82 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:11:50 +02:00
Pauli Virtanen
2335657343 bluez5: media-sink: keep one more buffer free
We delay the audio a bit to keep packet intervals equal, which keeps
some data in buffers.

In theory the calculation keeps one buffer free, but it doesn't
explicitly keep "extra" buffer space so in theory might flush too late
and next process() might not have free buffers.  However, as we encode
next packet right away this shouldn't really occur...

Try to keep one extra spare buffer free so that the flush time is
certainly early enough.
2024-05-06 18:21:33 +03:00
Pauli Virtanen
513495eaaa bluez5: drop queued data on node stop
Clear queued buffers when stopping consuming, to ensure that all buffers
are usable when we start again.

Do for A2DP as we already do for SCO.
2024-05-06 18:21:29 +03:00
Robert Mader
60deeb2555 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 09:53:50 +02:00
Barnabás Pőcze
cc88712ea6 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-06 09:53:42 +02:00
Barnabás Pőcze
3a912cbbb3 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-06 09:53:35 +02:00
Pauli Virtanen
bb54e32e8a json: fix high surrogate escapes
Surrogate escapes must add not or 0x10000, as the specified bits go up
0xfffff.
2024-05-06 09:53:08 +02:00
Wim Taymans
7002fe8ac3 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 16:24:41 +02:00
Robert Rosengren
3c450008d5 gst/src: fix crash when current_caps is NULL
gst_pad_get_current_caps may return NULL and passing that into
gst_caps_is_equal may result in fatal critical log due to the
"g_return_val_if_fail (GST_IS_CAPS (caps1)" check. Fix by checking for
NULL to avoid this.

(cherry picked from commit 95127d8a18)
2024-05-03 13:35:24 +00:00
Robert Mader
6ce298ffde gst/src: Avoid unnecessary renegotiations during streaming
Some clients like many camera apps, including Cheese or Snapshot,
trigger a lot of unnessecary renegotiations. While arguably that should
be solved on a Gstreamer level, we can help out by checking if the
preferred new caps are the same that are already in use and skip the
renegotiation in this case.

This allows several apps to e.g. take pictures without a slow and heavy
stream restart.

(cherry picked from commit e2e8cf7944)
2024-05-03 13:35:24 +00:00
Robert Mader
b53c93000c gst/src: Cleanups for src_negotiate()
Using `g_autoptr` and related modern helpers more often makes
the code smaller, easier to follow and maintain.
No behavior changes intended.

(cherry picked from commit 594e3fa09f)
2024-05-03 13:35:24 +00:00
Barnabás Pőcze
3cc0a405b2 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 12:13:15 +02:00
Barnabás Pőcze
6c7dabb1e7 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 12:12:59 +02:00
Wim Taymans
2d379bf908 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-03 12:12:35 +02:00
Barnabás Pőcze
f524271b81 treewide: fix errno assignments
Do not set `errno` to a negative value.
2024-05-03 12:12:05 +02:00
Lukas Rusak
1b115eaf31 alsa-pcm: don't force quantum for iec958 formats
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>
2024-05-03 12:10:54 +02:00
Pauli Virtanen
d3980f7cef journal: prepend code location to messages at debug log levels
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.
2024-04-29 16:30:06 +02:00
Wim Taymans
d810057310 module-rt: fix compiler warning
Fix warning about min/max potentially not being initialized.
2024-04-29 16:30:06 +02:00
Wim Taymans
3958eb5962 filter-chain: fix arguments of calloc 2024-04-29 16:30:06 +02:00
lunks
e757868cf9 combine-stream tag forward 2024-04-29 16:30:06 +02:00
Pedro Nascimento
99d342bd23 Add album to tag metadata 2024-04-29 16:30:06 +02:00
Wim Taymans
694409443f impl-node: avoid bitfield races
Move the bits that are used in the realtime thread away from the bits
from the main thread to avoid bitfield races. Move some fields in rt
structs to make it explicit that they are only to be modified from the
realtime threads.
2024-04-29 16:25:35 +02:00
Barnabás Pőcze
8a4ff447d9 treewide: fix some format string issues
Use the proper specifier, and cast to a known type where the type
is not guaranteed by any standard.

See #3975
2024-04-29 16:19:15 +02:00
Wim Taymans
a7a0e2072e conf: warn when match actions are missing 2024-04-29 16:17:34 +02:00
Stefan Ursella
0f0c9e8995 module-protocol-simple: handle 'node.name' property 2024-04-29 16:17:16 +02:00
Wim Taymans
976764514f module-ffado: only start after ports are configured
Don't start yet when the ports are pending configuration.

See #3968
2024-04-23 11:16:40 +02:00
Wim Taymans
594d255c5e context: fill basic properties early
So that we can use them in match rules, such as the application.name
etc.
2024-04-23 11:16:40 +02:00
Pauli Virtanen
cf646fb4dd combine-stream: fix latency-compensate with resample.disabled=true
When resample.disabled=true, which is now the default, Format has zero
rate, so latency buffers get zero size. The rate in this case is the
graph rate.

Fix by just using the delay in samples, as all streams must in any case
run at same rate for the combining to work.

Fixes: bff252ce60 ("combine-stream: actually make use of resample.disable")
2024-04-23 11:16:40 +02:00
Wim Taymans
a5727432c9 profiler: remove unused data-loop 2024-04-23 11:16:40 +02:00
Wim Taymans
5066ea9a72 v4l2: fix printf format 2024-04-23 11:16:40 +02:00
Ashok Sidipotu
7728586601 spa: v4l2: encode device id into a json array 2024-04-23 11:16:40 +02:00
Ashok Sidipotu
4c19da1127 spa: libcamera: encode device ids into a json array 2024-04-23 11:16:40 +02:00
Wim Taymans
aefe407d79 impl-port: avoid doing work when the port is destroyed 2024-04-23 11:16:40 +02:00
Wim Taymans
f65dd4e515 impl-port: use 0 size when clearing IO 2024-04-23 11:16:40 +02:00
Wim Taymans
edc4c856b7 stream: log a warning when media.class and direction mismatch
Fixes #2493
2024-04-23 11:16:40 +02:00
Wim Taymans
e9f0638a70 module-loopback: only enable delay with valid rate and channels
Or else we can't calculate the required delay buffer size and we might
even end up with a double free.

Fixes #3748
2024-04-23 11:16:36 +02:00
Wim Taymans
98f9529147 alsa: fix race when updating the eventfd
The eventfd is read/written from/to the data thread and the main thread
concurrently with the update_active() function.

Use an atomic compare and swap to make this update atomic and avoid an
inconsistency between the active boolean and the eventfd. This could
result in the eventfd being unsignaled while the active flag was true
and the application receiving a timeout and XRun in its poll loop.

Fixes #3711
2024-04-16 09:57:12 +02:00
Wim Taymans
17a2c21573 audioconvert: also clamp monitor volume to min/max
When we set a min/max value, also clamp the monitor volume to it.

Fixes #3962
2024-04-16 09:56:48 +02:00
Pauli Virtanen
bf148d59cd combine-stream: actually make use of resample.disable
resample.disable was made to default to true, but copying it to stream
properties was forgotten so it didn't have any effect. Make sure to copy
it.

This will also prevent different input/output streams from negotiating
to different rates, which would result to broken audio since we are just
passing sample data through.
2024-04-16 09:55:38 +02:00
Wim Taymans
a2287be601 1.0.5 2024-04-15 09:33:15 +02:00
Wim Taymans
b72ead1dea spa: handle empty values better
Make sure the properties are not empty before trying to access them.
2024-04-10 13:19:23 +02:00