Commit graph

397 commits

Author SHA1 Message Date
Wim Taymans
6566f52a7e a2dp-sink: don't accept more data when we need to flush
See #449
2020-12-06 15:56:04 +01:00
Wim Taymans
d2ff341263 a2dp: use right struct for ldac
Fixes #449
2020-12-06 13:03:05 +01:00
Wim Taymans
316a96d501 improve debug 2020-12-06 09:32:12 +01:00
Wim Taymans
6d494c120f bluez5: improve debug 2020-12-05 20:56:56 +01:00
Wim Taymans
7996b44036 a2dp: fail if no ldac samplerate was found 2020-12-05 20:16:25 +01:00
Kamil Sołtysik
0a8a854721 Fix codec names in comments 2020-12-05 19:23:27 +01:00
Wim Taymans
c3c1a1184c a2dp: use unsigned for sizes 2020-12-05 08:30:14 +01:00
Wim Taymans
4797018e4f ldac: fix sample rates
Fix selection of sample rates.
Higer samplerates are not supported by the library so disable them.

See #449
2020-12-05 08:18:01 +01:00
Wim Taymans
635a378ca4 bluez5: don't error on 0 decode length
It can happen for the first frame when the codec is filling up.
2020-12-04 12:00:42 +01:00
Wim Taymans
a592eb60a8 bluez5: fix buffer filled check
Just check if the encode buffer is full. The max number of frames
has been obtained before.
2020-12-04 11:59:40 +01:00
Wim Taymans
106d597305 bluez5: add aptX and aptX HD codecs
They need the libopenaptx libraries from
https://github.com/pali/libopenaptx
2020-12-04 11:34:38 +01:00
Wim Taymans
9818582abe a2dp: fix aac codec compilation 2020-12-03 19:03:38 +01:00
Wim Taymans
73b13e8ad5 a2dp: deinit codec_data in stop 2020-12-03 18:11:06 +01:00
Wim Taymans
8bf0b7b4db a2dp: delay codec init to after acquire
Some codecs need the MTU as a parameter so wait until we acquire
with creating the codec context.

Make some method to enumerate the parameters from the transport
config and use that for the EnumFormat param.
2020-12-03 18:05:57 +01:00
Wim Taymans
67694a1491 a2dp-ldac: free handle on error 2020-12-03 11:18:27 +01:00
Wim Taymans
908e3f3d1f bluez5: only register available A2DP encoder/decoder 2020-12-03 11:09:13 +01:00
Wim Taymans
dd8573a5c2 bluez5: add ldac codec 2020-12-03 10:16:14 +01:00
Wim Taymans
3363544d05 bluez5: use start_decode to skip the header 2020-12-02 17:01:22 +01:00
Wim Taymans
75a4cff450 improve debug 2020-11-29 16:38:36 +01:00
Wim Taymans
b8300c663b improve some errors
Silence some -ENOENT warnings, they can happen when the object we
are introspecting is destroyed
2020-11-29 16:22:50 +01:00
Wim Taymans
573e2afd5e bluez5: fix compilation of fallback Hsphfpd backend 2020-11-16 20:27:55 +01:00
Frédéric Danis
6308c5d806 bluez5: backend-hsphfpd: Add mSBC support
mSBC can be enabled by passing "bluez5.msbc-support=true" parameter to
pipewire-media-session.
mSBC is automatically selected if remote device supports it.
2020-11-16 18:15:39 +01:00
Frédéric Danis
7d28b51713 bluez5: Add mSBC support to sco-source
This has been tested with a UART Bluetoth chipset, on a Raspberry Pi 3.
It may work with USB Bluetoot chipset/dongle.
2020-11-16 18:15:39 +01:00
Frédéric Danis
1759aa834f bluez5: Add mSBC support to sco-sink
This has been tested with a UART Bluetoth chipset, on a Raspberry Pi 3.
It doesn't seem to work with USB Bluetooth chipset/dongle.
2020-11-16 18:15:39 +01:00
Wim Taymans
31216c09c4 bluez5: fix memleak 2020-11-09 16:48:44 +01:00
Wim Taymans
17e3087397 bluez5: fix some whitespace and indent 2020-11-05 09:46:11 +01:00
Wim Taymans
395a30b5d6 a2dp: fix sign of out_decoded 2020-11-02 09:16:59 +01:00
Grzegorz Uriasz
c1530ba171 Use RegisterApplication in bluez5 for A2DP if possible 2020-11-02 09:14:37 +01:00
Frédéric Danis
48c64f9084 bluez5: backend-hsphfpd: Fix PCM agent name
The audio agent gets or provides data in the format requested between host
and chipset.
The HSP and HFP profile request PCM data to be sent to the chipset which
will encode/decode them in CVSD format.
This audio agent format may be re-used later for another air codec hw
encoded.
So, rename the audio agent to be more explicit.
2020-10-20 19:10:21 +00:00
Wim Taymans
77b91823f3 a2dp: mark a2dp-source as stream and autoconnect 2020-10-19 18:53:18 +02:00
Wim Taymans
6cc3224031 a2dp-source: fix source
Use codec methods. Init codec at start.
Remove rate match until we actually implement this
Add some buffering of packets before we hand them out.
Always simply fill a buffer and hand it out.
don't emit signals when we are following another driver.
Acquire transport as soon as it goes to PENDING.
2020-10-19 18:25:52 +02:00
Wim Taymans
d727123b86 a2dp-codecs: add more codec params 2020-10-19 18:12:47 +02:00
Wim Taymans
cdb83fa225 a2dp-sbc: implement decode 2020-10-19 18:12:13 +02:00
Wim Taymans
a91d129698 a2dp-sink: fix timing 2020-10-19 15:35:45 +02:00
Wim Taymans
53ee5ce72a bluez5: make codecs configurable
Make the list of supported codecs available.
Register all supported codecs endpoints
Find the codec from the endpoint name
Put the codec on the transport for the sink to find.
2020-10-19 13:27:11 +02:00
Wim Taymans
e18c4d76dc a2dp: move codecs to separate files 2020-10-19 12:12:21 +02:00
Wim Taymans
5c5b9f61bb a2dp: generate format info from config in init 2020-10-19 10:38:22 +02:00
Wim Taymans
574c0afc93 a2dp: refactor codec functions 2020-10-19 09:48:57 +02:00
Wim Taymans
e1fc51d965 a2dp-sink: don't force flush 2020-10-16 13:25:35 +02:00
Wim Taymans
3be0e7e1c6 a2dp-sink: fix playback
Use a simple periodic timeout to pull in samples and write them to the
socket
2020-10-16 13:13:04 +02:00
Wim Taymans
8b168935ee a2dp-sink: don't overwrite duration in clock
We should not modify the duration field in the clock, it is set by
the host and contains the desired quantum.

See #297
2020-09-17 10:31:35 +02:00
Wim Taymans
aea9d4fdfe a2dp: remove unused threshold field 2020-09-17 10:31:08 +02:00
Frédéric Danis
7c84b1251d bluez5: backend-hsphfpd: Fix transport release on disconnection
Release transport when endpoint connection property is updated to false.
This also checks if the transport is already created when receiving
endpoint properties update to prevent multiple transport creation.
2020-09-16 16:20:54 +00:00
Wim Taymans
b8d65895c2 a2dp: try to completely process the queue
Continue processing the input data until we can't send anymore. When
we are following another driver, we need to process each buffer in
the cycle completely or we will start lagging behind.
2020-09-02 17:51:33 +02:00
Wim Taymans
b54571c5a1 a2dp: fix check 2020-09-02 17:16:16 +02:00
Wim Taymans
d7fb382b7b a2dp: place buffer id in io when reusing 2020-09-02 17:04:19 +02:00
Wim Taymans
6b50279364 bluez5: add a simple clock to sinks/sources
Fixes #269
2020-09-02 13:36:22 +02:00
Frédéric Danis
d607a461ce bluez5: backend-hsphfpd: Fix crash when switching profile to HFP 2020-08-25 16:43:03 +02:00
Frédéric Danis
7120bfe059 bluez5: backend-hsphfpd: Add spa_bt_transport support
The ConnectAudio method triggers Introspect and NewConnection calls from
hsphfpd to the backend, which will set the fd to use for the SCO data.
This imply to run the DBus loop while waiting for ConnectAudio reply to be
able to reply to those method calls.

MTU is hard-coded to 48. Using MTU from hsphfpd may prevent correct
sound operations.

Volume management is not yet implemented.
2020-08-19 17:49:36 +00:00
Frédéric Danis
6d0c48cc82 bluez5: Add transport find function using a test callback
hsphfpd backend needs a way to retrieve bt_transport based on other entries
than the path one
2020-08-19 17:49:36 +00:00