Commit graph

4489 commits

Author SHA1 Message Date
Wim Taymans
2f02928580 pulse: add more debug 2020-09-10 13:04:56 +02:00
Wim Taymans
dc2cfb2bd2 jack: only report latency for terminal ports
Only report latency for terminal ports for now and use the buffer
size as the latency.
2020-09-10 09:15:47 +02:00
Sanchayan Maity
f4a949dc3a examples: media-session: Conform to XDG base directory spec
Currently pipewire-media-session uses ~/.pipewire-media-session for
storing configuration. Use home directory as specified by XDG base
directory specification viz. XDG_CONFIG_HOME and fall back to using
a default of $HOME/.config as per the spec if XDG_CONFIG_HOME is not
set or empty. Also in addition, all cases are now handled the same
and always end up using "%s/.config/pipewire-media-session".

If neither XDG_CONFIG_HOME or HOME are set, fall back to the earlier
approach.

Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/271

Signed-off-by: Sanchayan Maity <sanchayan@asymptotic.io>

Fixes !298
2020-09-09 17:51:30 +02:00
Wim Taymans
d456893f31 acp-device: just always select the best port/profile for now 2020-09-09 14:12:00 +02:00
Wim Taymans
4a35fcaf09 acp: update Route and Profile param on availability change 2020-09-09 14:10:17 +02:00
Wim Taymans
6e339200af acp: improve port and profile index select
Keep 3 options, the available ports, unknown and highest priority
other ports.
2020-09-09 14:08:15 +02:00
Wim Taymans
5f38562d38 acp: remove active_port_index
It is not clear if the port index is in the card or device port array
and it doesn't work when many ports are active. So simply iterate the
device ports and find the ones with the active flag set.
2020-09-09 13:57:33 +02:00
Wim Taymans
c8700b2e4b pulse: keep track of availability of active port
Also emit a device change event when the availability of the
active port changes.
2020-09-09 13:51:42 +02:00
Wim Taymans
8638fd0411 pulse: improve operation handling
First move all completed operations to a new list, then complete
the operations and cancel the ones that are not completed correctly.
This ensures that new operations from the callbacks don't get
completed immediately as well.
2020-09-09 13:49:09 +02:00
Wim Taymans
af64666716 pulse: call operation_done at end of callback 2020-09-09 13:48:01 +02:00
Wim Taymans
a477e39de2 pulse: improve debug 2020-09-09 13:47:20 +02:00
Wim Taymans
734dc72bf2 context: don't leak device port info 2020-09-09 13:22:09 +02:00
Wim Taymans
a956c265a2 acp: also act on new available ports 2020-09-08 16:49:07 +02:00
Wim Taymans
5e368b1ad6 acp: add option to switch profile and ports
Enable an option to switch to the next best profile and port when
the current one becomes unavailable.
2020-09-08 16:39:47 +02:00
Wim Taymans
368366b88d alsa: avoid loading the plugin when linked against 0.2
chromium is linked against 0.2, avoid trying to load the alsa
plugin that is linked against 0.3

See #275
2020-09-07 17:41:50 +02:00
Simon McVittie
a652edce0a Only assert about x86_64 struct sizes if ABI is LP64, not x32
The __x86_64__ macro identifies a CPU family, and is unfortunately not
enough to identify a concrete ABI.

The normal x86_64 ABI that is used by practical Linux distributions is
LP64 (i.e. 32-bit int, and 64-bit long and pointer), and defines
__x86_64__ and __LP64__.

x32 is a niche ILP32 ABI (i.e. 32-bit int, long and pointer) for x86_64
CPUs, which has different struct sizes due to sizeof(long) and
sizeof(void *) being smaller. It defines __x86_64__ and __ILP32__.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-09-07 15:21:17 +00:00
Simon McVittie
b8c58c74d8 Link pipewire-jack to libatomic if required
This is necessary on some 32-bit architectures that implement atomic
operations on 64-bit quantities as library calls, including Debian's
armel and mipsel ports.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-09-07 15:17:57 +00:00
Emmanuel Gil Peyrot
8332ee0c25 spa: replace rindex() with strrchr()
Linux man-page says rindex() got “marked as LEGACY in POSIX.1-2001, [and
removed in] POSIX.1-2008”.
2020-09-07 15:10:29 +00:00
Wim Taymans
0d1b01147f context: handle route changes better
Track the current route and the properties independently. Else we
might skip parsing the volumes/mute properties when the current
route didn't change.

Fixes #281
2020-09-07 16:54:21 +02:00
Wim Taymans
d995df95f8 jack: small cleanup 2020-09-07 16:16:26 +02:00
Wim Taymans
1f6a0635ea data-loop: small cleanup
So that we exit the function via only one path.
2020-09-07 16:15:36 +02:00
Wim Taymans
9abcff8312 stream: Only disconnect once
When a stream is destroyed while disconnecting, don't try to disconnect
again.

Fixes #280
2020-09-07 16:06:20 +02:00
Wim Taymans
f541bf9037 pulse: implement custom mainloop poll function
Implement setting a custom poll function. When there is a custom
function, just poll the epoll fd in it.

Fixes #276
2020-09-07 15:50:58 +02:00
Wim Taymans
b6e84ded75 alsa: protect against SIGPFE
Make sure we don't try to divide by 0 when the app calls the status
before we are PREPARED.

Fixes #283
2020-09-07 14:57:47 +02:00
Wim Taymans
71441565fd pulse: rework sync
Use a global sync that both syncs the globals and completes the
operations.

In the case of a card profile change, first the nodes are removed
and added and then the Profile and Route info updated. We need to
be able to bind to the new node and get the device.profile.id
before we can find the active port of the node.

See #279
2020-09-07 14:36:25 +02:00
Wim Taymans
185a3d4c36 alsa: update route param when profile changed
When the profile changes, also update the route param.
Use defines to index the parameters
2020-09-07 14:32:56 +02:00
Wim Taymans
030bef8dd3 alsa: use PIPEWIRE_PROPS for extra stream properties 2020-09-04 16:53:45 +02:00
Wim Taymans
64ee110356 alsa: rework process function to support planar formats 2020-09-04 15:40:22 +02:00
Wim Taymans
bfc91c27a6 alsa: implement planar formats some more 2020-09-04 13:49:51 +02:00
Wim Taymans
9a7cbeea83 channelmix: improve undefined channel layout
When we have no channel layout, just copy input to output
channel.
Optimize this case in the mixer implementation.
2020-09-04 13:41:24 +02:00
Wim Taymans
6f4f9e5abb alsa: support planar types
We can support 2 buffers.
2020-09-04 12:23:11 +02:00
Wim Taymans
3eafa6312f channelmix: add default channelmap for 5 and 7 channels 2020-09-04 12:22:30 +02:00
Wim Taymans
950e81c5fb alsa: put mixer entry in alsa conf files 2020-09-03 14:40:46 +02:00
Wim Taymans
089ec424d7 impl: emit error on resource when error
When the state of the object changes to ERROR, emit an error message
on the resources as well. Also pass the error code around for this
purpose.
2020-09-03 14:21:59 +02:00
Wim Taymans
f7d8fef070 channelmix: normalize volumes
Normalize the volumes.
Don't mix in LFE by default but add an option
Move some booleans to flags
Improve some checks for fastpaths.
2020-09-03 13:20:36 +02:00
Wim Taymans
289a8e86ca stream: move some debug to trace 2020-09-03 13:19:55 +02:00
Wim Taymans
b6e78f5577 improve debug 2020-09-03 11:14:58 +02:00
Wim Taymans
4c372a87ca pw-jack: add samplerate and period options 2020-09-03 11:14:29 +02:00
Wim Taymans
b62fa9faf2 channelmix: disable normalize for now
Volume is too low and we don't choose the right functions all the
time. Needs more work.
2020-09-02 18:50:01 +02:00
Wim Taymans
5dea431372 channelmix: normalize matrix to avoid clipping 2020-09-02 18:36:42 +02:00
Wim Taymans
b8d65895c2 a2dp: try to completely process the queue
Continue processing the input data until we can't send anymore. When
we are following another driver, we need to process each buffer in
the cycle completely or we will start lagging behind.
2020-09-02 17:51:33 +02:00
Wim Taymans
b54571c5a1 a2dp: fix check 2020-09-02 17:16:16 +02:00
Wim Taymans
d7fb382b7b a2dp: place buffer id in io when reusing 2020-09-02 17:04:19 +02:00
Wim Taymans
dd0f4c7295 policy-node: only send PortConfig on audio nodes
0.2 version don't handle this correctly.

Possibly fixes #270
2020-09-02 14:25:11 +02:00
Wim Taymans
6b50279364 bluez5: add a simple clock to sinks/sources
Fixes #269
2020-09-02 13:36:22 +02:00
Wim Taymans
4867edb947 channelmix: read mix coefficients correctly
Fix 5p1 to stereo mixdown by reading the coefficients correctly.
Align 5p1 to quad SSE and C implementation

Fixes #272
2020-09-02 11:15:23 +02:00
George Kiagiadakis
613824ab0b metadata: set bound id on the exporting resource 2020-08-31 15:57:52 +03:00
Frédéric Danis
d607a461ce bluez5: backend-hsphfpd: Fix crash when switching profile to HFP 2020-08-25 16:43:03 +02:00
Wim Taymans
0720eb2aeb introspect: fix sink monitor name 2020-08-21 17:27:14 +02:00
Wim Taymans
0b588b2bfd pulse: track loaded modules
Track the proxies we load in a module_info and free the proxy
on unload or exit.
2020-08-21 15:40:19 +02:00