Commit graph

2560 commits

Author SHA1 Message Date
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 2f82661966 spa: add description to PropInfo 2021-11-30 17:40:56 +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
Wim Taymans b75796054c spa: include dict.h
It causes a compiler warning on armv7
2021-11-11 10:59:23 +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
Wim Taymans 0fd5e3fdb2 libcamera: implement allocation and dataflow
Keep track of the negotiated parameters and use those to construct
the Buffers param.

Use the FrameAllocator to allocate buffer memory. Keep a request for
each buffer and queue them.

In requestComplete, put the request metadata info into the buffer and
header and write the finished buffer id to a ringbuffer. Then wake up
the data thread to pop the finished buffer_id and push it in the
graph.

Remove some old files.
2021-11-03 17:49:10 +01:00
Wim Taymans b2c38a2b3b libcamera: work on rewrite
Use manager to hotplug devices
Use StreamConfig to enumerate formats
2021-11-03 17:49:10 +01:00
Wim Taymans 84ecebbd4e cpu: only run SSE code when supported
Check if we can run SSE instructions before executing the denormals
SSE code.

Fixes #1775
2021-11-02 20:12:35 +01:00
Aleix Pol 925644fbcc spa/meta: Expand the documentation of SPA_META_VideoDamage
A bit of explanation of how it's meant to be used.
2021-11-02 15:53:16 +01:00
Wim Taymans 859e95126b alsa-seq; use port_type to check port type
Don't use the capabilities for checking the port type.
2021-11-02 14:57:36 +01:00
Thomas Weißschuh 4921c5e94b defs: use intptr types where applicaple
Instead of doing pointer arithmetic through actual pointers, cast them
to the proper integer types.
This is functionally equivalent to the previous code but is clearer for
the compiler.

Fixes #1018
2021-11-02 09:54:10 +00:00
Pauli Virtanen bbc2136e89 meson: ensure all examples are included in doc
Move declaration of examples to use same file lists for build and docs.
2021-11-02 09:46:14 +00:00
Wim Taymans 9f134ee79d v4l2: add support for ParamBegin/End
To keep the device open while we perform a series of param
enumerations.
2021-10-29 15:41:27 +02:00
Wim Taymans 0ace131d72 audioconvert: add stereo deinterleave neon asm
This can take some shortcuts and convert twice as many samples in one
iteration as the strided stereo deinterleave one.
2021-10-28 11:30:04 +02:00
Wim Taymans 3471391e0e spa: add RequestProcess command and event
The event is emitted by a node that is not a driver but wants the graph
to be scheduled. The command is sent to the driver and suggest that the
graph be scheduled.
2021-10-27 11:16:53 +02:00
Wim Taymans eea6e7a1fb spa: add method to check if an object is fixated
See #1732
2021-10-25 18:08:10 +02:00
Wim Taymans 2cddd4a775 cpu: disable VFP asm when not available
Fixes #1746
2021-10-25 16:32:16 +02:00
Philippe Normand f0d3a7cf49 spa: alsa: Fix build warning
`type >=0` always evaluates to true, so remove this condition.
2021-10-25 07:26:15 +00:00
Philippe Normand 6b1c483cf7 spa: v4l2: Convert buf structure to union and fix alignment
The inotify_event field has a variable sized type, so it's recommended to store
it at the end of the storage unit. Fixes gnu-variable-sized-type-not-at-end warning.
2021-10-25 07:26:15 +00:00
Philippe Normand ec7ed1275e spa: alsa: Switch to explicit fallthrough
Use `__attribute__((fallthrough))` through the new FALLTHROUGH macro, if
supported.
2021-10-25 07:26:15 +00:00
Gleb Popov 12a4fbb425 Use uint16_t instead of int16_t to fix a compiler warning. 2021-10-22 19:05:18 +03:00