Commit graph

123 commits

Author SHA1 Message Date
Frédéric Danis
0b970ec965 bluez: Update BT profiles
Only provide high-level A2DP and HSP/HFP profiles in pw.
Expose nodes based on pw profiles and BT profiles available on remote
device.
2020-07-03 11:53:52 +02:00
Frédéric Danis
41d7ccc336 a2dpsink: Process right amount of data with sbc_encode
sbc_encode() can only process data with at least this->codesize bytes.
When encode_buffer() is called with less then codesize bytes, accumulate
those bytes in a temporary buffer up to codesize length, then SBC encode
them.
Maximum size for SBC buffer is (subbands * blocks * channels * 2) with max
subbands = 8, max blocks = 16, max channels = 2, i.e. 512.

Fixes !277
2020-06-27 13:03:24 +02:00
Julian Bouzas
1f1386879b a2dpsink: only request new data when buffer is done 2020-06-18 08:02:50 +00:00
George Kiagiadakis
da9d17e73e bluez5: don't add transport twice in the device transports list
The transport is already added in profile_new_connection(), unless
is_new is TRUE

Apart from being wrong, adding the same node twice in a list also causes
spa_list_foreach() to loop forever...
2020-06-10 18:24:07 +03:00
Wim Taymans
c13c028ebb bluez5: fix leaks 2020-06-05 15:49:39 +02:00
Wim Taymans
1246116f06 bluez: free object path 2020-06-01 15:37:57 +02:00
Wim Taymans
45c62dfde6 a2dp: check and log return value of fcntl 2020-05-20 15:24:25 +02:00
Wim Taymans
aafd1e7298 improve debug
Improve log so that debug level 3 gives a reasonably readable overview
of what is going on.
2020-04-22 12:47:18 +02:00
Wim Taymans
a5b0553328 Fix some -Wenum-conversion errors
Make pw_direction and spa_direction the same
Explicitly cast some enums or use the right enums
2020-04-04 20:03:08 +02:00
Wim Taymans
c4cf5e6629 bluez5: protect against NULL transport
The transport can be destroyed at any time, make sure we don't
crash when it does.
2020-03-23 13:49:30 +01:00
Wim Taymans
72d70b0f48 Add and fix some more warnings
Fixes #216
2020-03-17 11:37:56 +01:00
Wim Taymans
a528189d26 slave -> follower
We use master/follower terminology everywhere.
2020-02-21 10:47:32 +01:00
Wim Taymans
01934297bd fix compilation warning 2020-02-20 12:03:16 +01:00
Wim Taymans
65caf8832c spa: install in versioned directory
So that we can run old and new plugins side by side.
2020-01-29 15:51:41 +01:00
Wim Taymans
6ac9b7b3a7 spa: add spa_aprintf helper
Add a asprintf helper function that handles errors correctly.
Use this in places where we use asprintf to avoid warnings when we
don't check the return value.
2020-01-27 12:19:21 +01:00
Wim Taymans
9db240e786 bluez: implement profile on device
Enumerate the available profiles on the device. Make params
visible.

Implement set_profile, only expose the nodes that belong to the
profile.
2020-01-10 13:25:40 +01:00
Wim Taymans
5f70a2713e a2dp: fix audio
Don't just remove the buffer from the queue when it was only
partially written. To do this, return the error code from add_buffer
and only remove the buffer when there is a real error.
2020-01-10 09:55:02 +01:00
Wim Taymans
8f3b2b9543 bluez5: implement sync, profile and enum_profile 2020-01-03 13:01:54 +01:00
Wim Taymans
f391353c7f Make interface types a string
This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
2019-12-19 13:36:04 +01:00
Wim Taymans
feb8dd3a34 Add include of keys.h 2019-11-21 09:34:08 +01:00
Wim Taymans
68e94a2e7e system: use spa_system functions for fds 2019-11-19 13:41:40 +01:00
Wim Taymans
9ffec214b8 fix includes 2019-10-25 15:01:02 +02:00
Wim Taymans
81fc595e3d add defines for max buffer size 2019-10-24 12:51:34 +02:00
Wim Taymans
c8ffcaaefe plugins: just check the data pointer
We don't need to look at the data type, we just just be happy when
the data pointer is filled in.
2019-10-16 12:23:42 +02:00
Wim Taymans
77e07e1948 improve properties on globals and ports 2019-09-20 13:28:06 +02:00
Wim Taymans
6756a3c8fc monitor: remove monitor API and use device
Remove the monitor API, we can use the device API for it. Make sure
we support creating devices (like alsa) from another device (udev).

Use new object.id to store the object id in the object properties. Use
the port.id/node.id etc to make relations to other objects.
2019-09-20 13:04:14 +02:00
Wim Taymans
8b85cc225e rename HAVE/NEED_BUFFER -> HAVE/NEED_DATA
It is more generic and works with control-only ports as well
2019-09-16 12:55:23 +02:00
Julian Bouzas
ddd2a97f7e bluez: set bluez profile property when emitting node
We need to expose the bluetooth profile in the nodes so that external
applications know how to handle them.
2019-09-10 10:42:11 +02:00
Julian Bouzas
5363d3352c bluez: process available buffers in read_ready callback for a2dp-source and sco-source 2019-08-28 17:17:12 +02:00
Julian Bouzas
3a43fac0c2 sco-sink: fix several timeout issues 2019-08-22 00:07:04 +02:00
Julian Bouzas
4b202b9656 a2dp-sink: fix infinite loop when buffer could not be encoded 2019-08-20 00:22:40 +02:00
Julian Bouzas
de031b42b1 bluez: add sco-sink and sco-source nodes 2019-08-01 15:31:54 +02:00
Julian Bouzas
d274497e3c bluez: unset sco and rfcomm fd when destroying transport 2019-08-01 15:31:54 +02:00
Wim Taymans
2772c9f554 bluez: clean up nodes 2019-07-31 18:30:19 +02:00
Wim Taymans
deb6c52f76 node: remove port_alloc_buffers
Remove the now obsolete port_alloc_buffer, rework to use the
port_use_buffers with the ALLOC flag.
2019-07-25 14:08:43 +02:00
Wim Taymans
8590ac158b node: add flags to port_use_buffer
Remove the CAN_USE_BUFFERS flag, it is redundant. We can know this
because of the IO params and buffer params.

Add flags to the port_use_buffer call. We also want this call to
replace port_alloc_buffer. Together with a new result event we can
ask the node to (a)synchronously fill up the buffer data for us. This
is part of a plan to let remote nodes provide buffer data.
2019-07-25 13:19:39 +02:00
Wim Taymans
356f1242be a2dp: pull more data when needed
When we still have a buffer but it does not have enough data to encode a
frame, ask for more buffers.
2019-07-12 09:55:55 +02:00
Wim Taymans
0e765de519 props: remove pointers in property values in protocol
Mark pointers in property values with pointer: and remove them
when sending the properties over the wire to avoid errors.
2019-07-11 12:52:55 +02:00
Wim Taymans
6720ded529 names: add standard factory name definitions
Define a set of standard factory names and document what they
contain. This makes it possible to change the implementation by
mapping the factory-name to a different shared library.
2019-06-21 13:31:34 +02:00
Wim Taymans
b2992a0f8a improve error handling 2019-06-07 17:50:46 +02:00
Wim Taymans
497a8364c5 printf format fixes 2019-06-07 17:16:02 +02:00
Wim Taymans
0a5bce4a3b bluez5: expose factories in the plugin 2019-06-07 09:19:40 +02:00
Wim Taymans
db88e9f954 System: More work on making system functions pluggable
Move the epoll functions to the system functions and make the loop
use those. Use simple mask for events instead of enum.
Add the used system api in pw_loop.
Add System API to spa_support and use it where possible.
Pass the system API used in the realtime loops in spa_support as
well and use this in the realtime paths.
Improve bootstrapping, load only the log and cpu interfaces because
those can/need to be shared between instances. Let the core load
the other interfaces.
Add keys to configure the System and Loop implementations used in
pw_loop.
2019-06-06 15:31:53 +02:00
Wim Taymans
86dc0496a5 simply use INTERFACE_Loop for the main-loop 2019-06-06 15:20:43 +02:00
Wim Taymans
49ef8f9b5f spa: add keys for properties
Define and document property keys
2019-06-03 16:48:01 +02:00
Wim Taymans
1d1f035e78 monitor: return factory_name in the object_info
Pass a factory_name in the object_info of monitor and device.
Restructure the factory name to mean something functionaly. With
the factory to library mapping this then means that the implementation
of certain factories can be configured in the config file.
2019-05-31 15:06:44 +02:00
Wim Taymans
11393ce9dd bluez: add api to properties 2019-05-30 16:09:56 +02:00
Wim Taymans
c8cbb7e322 bluez5: improve debug 2019-05-30 13:01:15 +02:00
Wim Taymans
9785d99821 monitor: Remove monitor event
Remove the monitor event and emit events with structures like we do
for the devices.
2019-05-30 12:51:12 +02:00
Wim Taymans
bf677d55da spa: implement node sync 2019-05-28 14:01:18 +02:00