shithub: drawterm

Download patch

ref: 67284dd2c09c74ea425f4ded41a90b640b607eae
parent: 2d15857c35ea4aa8cea1d32600bfdbf776411e4c
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Tue Oct 26 10:40:12 EDT 2021

devaudio volume: expose pcm, skip unavailable handles

--- a/kern/devaudio.c
+++ b/kern/devaudio.c
@@ -56,6 +56,8 @@
 	"bass",		Fout, 		50,	50,
 
 	"speed",	Fin|Fout|Fmono,	Speed,	Speed,
+
+	"pcm",		Fout, 		50,	50,
 	0
 };
 
@@ -192,7 +194,11 @@
 		j = 0;
 		buf[0] = 0;
 		for(m=0; volumes[m].name; m++){
+			lov = -1;
+			rov = -1;
 			audiodevgetvol(m, &lov, &rov);
+			if(lov < 0 && rov < 0)
+				continue;
 			liv = lov;
 			riv = rov;
 			j += snprint(buf+j, sizeof(buf)-j, "%s", volumes[m].name);