From 855354a87d2983e190088bc5330c129094b900ca Mon Sep 17 00:00:00 2001 From: dvdli Date: Tue, 12 Jan 2021 14:53:42 +0800 Subject: remove pcm_prepare in pcm_open For the dynamic pcm device, it is valid to specify the backend after opening it. However, it is invalid to call prepare on a dynamic pcm device without connecting any backend device. We should not do pcm_prepare in pcm_open. See also: Issue #197 --- utils/tinyplay.c | 1 + 1 file changed, 1 insertion(+) (limited to 'utils/tinyplay.c') diff --git a/utils/tinyplay.c b/utils/tinyplay.c index 2689158..482ad24 100644 --- a/utils/tinyplay.c +++ b/utils/tinyplay.c @@ -192,6 +192,7 @@ int ctx_init(struct ctx* ctx, const struct cmd *cmd) pcm_close(ctx->pcm); return -1; } + pcm_prepare(ctx->pcm); return 0; } -- cgit v1.2.3 From c0f924738de2b8f5478e8b454b4ad5521802f3f6 Mon Sep 17 00:00:00 2001 From: dvdli Date: Thu, 28 Jan 2021 11:53:30 +0800 Subject: prepare in pcm_generic_transfer --- utils/tinyplay.c | 1 - 1 file changed, 1 deletion(-) (limited to 'utils/tinyplay.c') diff --git a/utils/tinyplay.c b/utils/tinyplay.c index 482ad24..2689158 100644 --- a/utils/tinyplay.c +++ b/utils/tinyplay.c @@ -192,7 +192,6 @@ int ctx_init(struct ctx* ctx, const struct cmd *cmd) pcm_close(ctx->pcm); return -1; } - pcm_prepare(ctx->pcm); return 0; } -- cgit v1.2.3 From 3694925022aa16b10978c92b9a2a69661dbbcdcf Mon Sep 17 00:00:00 2001 From: dvdli Date: Thu, 28 Jan 2021 15:03:17 +0800 Subject: Let pcm_mmap_read/write call pcm_readi/writei The pcm_readi and pcm_writei also can deal with the mmap read/write. Also mark the pcm_mmap_read/write functions as deprecated functions and update the test case. Add mmap playback support to tinyplay --- utils/tinyplay.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'utils/tinyplay.c') diff --git a/utils/tinyplay.c b/utils/tinyplay.c index 2689158..4c7ccf6 100644 --- a/utils/tinyplay.c +++ b/utils/tinyplay.c @@ -303,6 +303,9 @@ int main(int argc, char **argv) case 'i': cmd.filetype = opts.optarg; break; + case 'M': + cmd.flags |= PCM_MMAP; + break; case 'h': print_usage(argv[0]); return EXIT_SUCCESS; -- cgit v1.2.3