Commit graph

3181 commits

Author SHA1 Message Date
Silviu Florian Barbulescu
8660066af6 Add suport for braodcast sink 2023-08-24 16:31:03 +00:00
Silviu Florian Barbulescu
c6760105df Fix problems found in the review. 2023-08-24 16:31:03 +00:00
Silviu Florian Barbulescu
b07bb4e106 Check if the adapter supports bap broadcast before registering the broadcast endpoint. 2023-08-24 16:31:03 +00:00
Silviu Florian Barbulescu
e2fa5537f7 Add support for bluez5.roles for broadcast source. 2023-08-24 16:31:03 +00:00
Silviu Florian Barbulescu
decbeed2c4 Create the fake device with the actual adapter DBus path. 2023-08-24 16:31:03 +00:00
Silviu Florian Barbulescu
ef3fac401d bluez5: Add LE Audio BAP broadcast source support
Once Pipewire is started it will try to register a BAP broadcast source media endpoint on UUID 00001852-0000-1000-8000-00805f9b34fb if the media codec that supports BAP and the adapter indicates LE Audio is supported.
When the endpoint is detected (over DBus) by Pipewire and it has a broadcast sink UUID, a new device will be created with the address 00:00:00:00:00:00. This device will be our simulated remote device. This is done because a broadcast source emitting device does not need any connection to start transmitting the audio. This device is set as connected.
When the SetConfiguration DBus method is called and the spa_bt_transport structure with the profile BAP broadcast source is created we switch the device from the one read from DBus to the one created by us. This is done because in BlueZ, when the transport is created, at the Device property, BlueZ sets the adapter as the device that the transport is connected to. Here the device will have the newly created SPA_BT_PROFILE_BAP_BROADCAST_SINK profile connected.
Added code that allows to create a node in the graph for a device connected to the SPA_BT_PROFILE_BAP_BROADCAST_SINK profile.
2023-08-24 16:31:03 +00:00
Wim Taymans
b54f7fe90d audioconvert: fix typo in neon function
Thanks to Shengjiu Wang

fixes #3463
2023-08-24 13:45:11 +02:00
Wim Taymans
d08d05629b alsa: reflow some code
Move common code outside the if branches.
Only do the batch and timer stuff when using timers.
2023-08-23 13:56:20 +02:00
Pauli Virtanen
dbd97020da bluez5: fix BAP profiles showing
Now that we only show codec profiles, the logic that showed codecless
profile for BAP has to be removed.

This fixes BAP only showing off profile.
2023-08-23 10:07:15 +00:00
Roman Lebedev
4694b48b7b alsa-card-profiles: simplify adding custom profiles
It is sometimes useful to add a custom profile-set.
For that, e.g. `default.conf` needs to be modified.
(at least, i have not succeeded in just adding a new file)

But that change gets overridden when the package is updated,
which could be *extremely* dangerous, e.g. if said profile
changed the `volume-limit`.

By shipping an "empty" `9999-custom.conf`,
the update becomes less problematic,
because one can now use e.g. `dpkg-divert` on said file.

Refs. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050293
2023-08-23 10:06:16 +00:00
Wim Taymans
b9d78d5992 audioconvert: add queued input to the delay
The input that we have queued will also add to the resampler delay.

Fixes #3454
2023-08-22 13:06:10 +02:00
Wim Taymans
07b8954dc8 v4l2: handle inotify errors
Handle inotify errors and remove the source.

See #3439
2023-08-21 16:27:00 +02:00
Ashok Sidipotu
cd24fe2fe9 bluez5: A2DP and BAP profiles to enumerate only codec profiles
This avoids the potential confusion when both codecless and codec profiles are
enumerated for A2DP.
Give base name to highest priority profile, so that best codec can be selected
at command line with out knowing which codecs are actually supported.
2023-08-21 08:21:37 +00:00
Pauli Virtanen
8f6d266632 bluez5: reacquire transport always for playing for A2DP
Some A2DP devices don't like reusing the same transport for different
media-sink instances, possibly because encoder is reset in between and
there can be a gap in transmitted audio.

This doesn't matter for SCO/ISO.
2023-08-18 15:07:01 +00:00
Wim Taymans
f5d1d7e683 evl: fix timerfd read
It should read uint64_t now.

Tested: Jorge Ramirez-Ortiz <jorge@foundries.io>
2023-08-09 12:46:20 +02:00
Jorge Ramirez-Ortiz
ea0e92c5d9 meson: change EVL include paths 2023-08-09 12:09:30 +02:00
Wim Taymans
ba7af15cb2 evl: Use complete API to create xbufs
So that we can set nonblock directly.

Tested: Jorge Ramirez-Ortiz <jorge@foundries.io>
2023-08-09 12:06:24 +02:00
Arun Raghavan
86bd0eb708 logger: Add a mechanism to force colourised logging
This is handy if we want to redirect to a file but have colours to make
manual parsing easier (for example with `less -R`).
2023-08-08 17:13:31 +00:00
Jorge Ramirez-Ortiz
17cda59478 evl: update to Xenomai4 r46
Fix build issues.

Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
2023-08-08 19:09:39 +02:00
Wim Taymans
091b5497a3 acp: try to set a verb before probing pro-audio devices
Some UCM devices need to be configured with a verb before we can try probing
the pcms. Find the highest priority verb and set that.
2023-08-07 12:56:24 +02:00
Wim Taymans
71262da6d7 audioconvert: remove requirement for data_loop
We just need to get a timestamp so that we can do the rate limiting, we
don't need anything accurate from the data_loop.
2023-08-01 18:20:04 +02:00
Wim Taymans
536129343a audioconvert: rate limit the out-of-buffer logging
See #3384
2023-08-01 15:06:28 +02:00
Wim Taymans
35d932bc8b audioconvert: only dequeue a buffer when queued
Add an extra check to only dequeue a buffer when it's queued. This
should always be the case but let's check again to be safe.

See #3384
2023-08-01 15:04:31 +02:00
Wim Taymans
88f0dbd6fc v4l2: don't set inotify on /dev
Doing inotify on /dev is not a good idea because we will be woken up by
a lot of unrelated events.

There is a report of a performance regression on some IO benchmark
because of lock contention within the fsnotify subsystem due to this.

Instead, just watch for attribute changes on the /dev/videoX files
directly. We are only interested in attribute changes, udev should
notify us when the file is added or removed.
2023-07-31 13:16:17 +02:00
Wim Taymans
fd585baa88 alsa: don't change avail when unchanged
Only update the avail when we did a snd_pcm_forward(). Otherwise
we might think there is more available than there really is and we
might get xrun.

See #3395
2023-07-31 12:10:36 +02:00
Barnabás Pőcze
07c574160c spa: bluez: backend-hsphfpd: actually free endpoint
Previously, `endpoint_free()` did not free the `struct hsphfpd_endpoint`
object itself, only its contents. Fix that.
2023-07-30 21:42:49 +02:00
Barnabás Pőcze
486d759fa9 spa: bluez: backend-hsphfpd: remove unnecessary NULL checks
`free()` already does a NULL check; and there is no reason
to have those NULL checks inline.
2023-07-30 21:41:41 +02:00
Barnabás Pőcze
4083502e03 spa: bluez: use some more spa_auto* 2023-07-30 13:45:49 +02:00
Barnabás Pőcze
ca85872e83 spa: bluez: use spa_auto for DBusError 2023-07-30 13:45:49 +02:00
Barnabás Pőcze
b52d590936 spa: bluez: add send_with_reply() dbus helper
This function sends a DBusMessage on a DBusConnection
and sets the reply callback of the resulting DBusPendingCall,
as well as properly cancelling the pending call if anything fails.
2023-07-30 13:45:49 +02:00
Barnabás Pőcze
6e581deb91 spa: bluez: use spa_autoptr for DBusMessage 2023-07-30 13:45:49 +02:00
Wim Taymans
dd78f3d5f7 alsa: disable htimestamp by default
It seems there are drivers that don't return a good values and we end up
with a lot of delay or automatic disable of htimestamp when the values
look too off.
2023-07-26 10:32:53 +02:00
Wim Taymans
ad1a36a718 audioconvert: add option to disable volume updates
Add channelmix.lock-volumes. When set to true it will disable volume
updates until set back to false.

See #3361
2023-07-25 12:36:23 +02:00
Wim Taymans
8eb1d8f2ac dbus: add some more debug 2023-07-20 10:15:30 +02:00
Wim Taymans
ab1436fb3b audioconvert: improve EMPTY flag on output buffers
Only set the EMPTY flag on output buffers if we don't have any
previously queued samples and the input is EMPTY.

Fixes #3365
2023-07-19 21:39:25 +02:00
Wim Taymans
f99fd7d75a improve some debug 2023-07-19 21:39:12 +02:00
Robert Mader
5bac089229 spa: libcamera: add libcamera version check for properties::SystemDevices 2023-07-19 09:21:03 +00:00
Ashok Sidipotu
6cd29aed05 spa: v4l2: get the device number of the v4l2 device
This value can be used in filtering the camera devices in consultation with
libcamera
2023-07-19 09:21:03 +00:00
Ashok Sidipotu
79518d13ae spa: libcamera: consume the device numbers libcamera property
Pass on the device numbers property of libcamera to session managers, with they
are better equipped to filter the camera/video devices across v4l2 and libcamera.
2023-07-19 09:21:03 +00:00
Barnabás Pőcze
146665893e spa: bluez: upower: keep track of pending call
Keep track of the DBusPendingCall and cancel it when being destroyed,
furthermore, create `update_battery_percentage()` and don't duplicate code.
2023-07-15 01:08:24 +02:00
Barnabás Pőcze
708e5443ae spa: bluez: add steal_reply_and_unref() helper
This function retrieves the reply from a DBusPendingCall and unrefs the call.
2023-07-15 01:04:23 +02:00
Barnabás Pőcze
183270f53c spa: bluez: add cancel_and_unref() dbus helper
This function cancels and unrefs a DBusPendingCall and
resets the pointer to NULL.
2023-07-15 01:04:22 +02:00
Barnabás Pőcze
1025d5c600 spa: bluez: remove some unused DBusErrors 2023-07-15 00:55:31 +02:00
Barnabás Pőcze
10f1b6c13c spa: bluez: backend-hsphfpd: use const char * for string literal 2023-07-14 22:35:36 +02:00
Barnabás Pőcze
667703e27d spa: bluez: backend-native: remove unnecessary array of DBusMessageIter 2023-07-14 22:35:35 +02:00
Barnabás Pőcze
66014e5828 spa: bluez: backend-native: fix DTMF string leak 2023-07-14 18:20:07 +02:00
Barnabás Pőcze
33a5c4ba10 spa: bluez: fix spelling of HAVE_REALLOCARRAY feature macro
It should have two `R`s not three.
2023-07-14 18:20:07 +02:00
Barnabás Pőcze
abe8c3581f spa: bluez: free spa_bt_transport::configuration
`spa_bt_transport_free()` did not free `spa_bt_transport::configuration`,
so fix that.
2023-07-13 21:27:53 +02:00
Wim Taymans
dc07c2321b spa: add spa_ratelimit 2023-07-11 19:25:35 +02:00
Barnabás Pőcze
fe45786a5d treewide: add some examples for the spa_auto* macros 2023-07-11 14:23:53 +02:00