Commit graph

9425 commits

Author SHA1 Message Date
Jaroslav Kysela
c1a7e3c59d ucm: add possibility to skip the UCM card completely (Linked)
We have a requirement to "hide" some hardware drivers, because
other (main) UCM configuration will refer them.

This patch use special error codes to notify the upper layers
to skip the module loading.

BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/30
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-09-17 14:52:50 +00:00
Rafael Fontenelle
b72724369b Update Brazilian Portuguese translation 2020-09-12 12:24:11 -03:00
Tanu Kaskinen
c1a7d516b1 man: client.conf: Explain that autospawn=no doesn't disable systemd autostarting 2020-09-11 11:15:09 +03:00
Milo Casagrande
c2b05eb704 Translated using Weblate (Italian)
Currently translated at 100.0% (533 of 533 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/it/
2020-09-10 17:37:28 +03:00
Göran Uddeborg
d0ccc50c1e Translated using Weblate (Swedish)
Currently translated at 100.0% (534 of 534 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/sv/
2020-09-10 17:37:28 +03:00
Arun Raghavan
460d0c0b79 alsa-mixer: Add an explicit profile-set for Audigy devices
These lost analog-mono support when we made that a fallback profile, as
the stereo-fallback would be picked up as the only input profile, and
that does not work in duplex mode.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/750
2020-09-02 16:30:06 -04:00
Tom Yan
f003d6ca62 man: mention that exit-idle-time is complied if the user is lingering 2020-08-31 19:18:21 +03:00
Tom Yan
e36132b7dc main, core: check idle after loading conf
pa_core_check_idle() uses pa_core.exit_idle_time, which is set after the
pa_core_new() call, so pa_core_check_idle() needs to be called later.

This patch preserves the fact that core state is set to PA_CORE_RUNNING
after checking idle (now in main). It doesn't seem to matter anyway and
main(pa_core_new(state:PA_CORE_STARTUP)->...->state:PA_CORE_RUNNING)
seems right as well.
2020-08-31 19:09:02 +03:00
itsthem
90a6c5ef07 pulsecore: Replace gendered pronouns with gender neutral ones 2020-08-28 13:15:50 +00:00
Felix Yan
1887a0f88b shell-completion: zsh: Correct a typo 2020-08-14 22:31:33 +08:00
Tanu Kaskinen
1d066f2264 i18n: Update pulseaudio.pot 2020-08-13 22:01:18 +03:00
Balázs Meskó
09e03b7bc6 Translated using Weblate (Hungarian)
Currently translated at 100.0% (526 of 526 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/hu/
2020-08-13 21:58:11 +03:00
Milo Ivir
10964e0f08 Translated using Weblate (Croatian)
Currently translated at 100.0% (531 of 531 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/hr/
2020-08-13 21:58:11 +03:00
Geert Warrink
c7343ef683 Translated using Weblate (Dutch)
Currently translated at 85.8% (426 of 496 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/nl/
2020-08-13 21:58:11 +03:00
Tanu Kaskinen
a863b5795a alsa-mixer: Fix indentation 2020-08-10 20:56:43 +03:00
Tanu Kaskinen
af42b3eb6f Rename "available group" to "availability group"
"Availability group" is more clear about what the field is about.
Credits to Arun Raghavan for coming up with the better name.
2020-08-10 20:54:21 +03:00
Tanu Kaskinen
1b44b44c75 alsa-mixer: Fix mapping_group_available() logic
There were three bugs:

1) j->state_plugged was set to PA_AVAILABLE_UNKNOWN too early. It must
be set only after we have found that the jack is shared by two ports.
The result of setting it too early was that no jack ever could have
the PA_AVAILABLE_YES status.

2) The inner jack loop iterated through p->jacks instead of p2->jacks,
so the code didn't compare jacks between two ports at all. As a result
all ports were put in the same availability group.

3) The inner jack loop checked j->state_plugged instead of
j2->state_plugged. The result was that the speaker port, which uses the
Headphone jack to toggle between unknown and unavailable, was put in the
same group with the headphone port.
2020-08-10 20:54:21 +03:00
Tanu Kaskinen
0ce3008605 Improve the port available_group and type documentation 2020-08-10 20:54:21 +03:00
Tanu Kaskinen
2c790e1937 meson: Add doxygen target
The documentation can be generated with "ninja -C build doxygen". The
output will go to "doxygen/html" under the build directory.
2020-08-10 19:50:57 +03:00
Tanu Kaskinen
6fce5b2eac build-sys: Configure doxygen.conf.in a bit differently
This change prepares for adding a doxygen target to the Meson build
system. The DOXYGEN_OUTPUT_DIRECTORY substitution variable is needed so
that the output will go to the build directory. I also replaced @srcdir@
with @top_srcdir@. I think it looks cleaner, since the ".." parent
directory traversal is avoided. It also happened to make writing the
Meson rules easier.
2020-08-10 19:38:07 +03:00
Sanchayan Maity
1781031c8b modules: rtp-gstreamer: Fix RTP sound lag
In the current scenario of reading samples from the appsink, it is
observed that we do not actually read all the data available in the
appsink to read. This results in a choppy sound or heard as gaps in
the playback.

The underlying reason for this happening is as follows. Let's say
the appsink new sample callback is called 2-3 times, but, with the
underlying fdsem post machinery when pa_rtp_recv eventually gets
called, there would be those 2-3 samples to read. However, we were
only reading one sample in the current implementation.

Fix this by reading all samples from the appsink in a loop, coalescing
them and then writing to the memchunk.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/889

Signed-off-by: Sanchayan Maity <sanchayan@asymptotic.io>
2020-08-10 12:36:17 +00:00
Kai-Heng Feng
dd70c3c589 module-alsa-card: Set a minimum profile priority if it's not set
If the profile is generated from UCM, the priority won't be set so it
stays as 0.

Assume a card has two available profiles, when the selected one becomes
unavailable, module-switch-on-port-available's find_best_profile()
should pick the next available one. However, since the priority is 0,
the "off" profile was chosen instead of the available one.

So let's set the priority to 1 to make profile that is available has
higher priority than "off" profile.
2020-08-10 11:52:31 +00:00
Rosen Penev
ceaa69d71f raop-crypto: add missing header
Fixes compilation without deprecated OpenSSL APIs.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-08-10 11:38:48 +00:00
Rosen Penev
1ae8097b8b modules: fix wrong formats under 32-bit
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-08-10 10:56:40 +00:00
Jan Alexander Steffens (heftig)
b657cff400 build: Make alsadatadir configurable
Pipewire has started shipping copies of PulseAudio's ALSA card profiles.

It would be useful if both projects could share the same profiles and
this patch is a step toward that.
2020-08-09 01:57:01 +00:00
Jan Alexander Steffens (heftig)
af5ae60b33
meson: Add missing thread_dep to atomic-test
Otherwise it won't link.

    /usr/bin/ld: /tmp/atomic-test.uzrv5D.ltrans0.ltrans.o:
    undefined reference to symbol 'pthread_setaffinity_np@@GLIBC_2.3.4'
2020-08-09 03:29:23 +02:00
Tanu Kaskinen
628f068788 gitignore: Ignore hashmap-test 2020-08-06 14:34:56 +03:00
Kai-Heng Feng
e153fb8706 alsa-mixer: Recognize USB audio jack mixer
UAC v2 and v3 support insertion control (jack detection), and the
created jack mixers have "- Input" suffix and "- Output" suffix for
input jack and output jack, respectively.

Add these jacks so we don't always need to rely on UCM or PulseAudio
profile-set.
2020-08-05 00:42:26 +08:00
Tanu Kaskinen
9636c2940b udev: fix too long card name with HyperX Cloud Orbit S
Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/820
2020-08-04 12:40:22 +00:00
Tanu Kaskinen
7742c9aa50 meson: Build atomic-test
The test was missing from the build system.
2020-08-04 15:09:36 +03:00
Tanu Kaskinen
99db8038de build-sys: Build atomic-test only if pthread_setaffinity_np() is available
The function seems to be essential to the test, so the test has to be
disabled entirely if pthread_setaffinity_np() is not available.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/850
2020-08-04 15:09:33 +03:00
Wim Taymans
4d1e568619 alsa-util: fix check for digit
Fix the check for a digit by checking if the value is between the
*character* '0' (not *value* 0) and '9'.
2020-08-03 09:58:39 +02:00
Tomasz Kontusz
47d811224d alsa-mixer: add support for Astro A50 gaming headset 2020-07-26 04:39:40 +00:00
Tomasz Kontusz
8482b62b0a alsa-mixer: add description-key to Mappings and Profiles 2020-07-26 04:39:40 +00:00
Tomasz Kontusz
9696e10791 alsa-mixer: Remove unused iec958-passthrough* descriptions
They were unused since 20f1fa17be.
2020-07-26 04:39:40 +00:00
Tomasz Kontusz
680d7bb976 alsa-mixer: Fix well-known descriptions for steelseries game/chat outputs 2020-07-26 04:39:40 +00:00
Tanu Kaskinen
414644dff1 device-port: send sink and source change events when availability changes
The lack of change events caused GUIs to not update the port status.

Related bug report:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/941
2020-07-22 22:53:54 +00:00
Eero Nurkkala
1f1fb8eb6b tests: cpu-remap-test.c: fix memory leaks
When compiled with ASAN: -O1 -fsanitize=address -fno-omit-frame-pointer,
the following issues are seen:

==17217==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7fceba414b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7fceb9b3eac9 in pa_xmalloc pulse/xmalloc.c:63
    #2 0x7fceb9b3ed22 in pa_xmemdup pulse/xmalloc.c:94
    #3 0x7fceb9e1eed5 in _pa_xnewdup_internal pulse/xmalloc.h:86
    #4 0x7fceb9e1eed5 in init_remap_c pulsecore/remap.c:580
    #5 0x7fceb9e1efe5 in pa_init_remap_func pulsecore/remap.c:608
    #6 0x5574e72422b7 in remap_init2_test_channels tests/cpu-remap-test.c:303
    #7 0x5574e7242420 in rearrange_special_test tests/cpu-remap-test.c:345
    #8 0x5574e7245ce5 in srunner_run (/home/eenurkka/pulse/pulseaudio/src/.libs/cpu-remap-test+0x9ce5)
...
SUMMARY: AddressSanitizer: 192 byte(s) leaked in 6 allocation(s).

Fix those issues by freeing the allocated resources properly.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2020-07-21 14:57:05 +03:00
Eero Nurkkala
9dd7f48b49 tests: hashmap-test.c: fix memory leak
When compiled with ASAN: -O1 -fsanitize=address -fno-omit-frame-pointer,
the following issue is seen:

==14272==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 1072 byte(s) in 1 object(s) allocated from:
    #0 0x7f0180966d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f018039f043 in pa_xmalloc0 pulse/xmalloc.c:74
    #2 0x7f01803c5cc8 in pa_hashmap_new_full pulsecore/hashmap.c:61
    #3 0x7f01803c5df9 in pa_hashmap_new pulsecore/hashmap.c:76
    #4 0x556ee75ff7f4 in remove_all_test tests/hashmap-test.c:96
    #5 0x556ee7602965 in srunner_run (/home/eenurkka/pulse/pulseaudio/src/.libs/hashmap-test+0x6965)

SUMMARY: AddressSanitizer: 1072 byte(s) leaked in 1 allocation(s).

Fix it by freeing the resource properly.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2020-07-21 14:56:59 +03:00
Tanu Kaskinen
5c0ad422a8 remap_neon: use register r12 instead of r7
When the Thumb instructions set is used and frame pointers are enabled
(-fno-omit-frame-pointer), r7 can't be used, because it's used for the
frame pointer. Trying to use r7 caused the compilation to fail.

Thanks to Andre McCurdy for suggesting[1] this fix, all I had to do was to
test that it works. The code builds now, and cpu-remap-test also
succeeds.

[1] https://lists.openembedded.org/g/openembedded-core/message/136786
2020-07-20 13:27:44 +00:00
zhaochengyi
b5a6365f18 pulsecore: Add exception judgment to fix the crash when playing music
When playing music for a period of time, the Shared Memory is
frequently accessed, and occasionally read/write errors occur,
which causes the program to crash

[Current thread is 1 (Thread 0xffff86823010 (LWP 2841))]
(gdb) bt
0  0x0000ffff8702a714 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
1  0x0000ffff870188e8 in __GI_abort () at abort.c:79
2  0x0000ffff873b5728 in do_read (p=p@entry=0x3673a170, re=re@entry=0x3673a338) at pulsecore/pstream.c:856
3  0x0000ffff873b7fd8 in do_pstream_read_write (p=0x3673a170) at pulsecore/pstream.c:248
4  0x0000ffff873b8368 in srb_callback (srb=<optimized out>, userdata=0x3673a170) at pulsecore/pstream.c:287
5  0x0000ffff873b8bec in srbchannel_rwloop (sr=0x36766ae0) at pulsecore/srbchannel.c:190
6  0x0000ffff87339c70 in dispatch_pollfds (m=0x36670db0) at pulse/mainloop.c:655
7  0x0000ffff87339c70 in pa_mainloop_dispatch (m=m@entry=0x36670db0) at pulse/mainloop.c:898
8  0x0000ffff8733a01c in pa_mainloop_iterate (m=0x36670db0, block=<optimized out>, retval=0xffffd9683030) at pulse/mainloop.c:929
9  0x0000ffff8733a0d8 in pa_mainloop_run (m=m@entry=0x36670db0, retval=retval@entry=0xffffd9683030) at pulse/mainloop.c:945
10 0x0000000000406894 in main (argc=<optimized out>, argv=<optimized out>) at daemon/main.c:1144

Signed-off-by: zhaochengyi <zhaochengyi@uniontech.com>
2020-07-20 01:14:54 +00:00
Rafael Fontenelle
f32977831a Update Brazilian Portuguese translation 2020-07-18 15:12:15 +00:00
Hui Wang
c8653c13fa alsa: adjust ucm sink/source priority according to ports priority
On the machines with the ucm used, the different input/output devices
often have different pcm stream, so they often belong to different
sources and sinks, this is greatly different from the design of all
devices connected to a codec (without ucm).

For example, on a machine with ucm2 used:
the internal dmic is on source#0
the external mic is on the source#1
the internal spk is on sink#0
the external headphone is on sink#1

Users expect that after plugging the external device, it will become
the active device automatically. The switch-on-port-available could
make it to be the active_port on its own source/sink, but can't make
source/sink to be default_source/sink since the sources/sinks belong
to the same profile (HiFi usually).

If we adjust the source/sink priority according to ucm ports priority,
the device_port.c could handle the default_source/sink changing then.
Usually we set higher priority for external device than internal
device in the ucm.

In order to bring the lowest side effect on the source/sink priority,
I change the ucm priority to units digit first, then add it to the
original priority.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2020-07-17 09:20:50 +00:00
Tanu Kaskinen
0e691b9664 build-sys: meson: bump protocol version
This was forgotten in commit 861836c5f7.
2020-07-11 15:17:11 +03:00
Tanu Kaskinen
18bfbd1e1c i18n: Update pulseaudio.pot 2020-07-10 13:44:52 +03:00
Jean-Baptiste Holcroft
f7667f9d6a Translated using Weblate (French)
Currently translated at 100.0% (517 of 517 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/fr/
2020-07-10 13:42:26 +03:00
Piotr Drąg
fa4f3c685e Translated using Weblate (Polish)
Currently translated at 100.0% (533 of 533 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/pl/
2020-07-10 13:42:26 +03:00
Oğuz Ersen
76e01f2235 Translated using Weblate (Turkish)
Currently translated at 100.0% (527 of 527 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/tr/
2020-07-10 13:42:26 +03:00
Hui Wang
ede8cbb131 alsa: make the unsuspend more robust
We met a weird situation on a couple of Lenovo machines and at least
on one Dell machine. First we open the gnome-sound-setting, then
suspend and resume the system, after the system resume back, the audio
devices change to dummy, the audio doesn't work anymore. And pacmd
list-cards shows no available sound card.

Through debugging I found after resume, the alsa receives POLLERR
events and it will call unsuspend to recover the pcm, but at that
moment, the device nodes in /dev/snd/ is not accessible, so the
snd_pcm_open() fails and the pulseaudio unload the module-alsa-card.

Here I add retry and pa_msleep if snd_pcm_open fails, I tested it on
all machines which have this problem, pa_msleep(25) is ok for most of
them, there is only one machine which needs to call pa_msleep(25)
twice, so for safety reason, I set the max retry times to 4.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2020-07-09 16:43:17 +08:00
Tanu Kaskinen
f12795330b alsa-ucm: Fix NULL pointer handling
get_mixer_device() can return NULL when no mixer device is configured
for the device, so mdev2 can be NULL.
2020-07-06 12:47:19 +03:00