Commit graph

7180 commits

Author SHA1 Message Date
Wim Taymans
9dfe35b17c alsa: add enumeration of iec958 format
For hdmi and iec958 devices, enumerate the iec958 formats and
codecs. Initially only PCM is supported as a codec but with
a property or an init option, the list of codecs can be dynamically
configured.
2021-08-23 11:31:52 +02:00
Wim Taymans
8147772cf5 spa: add definitions for IEC958 (S/PDIF)
Add Format subtype and codec property.
Add codecs to include in the format codec property.
Add property to configure elements with supported codecs.
Add type info.
2021-08-23 11:31:52 +02:00
Wim Taymans
0af0cceca2 audioadapter: use format directly when reconfiguring
There is no need to parse and then recreate the format.
2021-08-23 11:20:52 +02:00
Wim Taymans
2427eeae2b audioconvert: reset converter format as well
Reset the format of the converter so that when we go back to DSP mode,
we don't expose the old ports again.
.
2021-08-23 11:20:52 +02:00
Wim Taymans
8f7a972a48 audioadapter: fix passthrough switching some more
Remove the follower ports when leaving passthrough, add the DSP
ports.
Set up the link_io between follower and convert again when leaving
passthrough.
2021-08-23 11:20:40 +02:00
Wim Taymans
9090f19b0a audioconvert: improve passthrough mode
When in passthrough mode, use the position io to update the
io_rate_match fields for the follower. This makes it possible for the
follower to also provide the right amount of data when the converter
is not selected in passthrough.

Add an option to configure the converter in None port config where it
removes all the ports. We can use this when removing the converter to
make sure all it's ports are removed.

When we remove the converter, make sure we expose the follower ports
directly so we can use them for passthrough.
2021-08-23 11:11:11 +02:00
Wim Taymans
24f61deefd media-session: also check restore-stream when info updates
We only need an info update to restore the stream so check for that
in addition to a param update.

The info update can be used to restore the stream and the param update
to update the stored value.
2021-08-23 10:58:29 +02:00
Pauli Virtanen
7362a6be04 bluez5: update mSBC kernel version blocklist
Also versions 5.10.y, y >= 51 contain patch that removes ALT 1 support,
and fix has not reached stable yet.
2021-08-23 08:21:44 +00:00
Pauli Virtanen
82fc54f252 media-session: bluez-autoswitch: save user-selected headset profile
When switching back from the recording mode, save currently selected
profile as the default headset profile to use in future.

This allows users to select a specific profile they want to use for
input, and to avoid autoswitching to HFP/HSP if they want to use a
different microphone, without needing to edit configuration files.
2021-08-23 08:21:13 +00:00
Pauli Virtanen
ab5fcf4a66 bluez5: boost A2DP duplex microphone volume by 20 dB
There doesn't seem to be a way to control the A2DP duplex microphone
HW volume gain, and devices sometimes have very low mic volumes.

Work around this by boosting the software volume scale by +20 dB.  If it
causes clipping, the user can just reduce the volume to bring SW gain
below 1.0.
2021-08-23 08:17:46 +00:00
Pauli Virtanen
e08cdf27d5 bluez5: add FastStream codec
A2DP codec that uses SBC.  Has a duplex channel, which sends an SBC
stream back.
2021-08-23 08:17:46 +00:00
Pauli Virtanen
c628975a75 bluez5: update fastream caps from bluez 2021-08-23 08:17:46 +00:00
Julian Bouzas
b368bea98c audioconvert: do _port_set_param on fmtconvert if convert mode
The fmtconvert plugin does not support SPA_PARAM_PortConfig. Instead, we need to
set the format in the specific port with SPA_PARAM_Format.
2021-08-23 08:11:21 +00:00
Pauli Virtanen
dedc08cdf8 bluez5: enable duplex for aptx-ll
aptX-LL sink devices may send back mSBC encoded data corresponding to
microphone input.  It appears to be enabled when the bidirectional link
is set in the caps, and the device also supports this.

Implement mSBC decoding in the duplex channel.

Tested to be working on Avantree Aria Pro.
2021-08-22 17:41:50 +03:00
Pauli Virtanen
623b6df8a2 bluez5: work around obscure issue with a2dp-source with duplex
For unknown reason the BT socket when working with A2DP "duplex" stream,
sometimes stops waking up poll when data arrives. Regardless, recv() can
read data packets from it.

To work around this, when A2DP source is in duplex mode, instead of
polling on data, we poll on a timer.
2021-08-21 20:00:52 +03:00
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