Commit graph

1376 commits

Author SHA1 Message Date
Frédéric Danis
f464d8c596 bluez5: Fix NULL dereference in backend-native
Fixes: #602
2021-01-22 15:28:21 +00:00
Wim Taymans
73896bfa83 alsa: rework batch handling a bit
By default, use a 512 period for batch and use 512 headroom
Add a property to disable special batch handling.
2021-01-21 17:14:51 +01:00
Wim Taymans
af092a9a7e v4l2: respect allowed data types
Check if we can do DmaBuf as the data type before we attempt this.
Otherwise we don't get any data in clients that can't deal with
DmaBuf.
2021-01-21 16:04:37 +01:00
Wim Taymans
d82066e49f acp: sync with pulseaudio 2021-01-19 10:52:28 +01:00
Wim Taymans
88727afbd2 resample: take already queued sample into account
When asking for samples, take into account the amount of samples
we already have converted.
2021-01-18 15:09:54 +01:00
Wim Taymans
51d44e9154 test: improve resampler test
Test with different amount of input samples.
2021-01-18 15:08:23 +01:00
Wim Taymans
d9a63dc69f alsa: disable pause-on-idle by default
snd_pcm_drop() causes pops and cracks. It is better to just let the
sink consume silence until it gets suspended.
2021-01-18 11:13:48 +01:00
Wim Taymans
19be555fa6 audioadapter: run the converter after follower drained
When the follower drained, rerun the converter again to let it drain
as well.
2021-01-18 10:29:50 +01:00
Wim Taymans
9b9b85ddbf alsa: put card name in udev monitor event
So that we can use it to construct a good name for the card.

Fixes #524
2021-01-17 11:35:27 +01:00
Wim Taymans
02295c5e2b alsa: call prepare again but ignore EBUSY
Not calling _prepare can cause problems on my card. So call it
again but ignore -EBUSY.
2021-01-15 18:42:35 +01:00
Wim Taymans
6b0abd2057 channelmix: Improve unknown channel layout handling
Clamp position to valid range. so that AUX becomes UNKNOWN.
If we have one mono source channel and unknown destination, copy it
to all destination channels.
If we have one mono destination channel and unknown source layout,
average all channels.
Otherwise, pair source and dest channels.

See #538
2021-01-15 17:51:07 +01:00
Wim Taymans
376436fc2c alsa: remove snd_pcm_prepare() call, it is not needed
set_hw_params already called _prepare for us and calling it twice
might cause trouble in some drivers.

See #580
2021-01-15 16:12:42 +01:00
Wim Taymans
482f96a644 alsa: add option to disable mmap access mode 2021-01-15 15:44:22 +01:00
Wim Taymans
2ff4615e53 alsa: prefer planar formats
They are easier to convert
2021-01-15 15:18:39 +01:00
Wim Taymans
d7ff7d098b audioadapter: don't emit xrun when drained 2021-01-15 09:46:17 +01:00
Wim Taymans
a8faad9f17 fmt: support f32p -> s24s conversion
As used by MAudio Fasttrack Pro

See rhbz#916017
2021-01-14 17:58:54 +01:00
Wim Taymans
be107317f5 Silence some dbus errors
Log info when a service is not running and disable it.
2021-01-14 17:11:42 +01:00
Wim Taymans
7347b5ef05 alsa: add api.alsa.headroom setting
Can be used to tweak the extra distance kept between the hardware
and software pointers when reading and writing.

See #289
2021-01-14 17:10:05 +01:00
Wim Taymans
abe73c9146 meson: use global b_pie to build PIE executables 2021-01-14 16:29:32 +01:00
Frédéric Danis
1b10bee6f8 bluez5: Fix double free in backend-native
This occurs when exiting `pipewire-media-session` with a headset connected.

Fixes !395
2021-01-14 15:16:31 +01:00
Wim Taymans
c9354c238f Add -fPIE to installed executables
Fixes #570
2021-01-13 19:40:37 +01:00
Frédéric Danis
514836eebe bluez5: Create spa_bt_transport when codec has been negotiated
This waits for codec negotiation completion, i.e. on `SLC` completion if
codec negotiation is not supported or on `AT+BCS` reception if codec
negotiation is supported, before creating the `spa_bt_transport`
2021-01-13 17:35:57 +01:00
Sebastian Apel
8ac5a89583 bluez5: Added mSBC support in bluze5 backend native, including check to make sure the computer's bluetooth adapter
supports the transport modes required for mSBC
2021-01-13 11:20:22 +01:00
Frédéric Danis
7bd86df6df bluez5: Add simple HFP AG support to backend-native 2021-01-12 11:21:55 +01:00
Frédéric Danis
677f122f1d bluez5: Split RFComm from spa_bt_transport
RFComm channel should not be part of the spa_bt_transport as this one may
change during HFP connection.
2021-01-12 11:21:55 +01:00
Frédéric Danis
00cce32514 bluez5: Rename backend-hsp-native to backend-native 2021-01-12 11:21:55 +01:00
Nicolai Syvertsen
09a690b123 spa-acp-tool: fix set-volume vol argument parse 2021-01-11 22:26:30 +01:00
Wim Taymans
b3f8a4b99b acp: update pcm proplist for UCM as well
Update the properties we get from the pcm handle right before we
close the handle.
Also set properties on the UCM devices.

See #524
2021-01-11 15:39:48 +01:00
Wim Taymans
6a9552a4ac acp; fall back to default when profile-set is not accessible 2021-01-11 13:05:11 +01:00
Wim Taymans
ac861a86c0 acp: make it possible to pass properties to test tool
So you can do:

spa-acp-tool -c 1 -p 'device.profile-set=behringer-umc202.conf'
2021-01-11 11:44:13 +01:00
Wim Taymans
dea4836203 alsa-pcm: always start device
Also start device after writing silence.

Fixes #558
2021-01-11 07:11:09 +01:00
Wim Taymans
4d15df6f24 bluez5: improve device and node properties
Set form factor, name routes based on form factor.
Improve profile names
Make card and node names like pulseaudio, with bt address in them.
Fill in port type in the route info.

Fixes #544
2021-01-10 20:56:27 +01:00
Jarkko Sakkinen
7aabd50d1e udev: Make Udev optional
In order to further simplify "unprivileged" builds, add "udev" boolean,
which make installing Udev rules optional.

I.e. without requiring any ugly hacks (mktemp -d), an privileged build
capable of running PulseAudio and JACK applications, can be configured
trivially:

meson --prefix=~/.local build
meson configure build -Dsystemd-user-unit-dir=$HOME/.config/systemd/user
meson configure build -Dpipewire-alsa=false
meson configure build -Dudev=false

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@iki.fi>
2021-01-09 23:42:05 +02:00
Pauli Virtanen
7ca568db86 bluez5: don't crash if validate_config fails
transport->device_link has to be set when transport->device is not NULL
2021-01-09 12:08:47 +01:00
Sebastian Apel
cbea225abd Improved workaround (v3): adapt processing of mSBC to handle bogus 'all-zero' packets (see #549) 2021-01-09 10:21:45 +00:00
Wim Taymans
540011f1e3 test-resample: fix unit test
Caller should not have to resubmit old samples anymore.

Fixes #551
2021-01-09 10:55:51 +01:00
Wim Taymans
d1f9966a77 resample: implement methods we now call 2021-01-08 17:43:13 +01:00
Wim Taymans
7f007b6bca resample: tweak the resampler to keep delay number of samples
Instead of requiring the upstream node to resubmit the delayed
samples, keep the samples ourselves. The benefit is probably too
small to measure but it simplifies things a lot.
2021-01-08 16:35:26 +01:00
Wim Taymans
7e9ab8b457 resample: first resample the data, then apply the new rate
Else we might not have enough input samples for the new rate.
2021-01-08 13:17:06 +01:00
Wim Taymans
4440ede41c bluez5: add SBC XQ support with a config option 2021-01-08 13:00:44 +01:00
Wim Taymans
860389492b a2dp: fix size check 2021-01-08 12:54:43 +01:00
Wim Taymans
e91fbd2721 bluez5: Implement routes
Implement routes on the device. This makes it possible for the
session manager to restore the device volumes.
Use validate_config to get the negotiated channels for the route
volumes.
2021-01-07 18:10:22 +01:00
Wim Taymans
5bb7a0f573 a2dp-codecs: add settings to codec init function
To make it possible to add extra config options in init.
Also add a method to update settings in a codec.
2021-01-07 17:39:39 +01:00
Wim Taymans
ece8a95c29 bluez5: improve a2dp codec api
Pass dict to select_config to influence the selection
Make a method to validate a config.
Add spa_dict to the codec to pass more info around.
2021-01-07 17:28:49 +01:00
Wim Taymans
1ca3998b41 alsa: remove unused field 2021-01-07 17:27:36 +01:00
Wim Taymans
e61f571e22 Revert "Update of a2dp-codec-sbc.c to achieve SBC XQ quality in dual channel, with fall back to standard Joint Stereo mode"
This reverts commit 4e1cbef687.

This needs some more work
2021-01-07 14:58:36 +01:00
JP Guillemin
b17db2cebc bluez5: add SBC XQ readme 2021-01-07 09:54:16 +01:00
JP Guillemin
4e1cbef687 Update of a2dp-codec-sbc.c to achieve SBC XQ quality in dual channel, with fall back to standard Joint Stereo mode 2021-01-07 09:39:05 +01:00
Pauli Virtanen
a81158f3d5 bluez5: after registering a2dp profiles, connect them to connected devices
After registering a2dp profiles on startup, call
org.bluez.Device1.ConnectProfile on already connected devices, if
applicable.
2021-01-06 17:36:34 +02:00
Wim Taymans
18b5199d44 alsa: add read/write access mode
Add support for read/write access mode when mmap is not available.

See #526
2021-01-05 17:48:09 +01:00