Commit graph

50 commits

Author SHA1 Message Date
Wim Taymans
fa66bf8187 pulse: use device.api property to mark HARDWARE
Check if there is a device.api property on the sink/source and
if there is, mark the sink/source as a hardware device.
2020-08-17 20:57:32 +02:00
Emmanuel Gil Peyrot
14fdf07e8f Run codespell on the entire codebase
This tool detects and fixes common English spelling mistakes, with
generally very few mistakes.

Here is the command I used to generate this commit.  There were a few
changes that had to be done manually, and of course adding the ignore
file:
```shell
codespell -I .codespell-ignore -x .codespell-ignore -w
```

I didn’t add it to the CI, but this would be a good place for it.
2020-08-17 17:16:31 +00:00
Wim Taymans
451fee2208 pulse: implement some more extensions
Most just return nothing or say that the extension is not supported.
Remove some warnings, they should show up in the log from setting
the error in the context.
2020-08-17 17:40:34 +02:00
Wim Taymans
62cea9c6d5 pulse: implement some more methods
Makes paman work
2020-08-17 17:22:14 +02:00
Wim Taymans
374210c890 acp: add per device port list
Add the list of possible ports for a device.
Pass the allowed devices in the routes.
Store the active port in the device.

Fixes enumeration of ports on devices with UCM.
2020-08-10 14:25:03 +02:00
Wim Taymans
377b3f9d42 pulse: always load the registry
Always get the registry, even if we're not using the introspect API
we still need it to keep track of the linked devices.
2020-08-04 18:16:02 +02:00
Wim Taymans
0b12cc96cc pulse: remove metadata store
We don't actually need to store all the metadata, we just need to
track the default sink and source property and store the value.
2020-07-31 15:47:14 +02:00
Wim Taymans
c7d7dd91f8 permission: add M permission
The M permission is needed to set metadata on an object.
2020-07-30 16:35:14 +02:00
Wim Taymans
f5e78196c4 pulse: check that we have access to change metadata 2020-07-30 16:23:13 +02:00
Wim Taymans
24755afee9 pulse: use format from node if available
And fall back to some defaults otherwise.
2020-07-29 14:42:29 +02:00
Wim Taymans
266e1301d2 use id to store default sink/source
This is easier to handle in general and we should not use the name
as a unique id. If the session manager wants to save things, it can
use whatever fields it wants from the object to create a unique
persistent name.
2020-07-23 11:59:13 +02:00
Wim Taymans
ff876bf58e introspect: set metadata type as well 2020-07-20 14:40:34 +02:00
Wim Taymans
62f7da880a pulse: clean up introspection
Make sure we always first update the registry.
Call callbacks with the right return value and set the context
error on errors correctly.
Remove some old code.
2020-07-20 13:13:22 +02:00
Wim Taymans
246ad5fb37 introspect: set target node as property
Use the metadata to tag streams with the desired target node.
2020-07-20 11:26:32 +02:00
Wim Taymans
ac97175380 pulse: don't try to do set_param when not writable 2020-07-16 13:25:03 +02:00
Wim Taymans
bf9b58e1f5 pulse: emit server change events when default sink/source change 2020-07-08 17:10:27 +02:00
Wim Taymans
6d41e17ca3 pulse: improve name of monitors 2020-07-08 16:10:45 +02:00
Wim Taymans
ee54cb96aa pulse: use metadata to store default source/sink
The metadata is implemented by the session manager and it can decide
what to do when the defaults change. It can also choose to save
(some of) the metadata to a database.

The metadata is also shared between applications so that changes can
be picked up immediately.
2020-07-07 17:09:46 +02:00
Wim Taymans
e030445e49 acp: add volume base and step
Add a READONLY property flag to makr properties READONLY
Set the base_volume and volume_step in the acp device
Send the base volume and step as REAONLY properties. Use these
in pulse layer.
2020-07-07 13:12:57 +02:00
Wim Taymans
cf8db93cd4 pod: add HARDWARE flag to spa_pod_prop
Add HARDWARE flag to mark a property that does some hardware control.
Mark the device volume/mute property as HARDWARE or not.
Use the HARDWARE property in pulse to set the right flags.
2020-07-06 17:46:32 +02:00
Wim Taymans
d3748ef254 introspect: fix default source/sink 2020-07-01 15:38:42 +02:00
Wim Taymans
f30a8f6895 context: fix context_id, use the client bound id 2020-07-01 15:38:36 +02:00
Wim Taymans
dc7868a476 pulse: control volume on device or node
Send the mute and volume values in the route param when hw volume
is available.
Check if the route has volume/mute and then use that to control the
volume instead of them node volume.
2020-07-01 15:36:50 +02:00
Wim Taymans
9ad2732405 pulse: handle volume and mute with the Route params
Update the device volume with properties from the Route param is
available.
Rework pulse a little to make sure we have all the globals ready
before performing the operation.
Update the volume/mute in the device route
2020-07-01 15:31:19 +02:00
Wim Taymans
4d7d9484e6 pulse: use route param to set current active ports 2020-07-01 15:24:50 +02:00
Wim Taymans
2bffb3561f pulse: handle error from volume set 2020-07-01 15:20:32 +02:00
Wim Taymans
1277e6cded context: update the Profiles and Routes in the card
Update the Profile and Route information directly into the card
info. Use this info to fill the port info for the sink and sources.
2020-07-01 13:57:14 +02:00
Wim Taymans
42cc30e1ee pulse: use EnumRoute to collect and report port info 2020-07-01 13:52:25 +02:00
Wim Taymans
698509ef55 alsa: set classes in the profile
parse classes in the pulse layer
2020-07-01 13:39:10 +02:00
Wim Taymans
03cef06dd2 pulse: improve introspect of profile availability 2020-07-01 13:27:20 +02:00
Wim Taymans
f79f0de681 introspect: improve card info 2020-07-01 13:24:57 +02:00
Wim Taymans
5feedbfd42 context: ensure the registry exists
Make sure we are watching the registry before we try to enumerate
objects.
When we wait for new object info, resync the pending operations
because they might depend on the info.
2020-06-24 19:36:47 +02:00
George Kiagiadakis
715be5dfe7 pulse: fix counter while populating card_info profiles 2020-06-18 10:01:47 +02:00
Wim Taymans
ba57de9b81 pulse: fix size calculation 2020-06-17 16:56:40 +02:00
George Kiagiadakis
9c8279aa6e pulse: fix pa_card_info.profiles2 array to be NULL terminated
profiles2 is meant to be NULL terminated, according to its documentation
Fixes a crash in pavucontrol-qt
2020-06-17 17:17:51 +03:00
Wim Taymans
7febf7ea25 improve debug 2020-04-06 18:01:19 +02:00
Wim Taymans
a5b0553328 Fix some -Wenum-conversion errors
Make pw_direction and spa_direction the same
Explicitly cast some enums or use the right enums
2020-04-04 20:03:08 +02:00
Wim Taymans
272fd4bd9f pulse: improve pa_operation compatibility
Methods that return a pa_operation should not return NULL.

pa_context_success_cb_t should return 1 on success and 0 on failure
with the error set in the context.

When a global is not found, let the info operation return eol = -1
with the error set in the context.
2020-02-03 16:44:50 +01:00
Wim Taymans
3dbcc7808c pulse: don't use endpoints
Revert back to using nodes, ports and devices. Let's first get this
stable until we add endpoints in the mix.
2020-01-13 11:44:55 +01:00
Wim Taymans
9b53c65c72 pw_endpoint_proxy -> pw_endpoint 2019-12-11 16:43:53 +01:00
Wim Taymans
f1eb5f6046 pw_device_proxy -> pw_device 2019-12-11 15:00:41 +01:00
Wim Taymans
49d736bbb7 pw_registry_proxy -> pw_registry 2019-12-11 09:44:48 +01:00
Wim Taymans
2fddfb02bd pulse: map stream index to endpoint 2019-11-29 13:34:09 +01:00
Wim Taymans
b432bda109 pulse: use monitor endpoints as monitor 2019-11-29 13:34:08 +01:00
Wim Taymans
8c43ebaf3e pulse: find linked endpoints
Set the stream node object-id as the node.id on the endpoint so that
the pulse api can find the linked endpoint.
2019-11-29 13:34:08 +01:00
Wim Taymans
3f3dfbc67e More session manager work
pulseaudio card is mapped to device
pulseaudio sink/source is mapped to an endpoint
prepare to map streams to card profiles
Add Route param to implement the endpoint routing later (ports)
Create an alsa endpoint for each device
Create one stream for each endpoint (Playback/Capture)

Implement create_link on the endpoint. The idea is to call
create link on the peer endpoint to complete the link. Remove
create_link on the session.

Add stream-monitor to turn pw_stream nodes into endpoints

Add a policy manager that tries to link endpoints

Use enum pw_direction for the endpoint direction. We can use the
media_class to determine if this is a pw_stream or not but it should
not really matter, you can link any output to any input.

Add autoconnect property for endpoints to make the policy connect.
2019-11-29 13:34:07 +01:00
Wim Taymans
edd011605d use endpoint in pulse 2019-11-29 13:34:07 +01:00
Wim Taymans
8bbfe876a7 Revert "WIP use endpoint in pulse"
This reverts commit 7a4a8d78b9.
2019-11-07 11:45:16 +01:00
Wim Taymans
7a4a8d78b9 WIP use endpoint in pulse 2019-11-06 11:34:14 +01:00
Arun Raghavan
37a72b2531 Merge pipewire-pulseaudio subtree 2019-11-03 15:20:57 +01:00