Commit graph

1474 commits

Author SHA1 Message Date
Wim Taymans
c067fd0a20 alsa: log device name in visible debug messages 2021-02-22 10:07:50 +01:00
Pauli Virtanen
a5dc2493df bluez5: route shouldn't list a2dp profiles when not connected 2021-02-19 21:16:27 +02:00
Wim Taymans
715a3a642a jack: handle client init error with -EIO 2021-02-19 16:10:34 +01:00
Wim Taymans
44919c83fc audioconvert: keep better track of param changes
Keep track of the param changes with the user counter. Make sure to
flip the serial switch whenever a change is pending. Previously
we copied the param from the channelmixer or follower but that
did not always result in a serial change.

Fixes #764
2021-02-19 09:57:59 +01:00
Frédéric Danis
7a5a944704 bluez5: backend-native: Check volume values
The value from +VGM/+VGS AT commands or events should be between 0 than 15.
2021-02-18 18:32:21 +00:00
Wim Taymans
930b411075 bluez5: set the right volumes on the node 2021-02-18 19:25:04 +01:00
Wim Taymans
8c5ca000ef bluez5: volumes need to be distributed to all channels
Otherwise some channels might become silent.

See #741
2021-02-18 17:47:22 +01:00
Wim Taymans
63a3811aa7 fix some warnings 2021-02-18 12:42:06 +01:00
Pauli Virtanen
d75a79babc bluez5: add delay adjustment property + fallback value for a2dp-sink
Not all devices report their A2DP delay. In those cases, use a fallback
value of 150ms by default.

Make the delay adjustable with a SPA_Prop, and expose it as a part of
the route. Implement the corresponding parts in media-session.
2021-02-18 11:33:45 +00:00
Pauli Virtanen
df1dbee687 bluez5: include a2dp codec profiles in route profiles 2021-02-18 11:33:45 +00:00
Frédéric Danis
bdbd0f17c6 bluez5: backend_native: Fix backend_native_new() error path 2021-02-17 14:03:06 +01:00
Frédéric Danis
01b6dbfca6 bluez5: backend_native: Add mSBC support to HFP HF 2021-02-17 10:19:39 +01:00
Wim Taymans
c7b7afa664 audioadapter: fix enum of properties
Keep track of the subelement we're iterating in the result index upper
bits. Use enum_sync to iterate each param and switch to the next
element when we run out of params.

See !468
2021-02-17 09:59:00 +01:00
Wim Taymans
0ed7e537fb acp: make Pro devices look better
Omit the Output/Input string from the name
Don't print a number for the first device.

See !466
2021-02-16 20:21:53 +01:00
Frédéric Danis
7a96f3a945 bluez5: backend_native: Fix SCO deferred setup accept
In BT_DEFER_SETUP mode, when a connection is accepted, the listening
socket is unblocked but the effective connection setup happens only on
first receive, allowing to configure the accepted socket.

First read from the accepted socket is non-blocking and returns a zero
length buffer.
2021-02-16 18:30:11 +01:00
Wim Taymans
344eb2baa3 bluez5: handle info == NULL when parsing codecs 2021-02-16 17:58:56 +01:00
Frédéric Danis
23823867b0 bluez5: backend_native: Fix +BRSF parsing for HFP HF 2021-02-16 16:49:04 +00:00
Frédéric Danis
be7caf0e66 bluez5: backend_native: Fix default HFP codec 2021-02-16 16:49:04 +00:00
Wim Taymans
38e0ff55cd acp: don't add pro profile for UCM
For UCM, we can just as well make a use case in the UCM file.
2021-02-16 15:17:26 +01:00
Wim Taymans
ca10c6470f audioconvert: use sizeof for position size
And make the position field a little larger
2021-02-16 15:07:40 +01:00
Frédéric Danis
0061ddd6be audioconvert: Fix buffer overflow
This was introduced by commit c160a063b9
2021-02-16 14:56:17 +01:00
Wim Taymans
b62771c3cb acp: fix mapping name 2021-02-16 12:53:23 +01:00
Wim Taymans
5892403b01 acp: add a Pro Audio profile
The Pro Audio profile exposes all devices and subdevices with maximum
channel count and no channel layout. It also have no hardware volume
and is more suited for Pro Audio usage.

See #731 #704 #57
2021-02-16 12:34:59 +01:00
Wim Taymans
91610bd1a9 merger: emit params changed event when reconfiguring
The props param changes when the number of channels changes.
2021-02-16 12:34:59 +01:00
Wim Taymans
c160a063b9 audioconvert: handle unexpected channel positions 2021-02-16 12:34:59 +01:00
Wim Taymans
ef98361630 audioconvert: when we reconfigure, emit param changed event
When we reconfigure the node, the Props param changes with the
new number of channels.
2021-02-16 12:34:59 +01:00
Frédéric Danis
0b2d3730b6 bluez5: Add HFP HF support 2021-02-15 14:46:18 +00:00
Wim Taymans
d6afdda898 audioadapter: enumerate node params from follower as well
Enumerate the params from the follower as well.
Configure params on the follower and converter.
When follower params changes, emit event.

See !460
2021-02-15 15:43:03 +01:00
Wim Taymans
e7aa15e475 audioadapter: only check port params when changed 2021-02-15 15:39:39 +01:00
Pauli Virtanen
0dee15d0f6 bluez5: aac: set reasonable default bitrate
Set default bitrate to a reasonable value in caps, and handle unknown or
bogus bitrates from device.
2021-02-13 19:03:13 +00:00
Wim Taymans
2908e11a72 bluez5: add mSBC and CVSD codec name to properties
Fixes #666
2021-02-12 17:20:37 +01:00
Frédéric Danis
a14d6d15b3 bluez5: Use only one SCO listening socket in backend-native
Create SCO listening socket on backend creation for all incoming
connections instead of one per remote device.
2021-02-12 16:10:22 +00:00
Pauli Virtanen
b6108df6f3 bluez5: remove device on disconnect
Do device_remove when device disconnects.

This can occur, as profile check is not run on HFP/HSP profile
disconnect.
2021-02-11 21:55:42 +02:00
Pauli Virtanen
beaec3d003 bluez5: set initial profile based on what's connected at startup
Set initial device profile according to what's connected at startup,
rather than having media-session try to set it to A2DP (and fail, if the
profile was not connected, resulting to startup in null profile).

This avoids making a codec switch at device startup (we'll stay with
what BlueZ autoconnected us to, usually the previously used codec).
2021-02-11 11:13:42 +00:00
Frédéric Danis
add8329374 bluez5: Use str2ba() function
bluez5 SPA is already linked to the BlueZ library so we can use this
helper function and simplify code.
2021-02-10 10:57:52 +00:00
Pauli Virtanen
d57c9bd1bd bluez5: aac: reject MPEG4_AAC_LTP, MPEG4_AAC_SCA in select_config
These modes are not actually supported by the code, so it should not
accept them.
2021-02-10 00:18:29 +02:00
Frédéric Danis
640f34d8e2 bluez: Fix HSP command parser
The HSP command parser should not reply, with 'OK' or 'ERROR', to result
codes from the remote AG.
Split the command parser in AG and HS part.
2021-02-09 18:08:26 +00:00
Frédéric Danis
44d8a0a4c1 bluez5: Expose WBS in HFP AG SDP record
Updates the available values for SDP records and BRSF for both Hands-Free
profile version 1.7.
2021-02-09 16:12:29 +01:00
Wim Taymans
ecd1d3e1d7 Move node.pause-on-idle setting to config files
So that we can configure it.
Add some more docs to the config file
2021-02-08 17:19:47 +01:00
Wim Taymans
94ec577dcd alsa: make sure _recover() works from SUSPENDED
Pass -ESTRPIPE to _recover() when our state is SUSPENDED so that
it always attempts to resume, regardless of the error code.
2021-02-08 11:48:32 +01:00
Wim Taymans
cd2a7aebaf a2dp-sink: don't force flush on every buffer
Don't force flush on every buffer but accumulate enough data
first. This avoids sending many small packets when the quantum is
small.

See #680
2021-02-08 10:24:50 +01:00
Wim Taymans
e3d19e5602 a2dp: small cleanups 2021-02-08 10:24:27 +01:00
Wim Taymans
37d8cbd5d6 bluez5: make min buffer size match the latency
We request a latency of at least 512 so make sure we have buffers that
large.

See #680
2021-02-07 20:22:55 +01:00
Wim Taymans
63c5fadcfc a2dp: fix compiler warnings 2021-02-07 19:43:09 +01:00
Huang-Huang
cd78003e66 bluez5: don't create device if there is no connected profile 2021-02-07 18:38:10 +00:00
Pauli Virtanen
f99eefeb4f bluez5: a2dp-source: release transport if it went idle
Release the transport if it went idle, ensuring that the fd is closed,
and add safeguards we won't double-acquire/release it.

This can occur if the device pauses the playback. The transport may also
activate again later on, and in this case we need to reacquire a new fd.
Not closing the old fd causes problems in this case.

However, apparently the BlueZ Release() call fails if the transport is
idle. We just ignore the error and downgrade the error message; it might
not be safe to not call Release() because the idle property update is
async.
2021-02-07 18:32:44 +00:00
Pauli Virtanen
d3d31c4317 bluez5: don't force a2dp-source as driver
Don't force a2dp-source to be driver, because it won't advance clock if
the device is not sending data, and possibly blocks other streams.
2021-02-07 18:32:44 +00:00
Pauli Virtanen
d68bad4673 bluez5: fix a2dp-source clock rate + stuttering
Make a2dp clock advance at the correct rate.

Revert back to accumulating to a single buffer before sending it out.
What it did previously seemed hard to get to work properly with e.g.
aptx which produces block of varying sizes on decoding.
2021-02-07 18:32:44 +00:00
Pauli Virtanen
f1e56b2317 bluez5: provide media.name for a2dp source streams
A2DP source acts as Stream/Output/Audio, so provide media.name for it
indicating the device it comes from (e.g. shown in pulseaudio apps).
2021-02-06 20:24:04 +02:00
Pauli Virtanen
e0557e0ca8 bluez5: disable codec switching when in A2DP sink role
Devices that expect pipewire to function as a sink don't seem to like it
switching codecs. Disable codec switching when device is a source.
2021-02-06 18:12:19 +00:00