Commit graph

9361 commits

Author SHA1 Message Date
Jaska Uimonen
9acacd9ba3 alsa-ucm: Fix volume control based on review
- sync mixer logic added
- mixer path creation, empty set in mapping creation, paths added in path creation
- path creation moved inside new port creation as it might be called twice otherwise
- some comments added
2019-12-06 10:05:44 +00:00
Arun Raghavan
3dfccada46 alsa-ucm: Support Playback/CaptureVolume
This allows us to support the PlaybackVolume and CaptureVolume commands
in UCM, specifying a mixer control to use for hardware volume control.
This only works with ports corresponding to single devices at the
moment, and doesn't support stacking controls for combination ports.

The configuration is intended to provide a control (like Headphone
Playback Volume), but we try to resolve to a simple mixer control
(Headphone) to reuse existing volume paths.

On the UCM side, this also requires that when disabling the device for
the port, the volume should be reset to some default.

When enabling/disabling combination devices, things are a bit iffy since
we have no way to reset the volume before switching to a combination
device. It would be nice to have a combination-transition-sequence
command in UCM to handle this and other similar cases.

PlaybackSwitch and CaptureSwitch are yet to be implemented.
2019-12-06 10:05:44 +00:00
Jaroslav Kysela
1c240b7a12 alsa-mixer: improve alsa_id_decode() function
Accept those identifiers:

        Speaker,1
        'Speaker',1
        "Speaker",1

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-06 10:05:44 +00:00
Jaroslav Kysela
7f4b8e1a7c alsa-mixer: handle the index for ALSA mixer element identifiers
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-06 10:05:44 +00:00
Jaroslav Kysela
ab5be56a10 alsa-ucm: add mixer IDs to ucm_items
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-06 10:05:44 +00:00
Jaroslav Kysela
c8f065250d alsa-ucm: use ucm2 name for the direct card index open
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-06 10:05:44 +00:00
Dave Chiluk
1ee1f749e1 alsa-mixer: add support for LucidSound LS31, and create usb-gaming-headset profile 2019-12-05 03:02:28 +00:00
Krzysztof Stasiowski
79d3b99ba4 alsa-mixer: Add support for SteelSeries Arctis 5 2019 headset
Signed-off-by: Dave Chiluk <chiluk@ubuntu.com>
2019-12-05 03:02:28 +00:00
Josh
7259e8c22f alsa-mixer: add support for SteelSeries Arctis Pro 2019 headset
Signed-off-by: Dave Chiluk <chiluk@ubuntu.com>
2019-12-05 03:02:28 +00:00
Hui Wang
f899d5f466 stream-restore: skip entries setting action from gnome-control-center
When users select an output device from gnome-control-center UI, the
sink of this output device will be set to the configured_default_sink
and the default_sink, these actions are expected, but after these
actions, the gnome-control-center will call extension_cb() to modify
the entries in the database, let all stream entries to bind the sink
users select, this is not correct since the sink is default_sink now.

This is a temp fix for this issue, after gnome-control-center fixes
this problem, this patch should be reverted.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2019-11-27 12:26:40 +08:00
Hui Wang
43e3a7f3c3 sink: move the streams to the default_sink when the sink is unlinked
When a sink is unlinked, all streams of this sink are moved to
default_sink, this action is implemented in the core rather than
modules now.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2019-11-27 12:26:34 +08:00
Hui Wang
60d948618e device-port: moving streams due to changing the status of active_port
When the active port of a sink becomes unavailable, all streams from
that sink should be moved to the default sink.

When the active port of a sink changes state from unavailable, all
streams that have their preferred_sink set to this sink should be moved
to this sink.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2019-11-27 12:23:17 +08:00
Hui Wang
b886836630 sink: move streams to new appeared sinks if they prefer these sinks
When a new sink appears, all streams that have their preferred_sink
set to the new sink should be moved to the new sink.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2019-11-27 12:11:28 +08:00
Hui Wang
40d92e9b1a core: move sink-inputs conditionally when update default_sink
When the default sink changes, the streams from the old default sink
should be moved to the new default sink, unless the preferred_sink
string is set to the old default sink and the active port of the old
default sink is not unavailable

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2019-11-27 12:09:21 +08:00
Hui Wang
bc0e728320 sink-input: clear the preferred_sink if it is default_sink
When the user moves a stream to the current default sink, the
preferred_sink should be set to NULL and module-stream-restore
should clear the routing for that stream in the stream database. From
that point on the stream will be always routed to the default sink.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2019-11-26 19:38:29 +08:00
Hui Wang
24d5d180b8 sink-input: add a new API pa_sink_input_set_preferred_sink
If the sink here is NULL, that means users want to clear the
preferred_sink and move the sink-input to the default_sink, otherwise
set the preferred_sink to the sink->name and move the sink-input to
the sink. After that fire the sink_input_change event.

After adding this API, we can use this API to simplify the entry_apply
in the module-stream-restore.c.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2019-11-25 19:43:53 +08:00
Hui Wang
fbf8716685 sink-input: change bool save_sink to char *preferred_sink
The finial objective is to store the preferred sink name in the
sink-input struct, and use module-stream-restore to save and restore
it.

This patch just replaces the save_sink with preferred_sink, and tries
to keep the original logic.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2019-11-25 19:43:53 +08:00
Arun Raghavan
26a66d103f switch-on-connect: Fix warning on discarded const qualifier
pa_modargs_get_value() returns a const string -- instead of discarding
the const qualifier, let's just duplicate the string and free it
explicitly in the failure case.
2019-11-22 22:32:16 +05:30
Ryszard Knop
ad16d77dfe switch-on-connect: Add blacklisting
Add a new module argument, blacklist, which is a regular expression.
If the sink/source name matches the provided blacklist regex, don't
automatically switch to it. By default, no devices are blacklisted.

Add a new function to check whenever a regex pattern is valid, plus
extra NULL asserts in pa_match.
2019-11-21 22:19:44 +01:00
muzena
c90894b4d5 i18n: Update the Croatian translation 2019-11-21 15:14:15 +02:00
Wim Taymans
c7a55174dc X11: Add xauthority parameter
Add an xauthority parameter and use it in the startup script.

Apparently on some systems the X authentication cookie is not stored in
~/.Xauthority but in some dynamic location pointed to by the XAUTHORITY
environment variable. The environment variable therefore needs to be set
in the PulseAudio daemon environment in order to have access to the X
server from the PulseAudio daemon, but the variable is not necessarily
set when starting PulseAudio. For example, systemd starts PulseAudio
outside the X session. The start-pulseaudio-x11 script is run in the
X session, so it has the environment variable available, and can pass it
to the X modules, which then can set the variable in the daemon
environment.

RedHat bug: https://bugzilla.redhat.com/show_bug.cgi?id=1723065
Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=593746

Based on patch by Alexander Kurtz <kurtz.alex@googlemail.com>
2019-11-21 14:44:09 +02:00
Tanu Kaskinen
6f28865950 man: remove outdated information about real-time scheduling
The pulse-rt group doesn't exist any more, and rtkit exists to make it
safe to acquire real-time scheduling for regular users.
2019-11-21 10:10:19 +00:00
Vasilis Tsiligiannis
28347d0602 start-pulseaudio-x11: Make 'plasma' version check shell portable
Currently, the version check snippet uses a 'bash' extension which
arithemtically evaluates variables prior to expansion. This approach
does not nesseceraly work on other shells which may complain with
'5: Illegal numer' error. Expand the arithmetic expression before
evaluation to avoid such an error.

Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-11-18 16:27:03 +02:00
David Heidelberg
4d9d458268 meson: convert to install_headers
Instead of install_data use correct install_headers

Signed-off-by: David Heidelberg <david@ixit.cz>
2019-11-14 21:11:01 +02:00
David Heidelberg
5231483432 meson: convert post-install.sh to python
Inspired by: 36a2e4f8a7 (0cc1139e3347f573ae1feee5b73dbc8a8a21fcfa_0_14)

Signed-off-by: David Heidelberg <david@ixit.cz>
2019-11-14 21:10:00 +02:00
Arun Raghavan
a17cc55c4c rtp: Add some logging to know what backend is being used
Should make debugging any issues that come up easier.
2019-11-08 17:39:40 +05:30
Sebastian Dröge
a34d2e547b rtp: Properly timestamp buffers in the GStreamer sender pipeline
Otherwise default timestamping will happen, which might not be correct,
especially not after the stream was suspended for a while.
2019-11-08 17:39:40 +05:30
Sebastian Dröge
72dbbcbc65 rtp: Use udpsink instead of fdsink for the GStreamer RTP implementation 2019-11-08 17:39:40 +05:30
Sebastian Dröge
7f6571e1cc rtp: Use yes/no in configure instead of 1/0 2019-11-08 17:39:40 +05:30
Arun Raghavan
74f8456acb rtp: Add a GStreamer-based RTP implementation
This adds a GStreamer-based RTP implementation to replace our own. The
original implementation is retained for cases where it is not possible
to include GStreamer as a dependency.

The idea with this is to be able to start supporting more advanced RTP
features such as RTCP, non-PCM audio, and potentially synchronised
playback.

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
2019-11-08 17:39:40 +05:30
Arun Raghavan
eb912d3605 rtpoll: Separate out before/after/work callback userdata
It is possible that we might want to have a separate userdata to be used
for these callbacks, so let's split them out.

This is particularly needed when using an pa_rtpoll_item around pa_fdsem
since that uses its own before/after callback but will essentially have
whatever is using the fdsem set up the work callback appropriately (and
thus at least the work callback's userdata needs to be separated from
the before/after callback -- we might as well then just separate all
three).

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
2019-11-08 17:39:03 +05:30
Arun Raghavan
d15291bbbb rtp: Hide RTP implementation details from module-rtp-*
This moves RTP implementation-specific information out of
module-rtp-send/recv. This is basically done by making the
pa_rtp_context structure opaque from the perspective of these modules.
We can then potentially replace the underlying RTP implementation with
something else transparently.

One RTP detail that does "leak" is the RTP timestamp. We provide this to
module-rtp-recv so that it can perform rate adjustments to match the
sender rate.

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
2019-11-08 17:39:03 +05:30
Arun Raghavan
0548cdc6d6 rtp: Move MTU handling to the RTP implementation
module-rtp-send itself doesn't really need to handle this, the
implementation can keep track (and make sure sending happens in MTU
sized chunks).

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
2019-11-08 17:39:03 +05:30
Arun Raghavan
02fa9d5fc6 rtp: Drop support for non-L16 media
There doesn't seem much value in supporting streaming U8/mulaw/alaw on
the network, and it's unlikely these get any testing. Makes more sense
to drop these formats and just convert to L16 if we're dealing with
source media in that format.

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
2019-11-08 17:39:03 +05:30
Arun Raghavan
7766f0e8d7 rtp: Don't use cookie for SSRC
Publishing the cookie on multicast seems to be a bad idea.

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
2019-11-08 17:39:03 +05:30
Arun Raghavan
a9a3f0874a rtp: Make init return a value for success/failure
This will be used in the future when writing other RTP implementations
that can fail on init.

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
2019-11-08 17:39:03 +05:30
Timo Gurr
7670dffe59 meson: allow to disable installing completions 2019-11-07 12:50:56 +00:00
Daniil Kovalev
5fdde3fa83 Fix memory leak in context_free
In commit f727cd9a `int error` member in `struct pa_context` was changed
to `pa_context_error *error`. The memory that is allocated with
`pa_xnew0` in src/pulse/context.c:142 is never freed, and it causes
a leak of 4 bytes. The leak can be easily detected with leak-sanitizer.
2019-11-02 22:54:03 +03:00
Rickie Schroeder
470c210cdc start-pulseaudio-x11: fix KDE version check
Current check wasn't working in case when $DESKTOP_SESSION wasn't set
which happens when session is started without display manager like sddm.
Parsing "plasmashell -v" output should be more reliable and less hacky.

This also changes legacy backticks `...` to modern $(...) as recommended
by shellcheck:
https://github.com/koalaman/shellcheck/wiki/SC2006

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/751
2019-10-31 15:42:41 +02:00
ckdo
aee67ba806 rtp: Fix reverted test for INHIBIT_AUTO_SUSPEND_ONLY_WITH_NON_MONITOR_SOURCES
RTP Monitor sources were never suspended when
inhibit_auto_suspend=only_with_non_monitor_sources

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/735
2019-10-26 16:36:19 +03:00
Tanu Kaskinen
248a77c7fd alsa-mixer: recognize the "Speaker Jack" control
This control has been seen in the wild:
https://lists.freedesktop.org/archives/pulseaudio-discuss/2017-August/028595.html
(The pastebin link in that mail might not work anymore, but the paste
just shows that there's a Speaker Jack control).
2019-10-26 16:21:27 +03:00
Felipe Sateler
64b259c2c9 qpaeq: use python3 instead of python 2
The script was already compatible, so lets just switch interpreter
2019-10-25 08:39:03 -03:00
Felipe Sateler
f3609ee3d0 qpaeq: Drop unused imports
Neither sip nor PyQt5 are used. From PyQt5 we only use the named imports just below
2019-10-25 08:34:59 -03:00
Peter Levine
e4450d8b58 atomic: Explicitly cast void* to unsigned long 2019-09-26 15:05:53 +03:00
Rasmus Thomsen
bff163089c meson: link libintl if it's not provided by libc
This fixes the build on musl with external gettext
2019-09-25 04:42:03 +00:00
Tanu Kaskinen
d72a3a5eca null-sink: allow clients to configure the supported formats
The set_formats() callback is already implemented, so the only thing
missing was the SET_FORMATS flag.
2019-09-24 02:36:56 +00:00
ckdo
0d22558b47 raop: Fix non working tcp mode 2019-09-24 02:29:59 +00:00
Tanu Kaskinen
ba73faa4c0 daemon-conf: disable flat-volumes by default
Almost all distributions patch the configuration to disable
flat-volumes, because users tend to find the concept confusing (and it
also causes nasty surprises when some application pushes the volume to
100%). Let's remove the need for patching and disable the feature by
default.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/691
2019-09-23 07:48:48 +03:00
Tanu Kaskinen
3dff31e19c alsa-mixer-path-test: Hide unused functions when building with Meson
Silences these warnings:

[509/574] Compiling C object 'src/tests/a4ccf2d@@alsa-mixer-path-test@exe/alsa-mixer-path-test.c.o'.
../src/tests/alsa-mixer-path-test.c:24:20: warning: ‘load_makefile’ defined but not used [-Wunused-function]
 static pa_strlist *load_makefile() {
                    ^~~~~~~~~~~~~
../src/tests/alsa-mixer-path-test.c:17:20: warning: ‘get_default_paths_dir’ defined but not used [-Wunused-function]
 static const char *get_default_paths_dir(void) {
                    ^~~~~~~~~~~~~~~~~~~~~
2019-09-20 17:10:57 +03:00
Tanu Kaskinen
da86c8af44 Update NEWS
The release notes, on which the NEWS file is based on, weren't complete
at the time of release. Now the notes should be complete.
2019-09-20 16:50:01 +03:00