Commit graph

5674 commits

Author SHA1 Message Date
Wim Taymans
7053936ffd don't attempt to connect to empty remote name
Fixes jconvolver startup.

See #744
2021-02-18 10:22:39 +01:00
Wim Taymans
81ebc33b57 pw-top: period -> quantum
period has other connotations in alsa
2021-02-18 09:16:49 +01:00
Wim Taymans
c0d8edeb5a conf: improve state directory access checks
We only need RW permission on the last directory.
2021-02-17 20:21:14 +01:00
Wim Taymans
bf062e455a media-session: always remember the new route availability 2021-02-17 15:49:20 +01:00
jasker5183
76febf1c7f Add Link to Wiki 2021-02-17 13:53:25 +00:00
Frédéric Danis
bdbd0f17c6 bluez5: backend_native: Fix backend_native_new() error path 2021-02-17 14:03:06 +01:00
Wim Taymans
aea79cd79c media-session: sanitize description
Because we use the description as the JACK name, remove the : so
that it looks somewhat ok in more cases.
2021-02-17 13:12:22 +01:00
Wim Taymans
60233e30a7 jack: tweak names a little
Move the Description in the main node/port name. This then matches
the device names seen in pavucontrol.
Make the port alias contain the node nick.
2021-02-17 11:36:16 +01:00
Wim Taymans
e66cb18659 jack: find system: port names as well
Make a system:capture_N or system:playback_M name for each port
and use this also in find_node when the node is a default node.
This makes it possible to

jack_connect system:capture_1 system:playback_1

and make it link the default source to defaukt sink.

Fixes #446
2021-02-17 11:16:02 +01:00
Wim Taymans
39cf575210 jack: don't log errors, let app deal with it 2021-02-17 11:15:31 +01:00
Wim Taymans
1f2ba4b55f port: set port id in properties 2021-02-17 11:15:08 +01:00
Frédéric Danis
01b6dbfca6 bluez5: backend_native: Add mSBC support to HFP HF 2021-02-17 10:19:39 +01:00
Wim Taymans
38a7333608 adapter: number unknown ports from 1 instead of 0
This makes it like what jack does.
2021-02-17 10:14:47 +01:00
Wim Taymans
c7b7afa664 audioadapter: fix enum of properties
Keep track of the subelement we're iterating in the result index upper
bits. Use enum_sync to iterate each param and switch to the next
element when we run out of params.

See !468
2021-02-17 09:59:00 +01:00
Wim Taymans
0ed7e537fb acp: make Pro devices look better
Omit the Output/Input string from the name
Don't print a number for the first device.

See !466
2021-02-16 20:21:53 +01:00
Frédéric Danis
7a96f3a945 bluez5: backend_native: Fix SCO deferred setup accept
In BT_DEFER_SETUP mode, when a connection is accepted, the listening
socket is unblocked but the effective connection setup happens only on
first receive, allowing to configure the accepted socket.

First read from the accepted socket is non-blocking and returns a zero
length buffer.
2021-02-16 18:30:11 +01:00
Wim Taymans
344eb2baa3 bluez5: handle info == NULL when parsing codecs 2021-02-16 17:58:56 +01:00
Frédéric Danis
23823867b0 bluez5: backend_native: Fix +BRSF parsing for HFP HF 2021-02-16 16:49:04 +00:00
Frédéric Danis
be7caf0e66 bluez5: backend_native: Fix default HFP codec 2021-02-16 16:49:04 +00:00
Wim Taymans
3aa0a39e30 pulse-server: track volume/mute changes
When something else changes the volume of our stream, store the new
value in our volume/mute state so that we always have an up-to-date
value when we compare our volume to the desired volume.

See #721
2021-02-16 17:21:26 +01:00
Wim Taymans
6079830591 media-session: add option to configure suspend timeout
Set the property on the node and use the value when suspending the
node. a timeout of 0 disables suspend.
2021-02-16 15:41:53 +01:00
Wim Taymans
38e0ff55cd acp: don't add pro profile for UCM
For UCM, we can just as well make a use case in the UCM file.
2021-02-16 15:17:26 +01:00
Wim Taymans
ca10c6470f audioconvert: use sizeof for position size
And make the position field a little larger
2021-02-16 15:07:40 +01:00
Frédéric Danis
0061ddd6be audioconvert: Fix buffer overflow
This was introduced by commit c160a063b9
2021-02-16 14:56:17 +01:00
Wim Taymans
af686653a9 jack: add option to merge monitors
Make a different name for the monitor port prefix so that they
appear as different clients.
Add an option to restore the previous behaviour.

See #736
2021-02-16 13:23:47 +01:00
Wim Taymans
d1f21a939a context: make method to get config section
Applications will likely need a section of the config, not the
whole thing.
2021-02-16 13:22:42 +01:00
Wim Taymans
b62771c3cb acp: fix mapping name 2021-02-16 12:53:23 +01:00
Wim Taymans
5892403b01 acp: add a Pro Audio profile
The Pro Audio profile exposes all devices and subdevices with maximum
channel count and no channel layout. It also have no hardware volume
and is more suited for Pro Audio usage.

See #731 #704 #57
2021-02-16 12:34:59 +01:00
Wim Taymans
91610bd1a9 merger: emit params changed event when reconfiguring
The props param changes when the number of channels changes.
2021-02-16 12:34:59 +01:00
Wim Taymans
c160a063b9 audioconvert: handle unexpected channel positions 2021-02-16 12:34:59 +01:00
Wim Taymans
ef98361630 audioconvert: when we reconfigure, emit param changed event
When we reconfigure the node, the Props param changes with the
new number of channels.
2021-02-16 12:34:59 +01:00
Carlos Rafael Giani
b17fe4aba4 meson: Make SDL2 and libsndfile dependencies configurable
This is important for cross-platform build frameworks such as Yocto
where the build configurations must be deterministic. In this case, if
some other build dependency pulled in SDL2, then the meson.build logic
would suddenly enable extra features that would not have been built
otherwise. By allowing for explicitely enabling/disabling SDL2 and sndfile
depending bits, this problem is fixed.
2021-02-15 17:12:48 +01:00
Frédéric Danis
0b2d3730b6 bluez5: Add HFP HF support 2021-02-15 14:46:18 +00:00
Wim Taymans
d6afdda898 audioadapter: enumerate node params from follower as well
Enumerate the params from the follower as well.
Configure params on the follower and converter.
When follower params changes, emit event.

See !460
2021-02-15 15:43:03 +01:00
Wim Taymans
e7aa15e475 audioadapter: only check port params when changed 2021-02-15 15:39:39 +01:00
Wim Taymans
7ba9044c3d Revert "media-session: fix sm_object ownership"
This reverts commit 791a38f3fa.
2021-02-15 15:28:42 +01:00
Wim Taymans
a85be79135 Revert "media-session: when resolving duplicate objects, bind a proxy if missing"
This reverts commit 77e4fdb1e4.
2021-02-15 15:28:35 +01:00
Ivan
4930157875 editorconfig: add rule for conf files to use space indentation 2021-02-14 21:33:23 +02:00
Wim Taymans
373fd53d2e conf: fix audioconvert regex 2021-02-13 20:38:02 +01:00
Ivan
7e7f0225d4 style: Format and fix config files
Some minor formatting for recently added config files.
2021-02-13 19:20:10 +00:00
Wim Taymans
3c9996aa78 spa: add tool to dump spa json file to plain json 2021-02-13 20:17:27 +01:00
Pauli Virtanen
77e4fdb1e4 media-session: when resolving duplicate objects, bind a proxy if missing
When duplicate objects are created, the new object has missed its
registry_global event, and is missing its proxy.

In this case, bind a proxy for the new object.
2021-02-13 19:04:21 +00:00
Pauli Virtanen
791a38f3fa media-session: fix sm_object ownership
sm_object may be owned by either (i) monitors, created via
sm_media_session_create/export*, or (ii) registry, via
registry_global+bind_object.  However, registry adds the objects to its
globals list when their proxy appears, even if it does not own them.

Only owner should call sm_object_destroy which unrefs obj->handle,
because the sm_object structure is stored inside the handle's user_data
and becomes invalid afterward.

The sm_object_destroy call removes the object from the registry globals
map, so if monitor calls first, there is no problem. However, sometimes
the registry wins the race.

Previously, registry did sm_object_destroy regardless of whether it owns
the object or not, possibly causing the monitor's sm_object_destroy to
refer to freed memory. This could cause segfaults, e.g.

    CARD=XX:XX:XX:XX:XX:XX
    bluetootctl connect $CARD
    while true; do pactl set-card-profile bluez_card.$CARD a2dp-sink; pactl set-card-profile bluez_card.$CARD off; done

leads to a race between bluez5_remove_node and registry_global_remove,
and problems appear when the latter wins.  (As usual, if it doesn't
segfault, a heisenbug appears instead.)

Fix this by keeping track who owns the objects, and having registry
destroy the objects only if it owns them. Otherwise, it just removes
them from its lists.

Also call pw_proxy_unref unconditionally in sm_object_destroy, so its
asserts catch refcounting errors (although now there shouldn't be any).

***

Another problem is conflict between bound_proxy and register_global,
which generates duplicate objects with the same id.  We resolve this by
keeping the object not owned by the registry and discarding the other
one.

This fixes a memory leak, and possible consistency problems in session
modules (due to session_create events for different objects with same
id; now there will be paired session_remove ones in between).
2021-02-13 19:04:21 +00:00
Pauli Virtanen
0dee15d0f6 bluez5: aac: set reasonable default bitrate
Set default bitrate to a reasonable value in caps, and handle unknown or
bogus bitrates from device.
2021-02-13 19:03:13 +00:00
Wim Taymans
b23e33c99f media-session: only replace : with space for node.nick 2021-02-13 07:17:55 +01:00
Be
3b5e040659
pw-uninstalled.sh: use directory of script instead of current dir
This allows running the script from outside the PipeWire source
tree, which is convenient for developing other applications for
use with PipeWire.

Fixes #720
2021-02-12 15:05:34 -06:00
Wim Taymans
0945b10227 jack: handle bridge nodes
Bridges have the device name in the port names so use this info
to construct better port names. Makes midi devices show up
as separate clients.
2021-02-12 21:15:14 +01:00
Wim Taymans
062911640c media-session: sanitize name and nick
Replace unwanted chars in the name with _. This makes it compatible
with pulseaudio names and avoids problems with regex.
Replace unwanred chars in the nick with ' '. This ensures JACK
clients don't receive ':' in the device names, which cause it to
fail when parsing the ports.

See #714 and #130
2021-02-12 20:47:41 +01:00
Wim Taymans
ac910c7c1c Revert "jack: improve short name"
This reverts commit 8101334b1e.

We should use the same logic as jack1 and jack2 to improve
compatibility.
2021-02-12 20:46:34 +01:00
Wim Taymans
1e89b7cdc4 Revert "jack: sanitize client and port names"
This reverts commit 0ad8f0a6aa.

We should not do this here. We should instead sanitize the names
at the source.
2021-02-12 20:45:33 +01:00