From 84eed9ef6f3b141a97a63a846e2a03ef1837dfda Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 8 Jan 2021 16:30:57 +0100 Subject: [PATCH] pw-cat: use none as default latency for record Don't force the record latency to the large latency we use for playback (100ms) but set it to none, which means use defaults. --- src/tools/pw-cat.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tools/pw-cat.c b/src/tools/pw-cat.c index 3c140852a..76c98e252 100644 --- a/src/tools/pw-cat.c +++ b/src/tools/pw-cat.c @@ -56,7 +56,8 @@ #define DEFAULT_MEDIA_CATEGORY_RECORD "Capture" #define DEFAULT_MEDIA_ROLE "Music" #define DEFAULT_TARGET "auto" -#define DEFAULT_LATENCY "100ms" +#define DEFAULT_LATENCY_PLAY "100ms" +#define DEFAULT_LATENCY_REC "none" #define DEFAULT_RATE 48000 #define DEFAULT_CHANNELS 2 #define DEFAULT_FORMAT "s16" @@ -979,7 +980,7 @@ static void show_usage(const char *name, bool is_error) DEFAULT_MEDIA_TYPE, DEFAULT_MEDIA_CATEGORY_PLAYBACK, DEFAULT_MEDIA_ROLE, - DEFAULT_TARGET, DEFAULT_LATENCY); + DEFAULT_TARGET, DEFAULT_LATENCY_PLAY); fprintf(fp, " --rate Sample rate (req. for rec) (default %u)\n" @@ -1498,7 +1499,9 @@ int main(int argc, char *argv[]) data.target_id = PW_ID_ANY; } if (!data.latency) - data.latency = DEFAULT_LATENCY; + data.latency = data.mode == mode_playback ? + DEFAULT_LATENCY_PLAY : + DEFAULT_LATENCY_REC; if (data.channel_map != NULL) { if (parse_channelmap(data.channel_map, &data.channelmap) < 0) { fprintf(stderr, "error: can parse channel-map \"%s\"\n", data.channel_map);