Accepting request 937412 from home:alarrosa:branches:multimedia:libs

- Split the configuration to separate the audio initialization
  to a new wireplumber-audio subpackage. This way, if that package
  is not installed, pipewire doesn't open the audio devices, thus
  not entering a race-condition with pulseaudio but still allowing
  to manage v4l2 devices and sharing the screen in wayland, for
  example (boo#1188516).

OBS-URL: https://build.opensuse.org/request/show/937412
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=10
This commit is contained in:
Antonio Larrosa 2021-12-09 08:47:20 +00:00 committed by Git OBS Bridge
parent 16613e5370
commit 9b3a423d50
3 changed files with 83 additions and 0 deletions

47
split-config-file.py Normal file
View File

@ -0,0 +1,47 @@
#!/usr/bin/python3
import hashlib
import sys
def md5FromData(data):
hash_md5 = hashlib.md5()
hash_md5.update(data)
return hash_md5.hexdigest()
contents = open('90-enable-all.lua', 'r', encoding='utf-8').read()
md5sum = md5FromData(contents.encode('utf-8'))
expected_md5sum = '1317fb5df6ae842fda3ef845f195e084'
if md5sum != expected_md5sum:
print('The script has to be updated for new changes in 90-enable-all.lua')
print(f'File md5sum: {md5sum}')
print(f'expected md5sum: {expected_md5sum}')
sys.exit(1)
content_sections = contents.split('\n\n')
sections = ['enable-metadata',
'default-access-policy',
'load-devices',
'track-user-choices',
'link-nodes-by-roles',
'suspend-idle-nodes',
'device-activation']
if len(content_sections) != len(sections):
print('The script has to be updated for new changes in 90-enable-all.lua')
sys.exit(1)
for i, (content, sec) in enumerate(zip(content_sections, sections)):
if sec == 'load-devices':
lines = content.split('\n')
open(f'90-{i}-1-enable-alsa.lua', 'w',
encoding='utf-8').write(lines[1])
open(f'90-{i}-2-enable-v4l2.lua', 'w',
encoding='utf-8').write(lines[2])
continue
filename = f'90-{i}-{sec}.lua'
open(filename, 'w', encoding='utf-8').write(content)

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Fri Dec 3 18:12:42 UTC 2021 - Antonio Larrosa <alarrosa@suse.com>
- Split the configuration to separate the audio initialization
to a new wireplumber-audio subpackage. This way, if that package
is not installed, pipewire doesn't open the audio devices, thus
not entering a race-condition with pulseaudio but still allowing
to manage v4l2 devices and sharing the screen in wayland, for
example (boo#1188516).
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Nov 24 16:09:52 UTC 2021 - Antonio Larrosa <alarrosa@suse.com> Wed Nov 24 16:09:52 UTC 2021 - Antonio Larrosa <alarrosa@suse.com>

View File

@ -28,6 +28,7 @@ License: MIT
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
URL: https://gitlab.freedesktop.org/pipewire/wireplumber URL: https://gitlab.freedesktop.org/pipewire/wireplumber
Source0: wireplumber-%{version}.tar.xz Source0: wireplumber-%{version}.tar.xz
Source1: split-config-file.py
Patch0: 0001-m-reserve-device-replace-the-hash-table-key-on-new-insert.patch Patch0: 0001-m-reserve-device-replace-the-hash-table-key-on-new-insert.patch
Patch1: 0002-policy-node-wait-for-nodes-when-we-become-unlinked.patch Patch1: 0002-policy-node-wait-for-nodes-when-we-become-unlinked.patch
Patch100: reduce-meson-required-version.patch Patch100: reduce-meson-required-version.patch
@ -88,6 +89,22 @@ a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire. external tools for managing PipeWire.
%package audio
Summary: Session / policy manager implementation for PipeWire (audio support)
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
Requires: %{libwireplumber} = %{version}
Conflicts: pulseaudio
Recommends: pipewire-pulseaudio
%description audio
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.
This package enables the use of alsa devices in PipeWire.
%package devel %package devel
Summary: Session / policy manager implementation for PipeWire Summary: Session / policy manager implementation for PipeWire
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
@ -135,6 +152,11 @@ the wireplumber shared library.
%patch100 -p1 %patch100 -p1
%endif %endif
pushd src/config/main.lua.d
python3 %{SOURCE1}
rm 90-enable-all.lua
popd
%build %build
%if %{pkg_vcmp gcc < 8} %if %{pkg_vcmp gcc < 8}
export CC=gcc-9 export CC=gcc-9
@ -194,6 +216,10 @@ export XDG_RUNTIME_DIR=/tmp
%{_userunitdir}/wireplumber.service %{_userunitdir}/wireplumber.service
%{_userunitdir}/wireplumber@.service %{_userunitdir}/wireplumber@.service
%{_datadir}/wireplumber %{_datadir}/wireplumber
%exclude %{_datadir}/wireplumber/main.lua.d/90-2-1-enable-alsa.lua
%files audio
%{_datadir}/wireplumber/main.lua.d/90-2-1-enable-alsa.lua
%files devel %files devel
%{_includedir}/wireplumber-%{apiver} %{_includedir}/wireplumber-%{apiver}