Commit graph

2055 commits

Author SHA1 Message Date
Pauli Virtanen 1e5f499ed3 bluez5: fix aptx-ll caps size
Ensure SEP exposed by Pipewire has the full aptx-LL caps also for duplex
profile.
2021-12-11 17:20:39 +02:00
Wim Taymans d86008cf8f support: set clock name for null-audio-sink 2021-12-10 12:43:03 +01:00
Wim Taymans 88987101ca bluez5: set clock name in SCO source and sink 2021-12-10 12:36:37 +01:00
Wim Taymans b4d33843a6 bluez5: set clock name 2021-12-10 12:31:44 +01:00
Wim Taymans c3bf07dff1 alsa-seq: make clock name configurable 2021-12-10 12:20:08 +01:00
Wim Taymans 53352c0c81 support: add property to configure clock name
Add a clock.name property on the driver node. By default this is
clock.system.monotonic for the monotonic system clock.
2021-12-10 11:22:23 +01:00
Wim Taymans 0648297fcb alsa: make it possible to configure the clock name
When nodes are synchronized to a common clock, the clock name can
be set to the same value on the alsa nodes and no resampling will
be done.
2021-12-10 11:04:38 +01:00
Wim Taymans 3ab3157bf1 channelmix: don't use default map for mono
Keep the original channel map so that we can match the channels
properly when remixing.
2021-12-09 17:32:41 +01:00
Wim Taymans 22a210e798 channelmix: 1 channel MONO or FC should be handled the same.
They were handled the same, remove the wrong line to attempt to
make them different.
2021-12-09 17:19:22 +01:00
Wim Taymans 6b34b8c44e audioconvert: fix mono channel mix test
When we have a single MONO channel, distribute and average. Otherwise,
use the logic to do proper mixing.

Adjust the unit test accordingly.
2021-12-09 16:51:40 +01:00
Wim Taymans ce02c7d435 channelmix: always handle 1 channel as mono
Handle 1 channel as a mono channel, which gets copied to all outputs
or gets the average of all inputs.

Fixes the case where a mono channel is handled like a FRONT channel
and then gets attenuated when mixed into left and right.
2021-12-09 16:03:32 +01:00
Michael Olbrich f5ec830cc2 v4l2: propagate vendor and device id to the node object
When pipewire is accessed through the portal camera API then only the
camera node objects are visible for the client.
However, chromium wants to know the vendor and device ids to identify
cameras. And those properties are currently only added to the device
object.
Fix this by propagating the ids to the node object.

Fixes #1879
2021-12-09 10:20:59 +01:00
Michael Olbrich 22d668a8a0 v4l2-device: remove unused member variable device_name
This variable was introduced in the initial commit but never used.
Just remove it.
2021-12-09 10:20:59 +01:00
Wim Taymans 30a78fe2b8 alsa: improve debug
Remove the rather useless dll values.
Add the threshold
2021-12-07 12:05:49 +01:00
Wim Taymans 10e71264e7 resample: recalc rate match when out of buffers
When we don't have any input buffers, recalculate the rate match
size field so that we can know the size of the expected buffer.

We already do this when starting but it might have been done with
a different quantum.
2021-12-03 17:54:00 +01:00
Wim Taymans 401e56699d audioconvert: listen for merger and channelmix for params
List all the params of the merger and resampler.
2021-12-02 11:35:13 +01:00
Wim Taymans 5d85e85ba7 audioconvert: remove listener for resampler
When adding a listener, don't add a listener for the resampler because
it does not contribute to the result, we only listen for results from
the resampler.
2021-12-02 11:35:13 +01:00
Wim Taymans 73b5e7aec4 audioconvert: expose more config options
Use the PROP_param to list and configure additional config options.
2021-12-02 11:35:13 +01:00
Wim Taymans 385246f5a1 audioconvert: only update the arrays when valid
Only update our internal channelmap/volumes array when we actually
parsed something.
2021-12-02 11:35:13 +01:00
Wim Taymans 7b4b73ae5b channelmix: only remap volumes when we have a format
Or else we remap to 0 channels and lose all info.
2021-12-02 11:35:13 +01:00
Wim Taymans 77d66d73d1 audioadapter: return result from enum_param directly
There is no need to pass the result in an argument, just return the
value from the function.
2021-12-02 11:35:13 +01:00
Wim Taymans 57361ed0ee alsa: improve param log a bit 2021-12-02 11:35:13 +01:00
Wim Taymans e31f9aa0f2 alsa: don't set id in PropInfo for params
The id is useless when dealing with props params, we need to use the
name of the property as the key. Also the id can clash with other ids
of other plugins.
2021-12-02 11:35:12 +01:00
Wim Taymans e3ddcc3b19 audioadapter: also update the follower PropInfo flags
So that we can enumerate them.
2021-12-02 11:35:12 +01:00
Julian Bouzas 921a9038e1 spa: audioadapter: check if follower supports enum params before requesting them
Some follower nodes don't support all audioadapter params (For example, param
SPA_PARAM_Props is not supported by 'support.null-sink'). This change adds a
check to avoid unsuported errors when requesting a param that is not supported
by the follower.
2021-11-30 17:33:17 +00:00
Julian Bouzas 84e210ded9 spa: test: remove port EnumFormat param info
Both fakesink and fakesrc nodes don't support it.
2021-11-30 17:33:17 +00:00
Wim Taymans befe7b13eb alsa: add position and format to props params 2021-11-30 18:19:08 +01:00
Wim Taymans d673158db1 alsa: expose all config options as params
Add PropInfo for all the params that we can configure at construct
time and also add them as PROP_params.

This way you can configure the headroom at runtime with this:

pw-cli s <id> Props '{ params = [ "api.alsa.headroom" 1024 ] }'
2021-11-30 17:43:07 +01:00
Wim Taymans d79d2f69fb alsa: improve debug
Log the configured default_format.
2021-11-24 17:25:59 +01:00
Wim Taymans 8995129e6c alsa: refactor property parsing
Move the common property parsing to the init function.
2021-11-23 12:27:36 +01:00
Wim Taymans 25bfc9c63d alsa: refactor a bit
Make spa_alsa_close() do spa_alsa_pause() first and also clear the
format.
2021-11-23 12:20:27 +01:00
Wim Taymans 13923416e0 alsa: keep track of rate in card object
Expose the card object and always obtain one per pcm.

Keep the configured format in the card object.

Add a api.alsa.multi-rate property. When multi_rate is disabled,
only allow the last configured card rate on all PCMs.

This works around drivers that can't handle multiple samplerates
on their PCMs.

With this patch it should be mostly safe to configure multiple
sample rates in pipewire.conf

See #1547
2021-11-23 11:44:26 +01:00
Wim Taymans f5f66d1718 alsa: free card on error 2021-11-17 12:55:51 +01:00
Wim Taymans 947ee152d3 bluez: check dbus service before enumerating objects
First check if the bluez dbus service is active before doing a
GetManagedObjects() call.

Else we might try to activate the bluetooth dbus service, which
should normally only be activated during bootup.
2021-11-17 12:00:00 +01:00
Wim Taymans 7eee45ff41 alsa: remove stray log line 2021-11-17 10:52:43 +01:00
Wim Taymans f10b872733 resample: improve buffer size calculations
Scale the buffer size with the rate conversion ratio. Also make sure
that we can at least produce a maximum quantum of samples.

If we have large upconversion (8KH -> 48KHz) and small input
buffers, we would not allocate enough space for the output buffer
and cause xruns in the sink.

Fixes #1809
2021-11-16 11:48:02 +01:00
Wim Taymans 263adb45f4 audioconvert: fix compilation on armv7 2021-11-11 11:21:07 +01:00
Pauli Virtanen 2329a4d323 bluez5: quirks for headset without a2dp duplex codecs
See #1756 (another headset with non-working, probably faststream duplex)
2021-11-08 08:25:55 +00:00
Barnabás Pőcze 01de0b966a spa: bluez: simplify and move handling of some AT commands
Simplify the key-value pair parsing for AT+IPHONEACCEV commands,
and move the handling of {key,indicator}-value pairs into
dedicated functions. Furthermore, fix a comment.
2021-11-04 18:42:29 +01:00
Barnabás Pőcze bdd7570c6f spa: bluez: simplify loop
`spa_list_for_each_safe()` is not needed as the list is not
modified during the traversal, so use `spa_list_for_each()`.
2021-11-04 17:16:14 +00:00
Barnabás Pőcze f71910c665 spa: bluez: rename variable
The `optlen` variable holds the size of a socket address,
so rename it to `addrlen`.
2021-11-04 17:16:14 +00:00
Barnabás Pőcze 6410a2dfa4 spa: bluez: fix spelling 2021-11-04 17:16:14 +00:00
Barnabás Pőcze 1f927838e2 spa: bluez: remove unnecessary return 2021-11-04 17:16:14 +00:00
Barnabás Pőcze 4bdf495747 spa: bluez: move profile selection to function
Move the profile selection from `profile_new_connection()`
into a separate function to avoid checking the string more
than necessary.
2021-11-04 17:16:14 +00:00
Barnabás Pőcze dd4587acef spa: bluez: change argument type
Take the `rfcomm` object directly instead of taking a `spa_source`
object and retrieving the `rfcomm` object via its `data` member.
2021-11-04 17:16:14 +00:00
Barnabás Pőcze 4cf889a5f0 spa: bluez: use switch
Use a switch statement instead of an `if` because it is more
suitable in the presence of `#ifdef`s, it avoids potential
unnecessary extra checks.
2021-11-04 17:16:14 +00:00
Barnabás Pőcze 73690d6662 spa: bluez: add missing else 2021-11-04 17:16:14 +00:00
Barnabás Pőcze 57ff7abc68 spa: bluez: use spa_startstartswith() where appropriate 2021-11-04 17:16:14 +00:00
Wim Taymans 86ca0f8466 acp: improve debug of channel map
Increase the size of the channel_map debug printf buffer.
Use a safer version of the snprintf that avoids buffer overruns.

See #1781
2021-11-04 16:41:32 +01:00
Wim Taymans abacea5ca0 libcamera: improve debug 2021-11-03 17:49:10 +01:00