Commit graph

6255 commits

Author SHA1 Message Date
Peter Hutterer
68080ec531 doc: fix a typo 2021-05-07 10:27:26 +10:00
Peter Hutterer
3234037a71 doc/spa: add more markdown tags to render better 2021-05-07 10:27:26 +10:00
Peter Hutterer
2405f0942b spa/buffer: rename SPA_MEMBER to SPA_PTROFF
SPA_MEMBER is misleading, all we're doing here is pointer+offset and a
type-casting the result. Rename to SPA_PTROFF which is more expressive (and
has the same number of characters so we don't need to re-indent).
2021-05-06 09:39:39 +00:00
Wim Taymans
e598d0a422 0.3.27 2021-05-06 10:22:37 +02:00
Wim Taymans
1a0ad3d688 v4l2-utils: only allocate MemPtr when requested 2021-05-06 10:16:21 +02:00
Wim Taymans
2963d6e725 stream: improve fixup of dataType
Also handle choice flag types. Do some more error checking.
2021-05-06 10:03:37 +02:00
Wim Taymans
941620b733 v4l2: don't expose the internal fd
When allocating memory, just export the mmaped memory and mark the
memory as MemPtr, not MemFd. Set the fd to -1.

Otherwise we might send this fd to the client, making the complete
device accessible to the client.
2021-05-06 09:24:27 +02:00
Wim Taymans
ec331f4e4c gst: enable DMABUF explicitly to avoid mmap issues
PipeWire does not give DMABUF anymore to clients unless they
explicitly ask for it. This results in v4l2 sending an fd and
the mmapoffset + size fields in the buffer.

GStreamer does not handle the mmapoffset in the fd allocator and
thus runs into mmap problems when using the memory.

Enable DMABuf explicitly to work around the problem until
GStreamer is fixed.

Fixes #1115
2021-05-05 11:23:44 +02:00
Wim Taymans
44f49a3ea0 v4l2: add some more debug 2021-05-05 11:23:44 +02:00
Fabrice Fontaine
ce89ce3844 meson.build: fix build with uclibc-ng
Build with uclib-ng fails since commit
a4b0b9afe5 on:

FAILED: src/pipewire/libpipewire-0.3.so.0.326.0.p/impl-core.c.o
/srv/storage/autobuild/run/instance-2/output-1/host/bin/mips64el-linux-gcc -Isrc/pipewire/libpipewire-0.3.so.0.326.0.p -Isrc/pipewire -I../src/pipewire -Isrc -I../src -I. -I.. -Ispa/include -I../spa/include -fdiagnostics-color=always -pipe -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O3 -fvisibility=hidden -Werror=suggest-attribute=format -Wsign-compare -Wpointer-arith -Wpointer-sign -Wformat -Wformat-security -Wimplicit-fallthrough -Wmissing-braces -Wtype-limits -Wvariadic-macros -Wno-missing-field-initializers -Wno-unused-parameter -Wno-pedantic -Wold-style-declaration -Wunused-result -DFASTPATH -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -fPIC -pthread -DHAVE_CONFIG_H -D_GNU_SOURCE -D_POSIX_C_SOURCE -MD -MQ src/pipewire/libpipewire-0.3.so.0.326.0.p/impl-core.c.o -MF src/pipewire/libpipewire-0.3.so.0.326.0.p/impl-core.c.o.d -o src/pipewire/libpipewire-0.3.so.0.326.0.p/impl-core.c.o -c ../src/pipewire/impl-core.c
../src/pipewire/impl-core.c:54:9: error: conflicting types for 'getrandom'
 ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) {
         ^~~~~~~~~
In file included from ../src/pipewire/impl-core.c:34:
/srv/storage/autobuild/run/instance-2/output-1/host/mips64el-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:28:12: note: previous declaration of 'getrandom' was here
 extern int getrandom(void *__buf, size_t count, unsigned int flags)
            ^~~~~~~~~

Fix this build failure by adding -D_GNU_SOURCE as getrandom is protected
by:

if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU

Extracted from:
 - https://github.com/wbx-github/uclibc-ng/blob/master/libc/sysdeps/linux/common/sys/random.h

Fixes:
 - http://autobuild.buildroot.org/results/a45f0ee009d90cef867dee4b1093225610fa10df

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-05-05 08:04:51 +00:00
Davide Beatrici
5f09b9f4d1 pod: fix "missing-field-initializers" warnings
/usr/include/spa-0.2/spa/pod/builder.h:90:13: error: missing field '_padding' initializer [-Werror,-Wmissing-field-initializers]
        *builder = SPA_POD_BUILDER_INIT(data, size);
                   ^

/usr/include/spa-0.2/spa/pod/builder.h:90:13: error: missing field 'state' initializer [-Werror,-Wmissing-field-initializers]
        *builder = SPA_POD_BUILDER_INIT(data, size);
                   ^

/usr/include/spa-0.2/spa/pod/builder.h:90:13: error: missing field 'callbacks' initializer [-Werror,-Wmissing-field-initializers]
        *builder = SPA_POD_BUILDER_INIT(data, size);
                   ^

/usr/include/spa-0.2/spa/pod/builder.h:248:33: error: missing field '_padding' initializer [-Werror,-Wmissing-field-initializers]
        const struct spa_pod_float p = SPA_POD_INIT_Float(val);
                                       ^

/usr/include/spa-0.2/spa/pod/parser.h:56:12: error: missing field '_padding' initializer [-Werror,-Wmissing-field-initializers]
        *parser = SPA_POD_PARSER_INIT(data, size);
                  ^

/usr/include/spa-0.2/spa/pod/parser.h:56:12: error: missing field 'state' initializer [-Werror,-Wmissing-field-initializers]
        *parser = SPA_POD_PARSER_INIT(data, size);
                  ^
2021-05-05 08:03:46 +00:00
George Kiagiadakis
bc1f9d304f audioconvert: handle S8/S8P raw audio formats 2021-05-05 08:56:59 +03:00
Wim Taymans
aabf879bb0 bluez5: avoid asserting when device existed
When a device as added in dbus but we already knew about the
device, don't assert but reuse the device we already have.

Seems to happen when resuming from suspend.

See rhbz#1948776
2021-05-04 15:39:34 +02:00
Wim Taymans
5a6967858e channelmix: improve soft volume state
When we have a soft Mute or Volume, use the soft volume.
When we get a volume update with only a channel Mute/Volume, use
the channel volumes.

See #1140
2021-05-04 13:05:38 +02:00
Wim Taymans
9ee55832e9 json: also escape \
Fixes #1141
2021-05-04 09:29:27 +02:00
Anders Jonsson
0b81314bde Update Swedish translation 2021-05-03 20:41:59 +02:00
Huang-Huang Bao
0c102b3e33
bluez5: emit SPA_PROP_softMute when route mute changed
Fixes #1137
2021-05-04 01:11:14 +08:00
Huang-Huang Bao
b0a1ae172c media-session: set bluetooth sample rate to default sample rate in graph
The bluez handle is now loaded after core info (containing 'default.clock.rate') is received.
2021-05-03 10:07:42 +00:00
Huang-Huang Bao
9384ba5500 bluez5: add properties for A2DP codec sample rate & channel mode configuration
Those properties are set as reference sample rate and channels number for A2DP configuration selecting.
2021-05-03 10:07:42 +00:00
Wim Taymans
15239ff74d channelmix: only run the LFE filter when upmixing
Only run the lowpass filter on the LFE channel when we are upmixing
and there is a valid cutoff frequency defined.

Otherwise we might filter away a valid LFE channel.

Fixes: rhbz#1941366
2021-05-03 11:50:47 +02:00
Wim Taymans
3c11b75e32 pw-cli: allow setting keys by their value.
Makes things like:

  pw-cli s 102 Props '{ 16777216: 1.2 }'

work. Useful when dealing with custom properties that don't have a name
in the type array.
2021-05-03 11:50:42 +02:00
Wim Taymans
9206fb019f stream: add support for Props param
Rework the node and port info management a little.
Make sure we emit a node info event when the Props param changed.
Implement enum_param on the node.
2021-05-03 11:50:36 +02:00
Wim Taymans
8bbb78d2bd filter: the node only has a Props param 2021-05-03 11:50:27 +02:00
Wim Taymans
e1fee18148 stream: support setting properties
Setting Props param will then be forwarded to the stream param_changed
signal and the stream can implement custom properties.
2021-05-03 11:50:18 +02:00
Andreas Schnebinger
61dd645c63 Fix shellcheck warnings 2021-05-02 10:38:51 +02:00
Wim Taymans
ebe5fa7809 dbus: clean up sources and connections
Set source user data for all dbus sources and set a destroy notify
when removed.
Remove the dbus user data to remove the source user data.
Clean up remaining sources when destoying a connection
Clean up remaining connections when freeing the dbus plugins.

Fixes #1114
2021-05-01 09:33:06 +02:00
Andrea Gelmini
85b136d8ce Fix typos
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2021-04-30 16:27:34 +00:00
Andrea Gelmini
36ebbfa71c
Removed duplicated includes
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2021-04-30 18:16:25 +02:00
Wim Taymans
7145b2becf pw-cli: add support for creating Struct in pod
Support creating Struct as well. When an object property is marked as
Struct, use [] to start the struct and copy each item with its type into
the struct:

pw-cli s 0 Route '{ info = [ "foo": 0.1  "bar": null [ 0.1 10 "hat" ]] }'
2021-04-30 17:21:42 +02:00
Wim Taymans
ca72738fee dbus: add some more debug in the plugin 2021-04-30 12:23:10 +02:00
Wim Taymans
c1ec10c252 i18n: install header 2021-04-30 10:03:49 +02:00
Wim Taymans
aea55f662a i18n: move to separate .h file
So that we can include it where needed and don't cause redefined _()
macros for other projects.

Fixes #1120
2021-04-30 09:57:30 +02:00
Andrea Gelmini
f489e32e44 Fix typo in code 2021-04-30 07:40:20 +00:00
Andrea Gelmini
47ef2b6b09 Fix typos 2021-04-30 07:40:20 +00:00
Sebastian Goth
379068c31d Clarify alsa device.profile-set setting
Missing the .conf changes the profile name reported by pactl
but has no effect
2021-04-29 16:27:58 +00:00
Wim Taymans
3af6e248da acp: emit softMute values, not monitorMute
We don't want to influence the monitor mute, just the
real mute and softMute.
2021-04-29 17:18:25 +02:00
Wim Taymans
620c863b6d pulse-server: track and set monitor volume on monitor sources 2021-04-29 15:25:04 +02:00
Wim Taymans
664df03bbb audioconvert: track and emit all volume
Let both channelmix and merger remember all volumes so that they can
be emited when they change.
2021-04-29 15:23:33 +02:00
Wim Taymans
5bf2144438 spa: improve volume handling
Make a new softVolume property that contains only the soft volume
to apply.

In the case of HW/SW volume, we pass the real volume in the
channelVolume and the leftover volume in softVolume. We don't
use the monitorVolume for this anymore because it is a completely
separate volume handled by the merger node.

This way, channelVolume always represents the effective volume
set on routes, channelmix and merger and only the softVolume (when
available) is applied as software volume by channelmix.

This makes things map a bit better to what is actually happening with
the real volume and leftover software volumes after applying the
hardware volumes in the device.

With this change, the volume on the monitor is not affected by the
sink volume anymore and we can use the monitorVolume for this later.

This also means that the monitor volume in pavucontrol of the sinks
does not change when the sink volume changes. PulseAudio is inconsistent
here: If the volume is HW, the monitor volume is not affected, if the
volume is SW, it is. In PipeWire there is an option in merger to
let the volume affect the monitor with monitor.channel-volumes = true.
2021-04-29 12:46:29 +02:00
Wim Taymans
48a6cc2575 audioconvert: refactor the volume items in a struct 2021-04-29 11:36:05 +02:00
Wim Taymans
a76032a637 client-node: use the right port for io
To set the io on the mixer ports, we need to use the same id that
was used to add the port, not the id we use to identify the mixer
structure.

Fixes #759
2021-04-28 17:04:36 +02:00
Wim Taymans
b3d94bf019 improve debug 2021-04-28 17:04:16 +02:00
Evgeniy Khramtsov
093a427b11
cirrus: build media session on FreeBSD
FreeBSD ports tree does not have alsa-lib >=1.1.7 yet,
build the newer one locally in CI until a newer version
of alsa-lib lands to the FreeBSD ports tree.
2021-04-27 20:05:29 +03:00
Wim Taymans
3424d10231 Revert "acp: use the right profile name and description"
This reverts commit 09106151d3.

We need the actual name and description of the mapping, not the
profile or else we end up with the full profile description in the
node description instead of the part of the profile that applies to
the device.
2021-04-27 16:43:13 +02:00
Wim Taymans
407489cd71 conf: remove X bit from config files
Fixes #1107
2021-04-27 15:38:59 +02:00
Wim Taymans
3496327e69 Add echo-cancel module
Only implement the null echo cancel implementation for now.
And skeleton webrtc echo cancel implementation

It uses 4 streams arranged as:

 input ---+---> source
          ^
	  |
 sink  ---+---> output

The output of the source is the filtered input of the input stream
(linked a master source) based on the data going from sink to
the output (linked to a master sink).

All streams are arranged in the same group so that the echo canceler
does not have to deal with clock drift. For echo cancelers that can
handle clock drift we might want place the source and sink chains
in different groups.
2021-04-27 09:56:54 +02:00
Evgeniy Khramtsov
684c1b10f7 cirrus: add gettext on FreeBSD
Add gettext on FreeBSD via localbase.
This fixes the Cirrus CI FreeBSD job.
2021-04-26 15:37:55 +00:00
Wim Taymans
5724093343 audioconvert: run lr4 on tagged channels in generic case
Mark the LFE channels and run the lowpass filter on them in
the generic case. Generates LFE correctly in 2.1 upmix case.

See #1095
2021-04-26 17:34:14 +02:00
Wim Taymans
71824d0b03 audioconvert: debug selected function name in channelmix 2021-04-26 17:33:45 +02:00
Wim Taymans
27d98478ab modules: set right library variable 2021-04-26 10:45:44 +02:00