Use patcl to adjust the volume for speaker-test

Needed due to the switch to pipewire and pulseaudio.
This commit is contained in:
2Shirt 2022-07-09 20:05:38 -07:00
parent 38e867d3e3
commit 8d70c7bfc6
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -23,14 +23,17 @@ def audio_test_linux() -> None:
LOG.info('Audio Test')
# Set volume
for source in ('Master', 'PCM'):
cmd = f'amixer -q set "{source}" 80% unmute'.split()
run_program(cmd, check=False)
commands = (
'pactl set-sink-mute @DEFAULT_SINK@ off',
'pactl set-sink-volume @DEFAULT_SINK@ 80%',
)
for cmd in commands:
run_program(cmd.split(), check=False)
# Run audio tests
for mode in ('pink', 'wav'):
cmd = f'speaker-test -c 2 -l 1 -t {mode}'.split()
run_program(cmd, check=False, pipe=False)
cmd = f'speaker-test -c 2 -l 1 -t {mode}'
run_program(cmd.split(), check=False, pipe=False)
if __name__ == '__main__':