Commit graph

1455 commits

Author SHA1 Message Date
Wim Taymans
9a7cbeea83 channelmix: improve undefined channel layout
When we have no channel layout, just copy input to output
channel.
Optimize this case in the mixer implementation.
2020-09-04 13:41:24 +02:00
Wim Taymans
3eafa6312f channelmix: add default channelmap for 5 and 7 channels 2020-09-04 12:22:30 +02:00
Wim Taymans
f7d8fef070 channelmix: normalize volumes
Normalize the volumes.
Don't mix in LFE by default but add an option
Move some booleans to flags
Improve some checks for fastpaths.
2020-09-03 13:20:36 +02:00
Wim Taymans
b62fa9faf2 channelmix: disable normalize for now
Volume is too low and we don't choose the right functions all the
time. Needs more work.
2020-09-02 18:50:01 +02:00
Wim Taymans
5dea431372 channelmix: normalize matrix to avoid clipping 2020-09-02 18:36:42 +02: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
Wim Taymans
4867edb947 channelmix: read mix coefficients correctly
Fix 5p1 to stereo mixdown by reading the coefficients correctly.
Align 5p1 to quad SSE and C implementation

Fixes #272
2020-09-02 11:15:23 +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
Wim Taymans
e8640683bb support: add null audio sink 2020-08-20 18:00:00 +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
Frédéric Danis
7bad76737e bluez5: Create backend skeleton for HSP/HFP support using hsphfpd
As hsphfpd is a prototype and its API subject to change, this backend is
disable by default.

This skeleton connects to hsphfpd daemon and list the managed devices.
2020-08-19 17:49:36 +00:00
Wim Taymans
5f4fd14a40 audioconvert: optimize prefered formats
First planar, then packed, then packed other endian formats.
First F32, S32, S24_32, S16, S24, U8 because of quality and
optimizations.
2020-08-19 13:45:57 +02:00
Wim Taymans
cfdd6cab20 acp: fix UCM off profile 2020-08-18 16:52:09 +02:00
Wim Taymans
a67af43cad alsa: sync with latest pulseaudio
Move some things around to make it easier to merge in changes.
2020-08-18 12:41:34 +02:00
Emmanuel Gil Peyrot
14fdf07e8f Run codespell on the entire codebase
This tool detects and fixes common English spelling mistakes, with
generally very few mistakes.

Here is the command I used to generate this commit.  There were a few
changes that had to be done manually, and of course adding the ignore
file:
```shell
codespell -I .codespell-ignore -x .codespell-ignore -w
```

I didn’t add it to the CI, but this would be a good place for it.
2020-08-17 17:16:31 +00:00
Wim Taymans
03f1dfcf99 acp: handle unset profile
The active profile is set to -1 initially, don't try to do anything
with the profile if it is invalid.

See rhbz#1868332
2020-08-17 11:33:17 +02:00
Wim Taymans
dadb3a884d profile: refactor code to make EnumProfile and Profile params
Use the same code to enumerate the profiles and the current profile,
this makes sure we have all info in the Profile param as well and
don't need to do a lookup in the EnumProfile.
2020-08-17 11:08:26 +02:00
Wim Taymans
90e12299f1 acp: add current profile in the route 2020-08-14 15:09:00 +02:00
Wim Taymans
5e9091a285 node: add new NEED_CONFIGURE flag
Add a new node flag that is set when the node needs more configuration.
Don't try to Start nodes that have the NEED_CONFIGURE flag set.
Make audioadapter clear the NEED_CONFIGURE flag when it has the
PortConfig.

These changes now make it possible to run:

gst-launch-1.0 -v pipewiresrc path=51 stream-properties="props,node.group=1" ! audio/x-raw ! pipewiresink stream-properties="props,node.group=1"

The pipewiresink and pipewiresrc will be added to the same scheduling
group (1) and the devices they connect to will be slaved, even if they
are otherwise not linked.

Without the NEED_CONFIGURE flag, pipewiresink would be added to the
pipewiresrc group and would be started by the daemon before the
session manager has a chance to configure (and link) the node.

Fixes #4
2020-08-10 16:57:14 +02:00
Wim Taymans
2362953931 audioadapter: update flags 2020-08-10 16:48:03 +02:00
Wim Taymans
374210c890 acp: add per device port list
Add the list of possible ports for a device.
Pass the allowed devices in the routes.
Store the active port in the device.

Fixes enumeration of ports on devices with UCM.
2020-08-10 14:25:03 +02:00
Wim Taymans
cb3f1b51aa adapter: only become started on success 2020-08-07 10:49:52 +02:00
Wim Taymans
f4e8ebab51 improve debug and error messages 2020-08-07 10:47:18 +02:00
Wim Taymans
e71936f870 Improve naming
master -> driving
priority_master -> priority_driver
segment_master -> segment_owner
2020-08-06 13:49:33 +02:00
Wim Taymans
f961c726de param: add type info for volumeStep and Base 2020-08-05 20:25:55 +02:00
Wim Taymans
77bd687bac acp: fix size of array 2020-08-04 12:05:56 +02:00
Wim Taymans
9943733b8c acp: pass all properties when creating a card
They might contain other info like prefered card name etc.
2020-08-03 18:15:04 +02:00
Wim Taymans
7f7a8ccc88 acp: use some existing keys and add some new ones 2020-08-03 17:08:46 +02:00
Wim Taymans
a655e8f6df alsa-util: fix check for digit
Fix the check for a digit by checking if the value is between the
*character* '0' (not *value* 0) and '9'.
2020-08-03 10:10:04 +02:00
Julian Bouzas
c388df1cf3 bluez5: include profile classes when doing enum profile 2020-07-31 10:53:51 +00:00
Wim Taymans
d2452e1340 acp-device: remove sources when destroyed
Or we end up polling wrong fds in an infinite loop.
2020-07-29 12:19:33 +02:00
Wim Taymans
1d7ca5bdae add udev rules so we don't rely on pulseaudio 2020-07-28 13:11:17 +02:00
Wim Taymans
eaf7606e3f acp: pass udev PROFILE_SETS to acp device 2020-07-28 13:00:45 +02:00
Wim Taymans
e478ba7e34 alsa: be safer when parsing device string 2020-07-28 12:51:33 +02:00
Wim Taymans
154f981f97 Add mixer paths and profile-sets as well
So we don't have to rely on pulseaudio installed ones
2020-07-28 12:30:32 +02:00
Wim Taymans
3f33c9c81d acp: sync with latest 2020-07-28 10:16:47 +02:00
Wim Taymans
ca5836cdf4 alsa: fix delay parameter
We need to keep twice the delay of samples around. Fixes capture
with resampling.
2020-07-27 16:22:17 +02:00
Wim Taymans
8f3771a56c alsa-pcm: also follow resampler insize when resampling
Use the input size of the resampler as the amount of samples to
read when we are resampling.
2020-07-27 15:57:27 +02:00
Frédéric Danis
3e56161ee2 bluez5: backend-ofono: Fix ofono blocking signals
Filter callback should return DBUS_HANDLER_RESULT_HANDLED only when signals
was handled, otherwise it prevents signals to be seen by other objects.

Also fix a Typo.
2020-07-24 15:49:28 +00:00
Frédéric Danis
4fb56ee69b bluez5: Share DBus connection between all backends 2020-07-24 15:49:28 +00:00
Frédéric Danis
db0c224b06 bluez5: Make native and ofono backends optional 2020-07-22 18:59:58 +02:00
Frédéric Danis
ebdaac160c bluez5: backend-ofono: Fix SCO nodes not created on oFono's CardAdded
oFono's CardAdded signal from can occur after BlueZ's ServicesResolved
signal. In this case the device is created without SCO nodes.
This is fixed by not enforcing device creation on ServicesResolved signal.
2020-07-22 18:59:58 +02:00
Frédéric Danis
18da8fd21f bluez5: backend-ofono: Add spa_bt_transport support 2020-07-22 18:59:58 +02:00
Frédéric Danis
9b6dd9461e bluez5: Create backend skeleton for HFP support using oFono 2020-07-22 18:59:58 +02:00
Wim Taymans
2955182e4e use spa_debug_type_short_name() when we can 2020-07-22 11:22:11 +02:00
Wim Taymans
875236631f acp: don't ignore return value 2020-07-21 15:42:04 +02:00