SHA256
1
0
forked from pool/wireplumber
wireplumber/split-config-file.py

48 lines
1.4 KiB
Python
Raw Normal View History

#!/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'))
Accepting request 964074 from home:alarrosa:branches:multimedia:libs - Update to version 0.4.9: * Fixes: - restore-stream no longer crashes if properties for it are not present in the config (#190) - spa-json no longer crashes on non-x86 architectures - Fixed a potential crash in the bluetooth auto-switch module (#193) - Fixed a race condition that would cause Zoom desktop audio sharing to fail (#197) - Surround sound in some games is now exposed properly (pipewire#876) - Fixed a race condition that would cause the default source & sink to not be set at startup - policy-node now supports the 'target.object' key on streams and metadata - Multiple fixes in policy-node that make the logic in some cases behave more like PulseAudio (regarding nodes with the dont-reconnect property and regarding following the default source/sink) - Fixed a bug with parsing unquoted strings in spa-json * Misc: - The policy now supports configuring "persistent" device profiles. If a device is manually set to one of these profiles, then it will not be auto-switched to another profile automatically under any circumstances (#138, #204) - The device-activation module was re-written in lua - Brave, Edge, Vivaldi and Telegram were added in the bluetooth auto-switch applications list - ALSA nodes now use the PCM name to populate node.nick, which is useful at least on HDA cards using UCM, where all outputs OBS-URL: https://build.opensuse.org/request/show/964074 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=35
2022-03-22 19:53:03 +01:00
expected_md5sum = '74b508b1be26ae58d3e851d3abebc009'
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',
Accepting request 952225 from home:alarrosa:branches:multimedia:libs - Update to version 0.4.8: * Highlights: - Added bluetooth profile auto-switching support. Bluetooth headsets will now automatically switch to the HSP/HFP profile when making a call and go back to the A2DP profile after the call ends (#90) - Added an option (enabled by default) to auto-switch to echo-cancel virtual device nodes when the echo-cancel module is loaded in pipewire-pulse, if there is no other configured default node * Fixes: - Fixed a regression that prevented nodes from being selected as default when using the pro-audio profile (#163) - Fixed a regression that caused encoded audio streams to stall (#178) - Fixed restoring bluetooth device profiles * Library: - A new WpSpaJson API was added as a front-end to spa-json. This is also exposed to Lua, so that Lua scripts can natively parse and write data in the spa-json format * Misc: - wpctl can now list the configured default sources and sinks and has a new command that allows clearing those configured defaults, so that wireplumber goes back to choosing the default nodes based on node priorities - The restore-stream script now has its own configuration file in main.lua.d/40-stream-defaults.lua and has independent options for restoring properties and target nodes - The restore-stream script now supports rule-based configuration to disable restoring volume properties and/or OBS-URL: https://build.opensuse.org/request/show/952225 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=30
2022-02-07 18:43:50 +01:00
'track-user-choices-devices',
'track-user-choices-streams',
'link-nodes-by-roles',
Accepting request 964074 from home:alarrosa:branches:multimedia:libs - Update to version 0.4.9: * Fixes: - restore-stream no longer crashes if properties for it are not present in the config (#190) - spa-json no longer crashes on non-x86 architectures - Fixed a potential crash in the bluetooth auto-switch module (#193) - Fixed a race condition that would cause Zoom desktop audio sharing to fail (#197) - Surround sound in some games is now exposed properly (pipewire#876) - Fixed a race condition that would cause the default source & sink to not be set at startup - policy-node now supports the 'target.object' key on streams and metadata - Multiple fixes in policy-node that make the logic in some cases behave more like PulseAudio (regarding nodes with the dont-reconnect property and regarding following the default source/sink) - Fixed a bug with parsing unquoted strings in spa-json * Misc: - The policy now supports configuring "persistent" device profiles. If a device is manually set to one of these profiles, then it will not be auto-switched to another profile automatically under any circumstances (#138, #204) - The device-activation module was re-written in lua - Brave, Edge, Vivaldi and Telegram were added in the bluetooth auto-switch applications list - ALSA nodes now use the PCM name to populate node.nick, which is useful at least on HDA cards using UCM, where all outputs OBS-URL: https://build.opensuse.org/request/show/964074 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=35
2022-03-22 19:53:03 +01:00
'suspend-idle-nodes']
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)