Commit graph

1502 commits

Author SHA1 Message Date
George Kiagiadakis
9168ec4335 backend-hsphfpd: fix compilation 2021-03-03 18:57:48 +00:00
Wim Taymans
e210c5f21c alsa: include headroom in silence buffers 2021-03-03 17:15:23 +01:00
Wim Taymans
a36af57899 alsa: reschedule the timeout based on new quantum
Always reschedule the timeout based on the new quantum. If the
quantum descreased we want to wait some more until the buffer only
has the new quantum of samples left.
2021-03-03 17:01:12 +01:00
Wim Taymans
3bcc59120a alsa: fix timeout adjustment
Only adjust the timeout when the quantum increases so that we end u
with exactly the number of samples of the new quantum.

Suppose we are handling a quantum of 1024, we wake up with 1024
samples in the device, we now notice a quantum of 8192 and will pull
in the 8192 samples, we then have 1024 + 8192 samples in the buffer.
Schedule a timeout for 1024 samples so that we end up in the timout
with 8192 samples in the device.
2021-03-03 16:55:40 +01:00
Wim Taymans
8981e11c53 alsa: various improvements
Remove some magic constants that are not needed anymore with the
headroom.
Clamp the error to some reasonable value so that we don't adjust the
rate too much but still apply all of the correction calculated by the
dll.
Remove the bandwidth adjustment.
Also update the matching and resample fields when we reassign the
node to a new driver. This could cause the new follower to not activate
the adaptive resampler and get out of sync.
2021-03-03 15:40:10 +01:00
Wim Taymans
c8804c3d6d context: make a new node.max-latency property
node.latency also influences the pipeline latency in that it can
push the latency above the default value.
node.max-latency, instead, is only used to clamp the final latency
of the pipeline.
2021-03-03 13:27:48 +01:00
Pauli Virtanen
4389e44903 bluez5: emit props change events only if values actually changed
This may avoid infinite loops if parameters are being set based on events
sent by parameter changes. It's also what alsa-acp devices do, so bluez5
should follow.
2021-03-02 23:46:27 +02:00
Pauli Virtanen
302282ef59 bluez5: set channel information for hfp/hsp transports
Fixes volume problems.
2021-03-02 22:20:44 +02:00
Huang-Huang Bao
97cc27600a bluez5: add missing function defination 2021-03-02 14:08:14 +00:00
Frédéric Danis
0e2a153bd3 bluez5: Start only one backend at a time for HSP/HFP
This will prevent to run the different backends concurrently.

The native backend will only register to BlueZ if neither oFono nor
hsphfpd are running. If one of them starts, the native backend will be
unregistered and the corresponding backend will register to its daemon.
2021-03-02 09:43:16 +00:00
Wim Taymans
1dfa36d77b alsa: reconfigure max latency based on buffer size
We can't ever support a latency larger than half the buffer size.
Take a fourth of the buffer size to have some extre headroom.

See #724
2021-03-02 10:34:41 +01:00
Wim Taymans
00d8d1472d channelmix: fix 7.1 to quad downmix 2021-03-01 19:51:14 +01:00
Wim Taymans
00e52ec167 resample: in drain, feed silence in all channels 2021-03-01 18:09:24 +01:00
Wim Taymans
5ae286702e audioconvert: make sure we update the flags
When we get a param update, update with the new flags.
2021-03-01 17:01:46 +01:00
Wim Taymans
157d423246 bluez5: remove stray route param field
This info is also in the classes field.
2021-03-01 16:55:16 +01:00
Wim Taymans
9662bc96ab null-audio-sink: support and prefer planar F32P
It's easier to convert to and also the native format for the converter
so that it can operate in passthrough mode without any copies.
2021-02-26 21:15:14 +01:00
Wim Taymans
d5d8150e05 fmtconvert: prefer planar formats when possible
It's easier to convert to and from.
2021-02-26 21:14:35 +01:00
Wim Taymans
50437029a3 channelmix: improve debug, add passthrough state 2021-02-26 21:12:11 +01:00
Wim Taymans
e2181c582d audioconvert: fix channel remapping some more
See #461
2021-02-26 18:40:04 +01:00
Wim Taymans
f7d756460e alsa: add option to use device channel map instead of default
See #461
2021-02-25 21:16:16 +01:00
Wim Taymans
6ce3705f5e fmtconvert: fix channel remapping 2021-02-25 17:41:50 +01:00
Wim Taymans
d080cd4819 channelmix: fix 7.1 to stereo and 3.1 downmix 2021-02-25 16:18:40 +01:00
Wim Taymans
20eb61b882 alsa: sync with pulseaudio 2021-02-25 10:28:25 +01:00
Pauli Virtanen
6114ca7c4a bluez5: fix queueing codec switches
Make queueing a codec switch work properly.  When receiving the dbus
reply, it should move to latest one. Others should be discarded.

Previously, it instead hit an assert, if there were more than two
queued.
2021-02-24 21:14:25 +00:00
Gleb Popov
fd544544ab Link v4l2 plugin to libinotify on FreeBSD 2021-02-24 19:29:57 +00:00
Wim Taymans
9e09461113 alsa: gracefully handle NULL params 2021-02-23 18:20:37 +01:00
Wim Taymans
d2fb6db21f alsa: use configured rate and channels when enumerating formats
When we have a rate or channels configured, set this in the hw_params
to restrict the enumeration of the remaining parameters. If we,
for example want 8 channels, some cards restrict the formats in that
case and we don't want to enumerate impossible combinations.

Fixes #782
2021-02-23 17:17:14 +01:00
Wim Taymans
8414092763 Rework profile/route handling
Add save property to Profile and Route params to notify the session
manager that they should be saved. Let the session manager only save
the Profile and Routes with the save flag.
Make pulse-server set the save flag on Profile and Route changes.
The result is that we can make a difference between user requested
changes and automatical changes and only remember the user preferences.
When a port changes availability, first check if we need to perform
a profile switch, if not select the new best port.
2021-02-22 16:51:59 +01:00
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