summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* daemon/meson.build: Install dbus policy in /usr, not /etcHEADmasterGioele Barabucci2023-04-211-1/+1
| | | | | | | | | | | | From https://bugs.debian.org/1006631: > dbus supports policy files in both `/usr/share/dbus-1/system.d` and > `/etc/dbus-1/systemd`. [The] recently released dbus 1.14.0, officially > deprecates installing packages' default policies into `/etc/dbus-1/systemd`, > instead reserving it for the sysadmin. This is the same idea as the > difference between `/usr/lib/udev/rules.d` and `/etc/udev/rules.d`. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/783>
* ci: Use built-in distribution image name mechanismArun Raghavan2023-04-211-2/+1
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/789>
* ci: Update to freedesktop/ci-templatesArun Raghavan2023-04-211-4/+4
| | | | | | The upstream repo changed quite some time ago. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/788>
* pactl, pacmd: Allow to unset the configured default sink or sourceGeorg Chini2023-03-254-15/+35
| | | | | | | | | | | Currently there is no way to unset the default sink or source once it was configured manually by the user. This patch introduces the special name @NONE@, which can be used with the pacmd or pactl set-default-sink and set-default-source commands to unset the user configured default. When the default is unset, pulseaudio will return to the standard default sink or source selection mechanism based on priority. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/785>
* echo-cancel: Fix macOS buildWeijia Wang2023-03-221-2/+9
| | | | | Signed-off-by: Weijia Wang <contact@weijia.wang> Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/786>
* alsa: ucm: Fix spurious mixer path removal on initial profile setHector Martin2023-03-191-2/+5
| | | | | | | | | | | | | | | | | | | | The code that removes the mixer path if probing fails can be called in the path that sets a non-off device profile on hotplug *before* card->active_profile is updated, which results in spuriously removing the mixer path. By this point, context->ucm->active_verb would be set to the same as the profile name, so we can use that instead to avoid the issue. On Apple Silicon machines with the UCM profiles in the Asahi Linux repo, this manifests as the headphones jack having hardware volume controls *only* if PA is started with headphones connected and until they are disconnected. Hotplugs end up triggering the bad codepath, and it falls back to software volume (which is particularly a problem when the hardware volume happens to be very low or 0 at that point). Fixes: a9cc1373e2a7 ("alsa: ucm - update the mixer path also after volume probe") Signed-off-by: Hector Martin <marcan@marcan.st> Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/752>
* alsa-ucm: Fix more instances of profile-verb conflationAlper Nebi Yasak2023-03-192-18/+18
| | | | | | | | | | | | | | | | | | The ucm_get_device_property() function adds to each UCM device's playback_volumes (or capture_volumes) hash map an associated volume mixer keyed with the UCM verb. These key-value pairs are then iterated over in various places which assume the key is a profile name. This assumption is no longer true since we can generate multiple profiles to use conflicting devices. A previous commit 45278904167f ("alsa-ucm: Stop conflating profile name with UCM verb name") fixes some instances of this assumption, but misses the relation explained above. Fix more instances of misleading "profile"s where the UCM verb name is actually meant. Fixes: 45278904167f ("alsa-ucm: Stop conflating profile name with UCM verb name") Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/771>
* alsa-ucm: Consider devices using the same PCM as incompatibleAlper Nebi Yasak2023-03-191-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although it's a valid UCM configuration to have multiple devices using the same PlaybackPCM or CapturePCM, it's unclear how PulseAudio should handle the cases where multiple of these devices are enabled. Some options I can think of are: - Merge all devices sharing the same PCM into the same mapping, open only one PCM substream for this mapping, and add 'combination ports' that enable combinations of the devices. This has been the case until recently, although the combination port logic was broken. A problem with this is that we can't independently control device volumes. We most likely cannot use hardware volumes either. - Have one mapping for each device in the same profile, and open one PCM substream for each mapping. This is the current state, and it fails when there are fewer substreams than devices. Otherwise it works, but it's still confusing, as sound directed to a device-specific mapping might end up playing at multiple devices. - Make multiple profiles each with combinations of upto-substream-count devices, and have one mapping/substream per device. This still causes the confusion mentioned above. And it's likely that the substream count will almost always be one, where this case degenerates into the last one. - Have one mapping for each device in the same profile, but open only one PCM substream. I assume this is possible with software mixing, but it is still confusing like the above, and probably less performant. - Generate multiple profiles each with one of the shared-PCM devices, again with one mapping/substream for that one device. The trade-off with this is that we can't use multiple of these devices at the same time. However, this doesn't have the output device confusion, combination port's volume problems, or the substream count limitation. This patch takes a short-cut to achieve the last option, by considering shared-PCM devices implicitly conflicting with each other. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/743>
* alsa-ucm: Disable old modifiers when switching profiles of same verbAlper Nebi Yasak2023-03-191-2/+15
| | | | | | | | | | | | | | | | While switching profiles of the same UCM verb, existing code first disables devices that are only on the first profile to avoid conflicts. However, it only disables devices, not modifiers. Even worse, modifiers which have PlaybackPCM/CapturePCM are incorrectly treated as devices and result in a segmentation fault. Check what we are disabling, and call the appropriate disable function for both devices and modifiers. Modifiers are disabled before devices, because _dismod calls fail when the modifier's supported devices are disabled. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/742>
* alsa-ucm: Add enable, disable, status helpers for modifiersAlper Nebi Yasak2023-03-191-14/+54
| | | | | | | | | These are mostly the same as the device helpers added in c83b34516929 ("alsa-ucm: Add enable, disable, status helpers for devices"), but for modifiers instead. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/742>
* switch-on-connect: Do not overwrite user configured default sink/sourceGeorg Chini2023-03-163-11/+131
| | | | | | | | | | | | Currently module-switch-on-connect overwrites the default sink or source that the user has configured. This means that when the overwritten default sink or source becomes unavailable, the new default will be chosen based on priority and the default will not return to the originally configured value. This patch solves the issue by introducing new core variables for the sink or source chosen by the policy module which have higher priority than the user configured defaults. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/784>
* meson: Add DEF file to export APIs in WindowsBiswapriyo Nath2023-03-163-5/+393
| | | | | | | | | | This helps to export correct APIs for compiler toolchain which does not support version script file. For example, mingw clang. The APIs in libpulse.def are similar with map-file except those are in pulse-simple and pulse-mainloop-glib. Those are exported in different shared library in Windows platform. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/761>
* memblockq: Drop check for chunk index alignment, require aligned lengthIgor V. Kovalenko2023-02-262-4/+3
| | | | | | | | | There is no requirement for chunk index to be aligned, we only need chunk length to be multiple of sample frame size. Fixes: 6434853b0 ("memblockq: Do not allow non-frame indices in the memblock queue") Fixes: 22827a5e1 ("protocol-native: Fail if trying to push unaligned memblock into queue") Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/779>
* alsa-util: Fix pa_alsa_get_supported_formats fallback.Igor V. Kovalenko2023-02-251-31/+31
| | | | | | | | Looks like original intention was to scan over sample formats supported by PA, but code does the scan by list of alsa formats. Reverse the map and adjust fallback case which now can use the same map. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/782>
* alsa-util: Perform format and rate detection before setting HW paramsIgor V. Kovalenko2023-02-256-12/+46
| | | | | | | | | | | Perform detection of supported sample format and rates just after device is opened, before `snd_pcm_hw_params()` is called for the first time. This fixes a problem where device restricts available sample rates after HW params are set preventing sample rate detection (seen with UAC2 devices and kernel 6.1.9) Bug: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1414 Bug: https://github.com/alsa-project/alsa-lib/issues/119 Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/782>
* alsa-profiles: rename mappings for Xonar SEAtaberk Özen2023-02-201-4/+2
| | | | | | Remove descriptions as well. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/754>
* alsa-profiles: import Asus Xonar SE profile from pipewireAtaberk Özen2023-02-202-0/+96
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/754>
* pstream: Pass frame size to keep split memblock parts alignedIgor V. Kovalenko2023-02-105-7/+16
| | | | | | | | | | | | `pa_pstream_send_memblock()` would split incoming memblock into parts not exceeding maximum pool block size. To make sure split parts of memblock are still frame-aligned add new `align` arg to `pa_pstream_send_memblock`, find out required alignment from stream sample format and pass it there. Bump default alignment to 256 which is good up to 32bit 64ch frames. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/780>
* bluetooth: Do not attempt decoding too short faststream packet dataIgor V. Kovalenko2023-02-101-0/+5
| | | | | | | | | | Looks like sbc_decode() would seldom access more than specified input length bytes from input buffer if input length is less than expected frame size. Fix potential access past allocated memory by checking if input contains complete frame before calling sbc_decode() Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/781>
* rtp-recv: Use getaddrinfo to improve support for ipv6.Alistair Leslie-Hughes2023-02-081-0/+38
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/774>
* rtp-send: Use getaddrinfo to improve support for ipv6 on source addressAlistair Leslie-Hughes2023-02-081-0/+37
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/774>
* resampler: Fix oversized memblock pushed from resamplerIgor V. Kovalenko2023-02-081-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assumption that the format enum is ordered by size is not valid for quite some time, since 24bit formats were appended to format enum later than 32bit formats. This causes resampler to produce properly aligned memblock of size larger than maximum mempool block size if input format is 24bit and output format is 32bit. Oversized block is getting split by `pa_pstream_send_memblock()` into parts of size not exceeding maximum mempool block size. This usually works well but for 32ch 32bit 48000Hz stream the frame alignment is 128 bytes and maximum mempool block size value is multiple of 64 but not 128 bytes, therefore resulting parts are misaligned. On receiving side this causes extra allocation of 128 byte chunk while `mcalign` helper reassembles properly aligned frame out of second block of misaligned size. While first and second properly aligned frames are retrieved successfully from `mcalign` helper, third retrieved frame would end up with properly aligned size but misaligned memblock index (in this example, that would be 64 bytes.) Attempt to push a chunk with misaligned memblock index causes assertion failure Assertion 'uchunk->index % bq->base == 0' failed at memblockq.c:289, function pa_memblockq_push(). Aborting. Fix oversized block issue by checking proper size of format instead of enum value. Fixes: a67c21f09 ("merge 'lennart' branch back into trunk.") Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/778>
* tunnel-sink-new: Fix hang when used in combination with module-combine-sinkGeorg Chini2023-02-072-12/+24
| | | | | | | | | | | | | When tunnel-sink-new was used in combination with module-combine-sink, PA would hang because the main thread was blocked waiting for the execution of the latency snapshot message. The message would never be processed because the rtpoll associated with the control_inq of module-combine-sink was never run. This patch fixes the problem by running the rtpoll in the thread function to process incoming messages. Though there are no users of the rtpoll for module-tunnel-source-new, the same change is applied there. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/773>
* bluetooth: Amend writeout to send more initial framesIgor V. Kovalenko2023-02-061-2/+8
| | | | | | | | | | | | | | | | | When bluetooth transport has both both sink and source, pulseaudio would synchronize writing out frames with reading frames from peer to make fair schedule of reads and writes. Pulseaudio allows two blocks of data to be sent to peer before synchronizing writes with reads just in case that peer implements similar write schedule. It could happen that first blocks are still missed by peer, which would cause pulseaudio writes to stall waiting for first frames from peer. Fix this by allowing more data frames out until data from peer is actually received. Closes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1424 Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/777>
* alsa-util: Add more standard sample rates.Igor V. Kovalenko2023-02-062-2/+3
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/776>
* alsa-util: Dump probed ratesIgor V. Kovalenko2023-02-061-0/+19
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/775>
* rtp-send: Use getaddrinfo to improve support for ipv6.Alistair Leslie-Hughes2023-01-211-0/+42
| | | | | | | | | inet_pton isn't guarantee to support IPV6 address when a scope has been specified. Using getaddrinfo instead, we can safely pass through INET6+scope and have it translated to a usable address. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/766>
* stream-interaction: Fix regression when a trigger role is also a cork roleGeorg Chini2023-01-211-7/+28
| | | | | | | | | | If the same role is named in trigger_roles and cork_roles, a stream with that role will crash PA. This patch fixes the crash and re-introduces the old behavior, so that for example specifying trigger_roles=alarm, phone and cork_roles=alarm, multimedia means that a phone stream will cork alarm and multimedia streams while an alarm stream will only cork multimedia streams. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/767>
* stream-interaction: Extend trigger groups to module-role-corkGeorg Chini2023-01-211-24/+30
| | | | | | | | For module-role-ducking, trigger and ducking groups were introduced some years ago. This patch extends the functionality to module-role-cork, so that trigger and cork roles may now contain "/" separated groups. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/767>
* backend-native: Fix parsing comma-delimited responseIgor V. Kovalenko2023-01-191-2/+2
| | | | | | | | | | | | | Incoming RFCOMM string has extra end-of-command terminating character which breaks both AT+BIA= and AT+BAC= parsers which only expect a comma. This leads to error parsing last element of response in both cases and could prevent detecting mSBC availability if mSBC codec id comes last, e.g. AT+BIA=1,2 Fix this by additionally checking for delimiters in both parsers. Fixes: 3c63f8e6d ("backend-native: Fix stack corruption reading RFCOMM AT+BIA= response") Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/768>
* time-smoother-2: Fix time calculation by comparing timestampsflyingOwl2022-12-301-1/+2
| | | | | | | | | This fixes the rare case of resume_time being bigger than time_stamp. Which happens sometimes when a gstreamer client is quickly seeking through a media file. The resulting integer underflow then causes a huge value in current_time which will break the playback. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/764>
* pulsecore: Set errno before calling readAlistair Leslie-Hughes2022-12-141-0/+1
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/759>
* proplist-util: Don't assume gdkx is there as gtk could be built without itMart Raudsepp2022-12-101-1/+5
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/757>
* build-sys: Fix macOS buildShunsuke Shimizu2022-12-076-26/+53
| | | | | | | | | | | | | * Enable macOS specific modules (module-bonjour-publish, module-coreaudio-detect and module-coreaudio-device) * Correctly set `PA_SOEXT` (.so, .dylib and .dll) * Build `poll-posix.c` and `semaphore-osx.c` * Drop linker flag `-Wl,-z,nodelete` on Darwin * Drop linker flag `-Wl,--no-undefined` on Darwin * Prefer to `clock_gettime` over compat impl for old Darwin * Disable SCM credential on Darwin Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/746>
* pactl: Stop a crash when setting the volume which is out of rangeAlistair Leslie-Hughes2022-12-061-2/+16
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/758>
* module-combine-sink: Suspend while unloading to fix crash moving sinksIgor V. Kovalenko2022-11-271-0/+3
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/756>
* module-combine-sink: Do not set up rate adjustment timer at load timeIgor V. Kovalenko2022-11-271-3/+0
| | | | | | | | Rate adjustment timer is set up when combine sink is resumed and relased when combine sink is suspended. Do not create this timer again while module is loaded to prevent duplicate effort causing assertion in time_callback. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/756>
* backend-native: Fix stack corruption reading RFCOMM AT+BIA= responseIgor V. Kovalenko2022-11-261-3/+8
| | | | | | | | | | On-stack buffer size is too short for sscanf to read AT+BIA= and AT+BAC= response strings which have variable length. Fix this by replacing sscanf with proper copy of input string. Fixes: cca0d6937 ("bluetooth: add AT+BIA support") Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/755>
* Ensure fds are closed when exec functions are used.Alistair Leslie-Hughes2022-11-241-1/+1
| | | | | | | | | | | When usng shm_open, FD_CLOEXEC is set explicitly. However when using memfd_create, we must pass the MFD_CLOEXEC flag to ensure the same fcntl value (FD_CLOEXEC) is set. Fixes #1394 Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/751>
* sndfile: handle sndfiles with s24 formatWim Taymans2022-11-101-4/+4
| | | | | | | | | Samples with s24 format should be read with the readf_int read function instead of the raw function. This fixes playback of flac/wav with s24 sample format. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/750>
* Propagate return value from pa_pstream_attach_memfd_shmidAlistair Leslie-Hughes2022-10-191-1/+2
| | | | | | | | | Using wine, The mmap call in shm_attach sometimes fails with ENOMEM which isn't propagated up the call stack. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/747>
* bluetooth: Add 20dB boost for faststream source volumeIgor V. Kovalenko2022-10-173-0/+53
| | | | | | | | | Some devices unexpectedly return stereo backchannel stream with wrong frequency, and volume of backchannel stream appears too low. If this happens, boost source volume by 20dB. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/628>
* bluetooth: Handle fragmented faststream framesIgor V. Kovalenko2022-10-171-13/+61
| | | | | | Incoming frames can span multiple packets, add support for this. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/628>
* bluetooth: Use stereo sample spec for faststream backchannelIgor V. Kovalenko2022-10-171-4/+17
| | | | | | | | | | Faststream backchannel decoder does not know whether incoming stream is mono or stereo before first packet is decoded, and some devices return stereo stream. As it is not easy to change source sample spec after source is created, use stereo sample spec always and perform conversion if mono stream is found. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/628>
* bluetooth: Add faststream codecIgor V. Kovalenko2022-10-177-27/+482
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/628>
* bluetooth: Do not use hardware volume control for A2DP backchannelIgor V. Kovalenko2022-10-171-1/+18
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/628>
* bluetooth: Free memblock after codec errorsIgor V. Kovalenko2022-10-171-0/+3
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/628>
* pactl: SUBSCRIBE add a newline after every json messageacheronfail2022-09-271-1/+1
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/748>
* meson: use proper type for boolswael2022-09-211-1/+1
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/749>
* time-smoother-2: Fix stream time when stream starts pausedGeorg Chini2022-08-251-1/+1
| | | | | | | | | When a stream is started but has not yet called smoother_2_put(), pa_smoother_2_get() returns the time since the start of the stream even if the stream was started paused. When the stream is started paused, pa_smoother_2_get() should return 0 instead. This patch fixes the problem. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/745>