Commit graph

4451 commits

Author SHA1 Message Date
Siwon Kang
f7b22b934c doc: fix typos
Signed-off-by: Siwon Kang <siwon.kang@daimler.com>
2020-09-14 20:00:59 +02:00
Wim Taymans
e59c4675a7 audioconvert: send the command to the children
Send the command on the converter to all children as well.
Reset the resampler when we are paused so that we don't end up
with old data.

Fixes #288
2020-09-14 16:39:42 +02:00
Wim Taymans
310ed89aad context: match wildcards @DEFAULT_SINK/SOURCE/MONITOR@
See #291
2020-09-14 13:21:39 +02:00
Wim Taymans
67f4acaf1d pulse: try hard to always create a valid channel map
Unknown channel names are mapped to aux channels.
Add extra AUX channels when we don't know the channel layout.
This makes sure apps always receive valid channel layouts so they
don't abort (pactl).
2020-09-14 11:06:11 +02:00
Wim Taymans
320e63fe48 fmtconvert: place unknown channels at end
Sort the unknown channels to the end of the remap array.
2020-09-14 11:03:52 +02:00
Wim Taymans
f6bc9113ce gst: stop the thread loop before destroying objects
When we destroy the proxy we should either take the thread lock
or stop the thread loop because the destroy might trigger a reply
to remove the object from another thread. This can cause the
refcounting to become invalid and cause double free.

Fixes #286
2020-09-11 16:39:05 +02:00
Wim Taymans
38f8c9c6c8 pulse: always notify of available data
If we have some data available for capture, always report this
to get the lowest latency possible.
2020-09-11 15:34:30 +02:00
Wim Taymans
8f75056689 pulse: improve handling of buffer attributes
Repect minreq and fragsize for playback and capture.
Try to configure tlength at 2 seconds, minreq at around 25ms. Should
greatly improve compatibility with audacious and mpv.
Count since_underrun correctly.

Fixes #278
2020-09-11 13:08:20 +02:00
Wim Taymans
6eb4b552ad stream: unmark Not Implemented methods
_prebuf and _trigger are not implemented but should not really cause
any trouble, so just debug them without warning.
2020-09-11 11:41:29 +02:00
Wim Taymans
3b7f2c527c stream: call _done after operation callback 2020-09-11 11:40:57 +02:00
Wim Taymans
c979f181a5 jack: return useful version number (major version 3)
Also add the PipeWire string in there to give apps a chance to
report this.
2020-09-11 11:28:04 +02:00
Wim Taymans
b0c758719d 0.3.11 2020-09-10 13:13:36 +02:00
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