Recently Written · git

sad

sad (2f30.org simple audio daemon) with a Cygwin/OSS port on branch cygwin

git clone https://github.com/equwal/sad

Log | Files | Refs


commit 2c384644d2379e0ed5f7e72750ffacf9a531cceb
sin <sin@2f30.org>
2015-01-02 18:21:34 +0000

Disable alsa resampling and bring down latency to 50ms instead of 500ms

 alsa.c       | 2 +-
 config.def.h | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/alsa.c b/alsa.c
index c990293..32dbded 100644
--- a/alsa.c
+++ b/alsa.c
@@ -76,7 +76,7 @@ alsaopen(Format *fmt)
 	}
 
 	if ((r = snd_pcm_set_params(hdl, format, SND_PCM_ACCESS_RW_INTERLEAVED,
-	     fmt->channels, fmt->rate, 1, 500000)) < 0) {
+	     fmt->channels, fmt->rate, 0, 50000)) < 0) {
 		warnx("send_pcm_set_params: %s\n", snd_strerror(r));
 		goto err0;
 	}
diff --git a/config.def.h b/config.def.h
index f66642e..8981c60 100644
--- a/config.def.h
+++ b/config.def.h
@@ -5,7 +5,7 @@ Outputcfg outputcfgs[] = {
 		.name = "sndio",
 		.fmt = {
 			.bits = 16,
-			.rate = 44100,
+			.rate = 48000,
 			.channels = 2
 		},
 		.enabled = 0,
@@ -15,7 +15,7 @@ Outputcfg outputcfgs[] = {
 		.name = "alsa",
 		.fmt = {
 			.bits = 16,
-			.rate = 44100,
+			.rate = 48000,
 			.channels = 2
 		},
 		.enabled = 1,
@@ -25,7 +25,7 @@ Outputcfg outputcfgs[] = {
 		.name = "fifo",
 		.fmt = {
 			.bits = 16,
-			.rate = 44100,
+			.rate = 48000,
 			.channels = 2
 		},
 		.enabled = 0,