Commit graph

7365 commits

Author SHA1 Message Date
Pauli Virtanen
eca37b58a6 bluez5: make room for a2dp duplex channel
Some non-standard A2DP codecs (FastStream/aptX-LL) have "voice duplex
channel" that can be used to provide an A2DP duplex mode.

Add support for duplex channels, accounting for the fact that the two
directions may be encoded with different actual codecs.
2021-08-21 20:00:52 +03:00
Wim Taymans
4ab8ecfe06 pipewire: allow : in SPA_PLUGIN_DIR to scan multiple paths 2021-08-20 10:15:21 +02:00
Wim Taymans
abf37f618e modules: ensure node.name and description are set
Most apps need this and some even crash when they are not set.
2021-08-20 09:26:17 +02:00
Stefan Riesenberger
bb2f637839 pipewire-pulse: set description for ladspa sources 2021-08-19 17:33:31 +02:00
Pauli Virtanen
f00ec34787 bluez5: use lower latency for aptx-ll codec
This pushes the latency to 256 samples, which still seems to work
Latency of 128 seems to be too small. (NB. the number of input samples
is also the size of packets sent in bytes)

Since pipewire clients usually use powers of two, this may be the
smallest value that makes sense.
2021-08-18 19:55:22 +00:00
Pauli Virtanen
90b62ba2b3 bluez5: add aptx-LL codec
Support the low-latency variant of the aptx codec.

The magic mostly seems to be on the device side, since the stream is the
same as standard aptx, but latency is smaller even if stream/packet
sizes are the same.

Sound output latency is noticeably less than with the standard aptx.
Tested on Sennheiser HD 250 / Avantree Aria Pro.

The codec in principle also supports bidirectional duplex streams,
but that is not implemented here.
2021-08-18 19:55:22 +00:00
Pauli Virtanen
73994feda9 bluez5: allow same codec ID to correspond to multiple endpoints
The codec IDs are user-visible properties.

Some codecs can have multiple endpoints (e.g. different caps struct, or
multiple possible vendor ids), so this detail should not leak to the
user.
2021-08-18 19:55:22 +00:00
Pauli Virtanen
fc2fe12794 bluez5: update a2dp-codecs.h from bluez with aptx-ll caps 2021-08-18 19:55:22 +00:00
Wim Taymans
f96fa1bf36 pulse-server: find the rate in the format_info
Also look for the highest rate in the format_info to suggest as
the graph sample rate.

See #1523
2021-08-18 16:58:22 +02:00
Wim Taymans
f8aa4dcfcc context: only prepared nodes can make a node non-passive
This avoid starting the node before the link has been prepared.
2021-08-18 16:20:24 +02:00
Wim Taymans
7846687df8 alsa: suggest rate to graph with node.rate 2021-08-18 09:56:20 +02:00
Wim Taymans
2d4ded2384 conf: waitpid needs a cleared status
It might not change the status when the process has changed state.
2021-08-18 09:45:15 +02:00
Wim Taymans
0bad741d45 pw-cat: suggest samplerate as graph rate 2021-08-18 09:44:53 +02:00
Wim Taymans
c25e6cee50 pulse-server: add an example of context.exec in the config file
Extra setup with pactl or scripts can be run here.
2021-08-17 20:31:47 +02:00
Wim Taymans
bf66a3b236 pulse-server: use NODE_RATE to suggest a graph rate
When the rate is in the allowed rates and the graph is idle, it
will switch to the new rate.
2021-08-17 20:05:19 +02:00
Julian Bouzas
cad64bc992 audioadapter: add support for passthrough mode
Allows audioadapter to behave as its follower
2021-08-17 16:01:10 +00:00
Wim Taymans
49c1c0386f pw-cat: fix raw read
raw read needs bytes, so use the stride to calculate it from frames.
Move ulaw/alaw to packed formats.
2021-08-17 17:56:31 +02:00
Wim Taymans
f7c91491cb pw-cat: support ulaw/alaw formats 2021-08-17 17:35:31 +02:00
Wim Taymans
961f478af8 pulse-server: add alaw/ulaw support 2021-08-17 17:35:05 +02:00
Wim Taymans
c3db68a219 gst: support ulaw/alaw conversion of caps 2021-08-17 17:34:14 +02:00
Wim Taymans
e9679afb12 audioconvert: support alaw/ulaw conversion 2021-08-17 17:33:29 +02:00
Wim Taymans
df9f79d869 audioconvert: add converstion to and from alaw/ulaw 2021-08-17 17:32:25 +02:00
Wim Taymans
d0d7f2f20b spa: add alaw and ulaw defines
Add alaw and ulaw as raw formats.
2021-08-17 17:31:03 +02:00
Wim Taymans
fd82da938a audioconvert: add more format support
Add support to endian conversion as well.
2021-08-17 15:03:03 +02:00
Wim Taymans
a5e2e955d2 audioconvert: add more conversions
Add the other endian conversions.
2021-08-17 14:45:00 +02:00
Wim Taymans
c39d374ca8 alsa: hook up latencyOffsetNsec in ALSA sink/source
This property is exposed on the device Route and forwarded to the
nodes. It then configured the process_latency.ns field, which
influences the reported port latency.

This makes it possible to change the internal port latency on the
sink and source with pavucontrol and tweak the synchronization to
compensate for internal latencies in the device.
2021-08-17 11:57:12 +02:00
Wim Taymans
391465d1cd audioadapter: emit Latency param changed when follower changed
When the follower port Emits a latency param changed, our reported
latency also changes so we need to emit the changed notify.
2021-08-17 10:49:05 +02:00
Wim Taymans
5a05ee8753 media-session: fix defaults for internal latency 2021-08-17 10:28:28 +02:00
Wim Taymans
a2083d12d4 alsa: add params to set default internal latency 2021-08-17 10:15:40 +02:00
Wim Taymans
6d196b1d11 alsa: use ProcessLatency param to get and set internal latency 2021-08-17 10:04:12 +02:00
Wim Taymans
ee6d363481 filter-chain: add the 2 stage convolver
So that the tail is processed with a larger fft size to make it
faster for larger convolutions.
2021-08-16 20:31:43 +02:00
Anukul
6c9f342775 Update 90-pipewire-alsa.rules --> add rule for gsx 1200 2021-08-16 10:04:49 +00:00
Oğuz Ersen
b6ea0dee46
po: update turkish translation 2021-08-15 20:06:34 +03:00
Arun Raghavan
ffb7893f20 doc: Fix minor copy-pasto in impl-module 2021-08-15 17:09:02 +02:00
Pauli Virtanen
672223d055 bluez5: avoid poll busy loop in a2dp-sink
Disable flush polling when we don't have data ready to write to the
socket (or socket send failed). This avoids entering into a poll busy
loop, which may result to rtkit killing the process.
2021-08-13 23:37:48 +03:00
Pauli Virtanen
5071589aea bluez5: enable SBC-XQ codec by default, if allowed by quirks
Enable SBC-XQ by default, and move it at the end of the codecs list, so
that bluez does not connect to it automatically except when it is the
codec used previously.

When the codec is disabled by quirks, it won't appear in the codecs
list, and so can't be selected by user (and so won't be connected
automatically).

However, since SelectConfiguration does not carry information which
device is in question, we cannot prevent BlueZ connecting to the codec
even if it's disabled for a specific device. If the "impossible" occurs
regardless, we won't reject the connection and the profile will be shown
as the generic "A2DP" one.  If the sound is garbled, the user can select
some other profile that works.
2021-08-13 18:45:16 +00:00
Zsombor Welker
f5850af4d8 bluez5: handle XAPL battery level per Apple Guidelines
Corrects the handling of AT+XAPL Apple extensions to send
`+XAPL=iPhone,2` instead of `+XAPL: iPhone,2` based on Apple's
documentation.

Replaces magic numbers with enum values.

[Accessory Design Guidelines](https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf)
2021-08-13 10:30:36 +02:00
Zsombor Welker
a1777d00e3 bluez5: correct parsing order for HF indicator 2 based battery status
Since "AT+BIND=" was before "AT+BIND=?", the seconds statement was never
matched.
2021-08-12 21:13:22 +02:00
Torkel Niklasson
eff67c3c03 Add log level argument to ratelimit_test function
If a log message is rate limited, we only need to know about it if we
are actually interested in that log level. We therefore add an argument
to the ratelimit_test function to set the log level of the message
printed if a message is skipped

Change-Id: I5ccd4a78bf7e972fe8b0e7133cd7e08c1e38835f
2021-08-12 18:59:31 +00:00
Sanchayan Maity
be6824cb15 bluez5-device: Set device intended role for HFP 2021-08-12 18:54:46 +00:00
Zsombor Welker
f87942027f bluez5: report HF indicator 2 based battery status
HF indicator 2 (see [assigned-numbers], Hands-Free Profile) is able to
report battery percentage at 1% intervals (in range [0, 100]), contrary
to the `+XAPL` `+IPHONEACCEV` extension which only supports 10%
increments.  This does not guarantee increased granularity however, as
peers may still be limited to imprecise battery measurements internally
or round to coarser percentages.
Supporting both additionally broadens the range of devices for which PW
can report its battery level.

[assigned-numbers]:
https://www.bluetooth.com/specifications/assigned-numbers/
2021-08-12 18:45:44 +00:00
Wim Taymans
f816f702a5 filter-chain: make sndfile optional
Replace the code paths that require sndfile with a fallback when the
dependency was not found.
2021-08-12 09:59:56 +02:00
Wim Taymans
ce2b385318 filter-chain: protect against bad values 2021-08-11 21:33:56 +02:00
Wim Taymans
755eab0cd3 filter-chain: add more convolver options
Add gain, delay, offset, length, channels options.
Make default blocksize depend on the ir length.
2021-08-11 21:33:56 +02:00
Wim Taymans
dbe9f02471 filter-chain: add support to read from offset
So that the channel of the response file can be set
2021-08-11 21:33:56 +02:00
Wim Taymans
be9ac91ce1 filter-chain: read samples correctly 2021-08-11 21:33:56 +02:00
Wim Taymans
44c6ec146e filter-chain: parse config options
Remove LADSPA dependencies, only use it in ladspa_plugin.c
Parse convolver config, like filename
2021-08-11 21:33:48 +02:00
Wim Taymans
a2aaa71392 filter-chain: simplify plugin API some more 2021-08-11 21:12:38 +02:00
Wim Taymans
48136b4c2b filter-chain: simplify the plugin API 2021-08-11 21:12:38 +02:00
Wim Taymans
85dd03c2d8 filter-chain: make plugin wrapper
So that we can implement the internal plugins with a more expressive
API than LADSPA.
2021-08-11 21:12:36 +02:00