Module Name:src
Committed By: martin
Date: Thu Jun 20 17:58:17 UTC 2024
Modified Files:
src/usr.bin/aiomixer [netbsd-10]: main.c
Log Message:
Pull up following revision(s) (requested by nia in ticket #703):
usr.bin/aiomixer/main.c: revision 1.6
aiomixer(1): Fix setting volume on sb(4) emulated in QEMU.
The driver does not return a "delta", assume it's 16.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.2.1 src/usr.bin/aiomixer/main.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/aiomixer/main.c
diff -u src/usr.bin/aiomixer/main.c:1.4 src/usr.bin/aiomixer/main.c:1.4.2.1
--- src/usr.bin/aiomixer/main.c:1.4 Sun Jul 18 11:45:31 2021
+++ src/usr.bin/aiomixer/main.c Thu Jun 20 17:58:17 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.4 2021/07/18 11:45:31 nia Exp $ */
+/* $NetBSD: main.c,v 1.4.2.1 2024/06/20 17:58:17 martin Exp $ */
/*-
* Copyright (c) 2021 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -149,7 +149,12 @@ slide_control(struct aiomixer *aio,
switch (info->type) {
case AUDIO_MIXER_VALUE:
- delta = right ? info->un.v.delta : -info->un.v.delta;
+ if (info->un.v.delta != 0) {
+ delta = right ? info->un.v.delta : -info->un.v.delta;
+ } else {
+ /* delta is 0 in qemu with sb(4) */
+ delta = right ? 16 : -16;
+ }
/*
* work around strange problem where the level can be
* increased but not decreased, seen with uaudio(4)