[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/6] audio/jack: fix invalid minimum buffer size check
From: |
Geoffrey McRae |
Subject: |
[PATCH 1/6] audio/jack: fix invalid minimum buffer size check |
Date: |
Sat, 13 Jun 2020 14:05:13 +1000 |
JACK does not provide us with the configured buffer size until after
activiation which was overriding this minimum value. JACK itself doesn't
have this minimum limitation, but the QEMU virtual hardware and as such
it must be enforced, failure to do so results in audio discontinuities.
Signed-off-by: Geoffrey McRae <geoff@hostfission.com>
---
audio/jackaudio.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/audio/jackaudio.c b/audio/jackaudio.c
index 722ddb1dfe..d0b6f748f2 100644
--- a/audio/jackaudio.c
+++ b/audio/jackaudio.c
@@ -434,17 +434,6 @@ static int qjack_client_init(QJackClient *c)
jack_set_xrun_callback(c->client, qjack_xrun, c);
jack_on_shutdown(c->client, qjack_shutdown, c);
- /*
- * ensure the buffersize is no smaller then 512 samples, some (all?) qemu
- * virtual devices do not work correctly otherwise
- */
- if (c->buffersize < 512) {
- c->buffersize = 512;
- }
-
- /* create a 2 period buffer */
- qjack_buffer_create(&c->fifo, c->nchannels, c->buffersize * 2);
-
/* allocate and register the ports */
c->port = g_malloc(sizeof(jack_port_t *) * c->nchannels);
for (int i = 0; i < c->nchannels; ++i) {
@@ -468,6 +457,17 @@ static int qjack_client_init(QJackClient *c)
jack_activate(c->client);
c->buffersize = jack_get_buffer_size(c->client);
+ /*
+ * ensure the buffersize is no smaller then 512 samples, some (all?) qemu
+ * virtual devices do not work correctly otherwise
+ */
+ if (c->buffersize < 512) {
+ c->buffersize = 512;
+ }
+
+ /* create a 2 period buffer */
+ qjack_buffer_create(&c->fifo, c->nchannels, c->buffersize * 2);
+
qjack_client_connect_ports(c);
c->state = QJACK_STATE_RUNNING;
return 0;
--
2.20.1
- [PATCH 0/6] audio/jack: fixes to overall jack behaviour, Geoffrey McRae, 2020/06/11
- [PATCH 0/6] audio/jack: fixes to overall jack behaviour, Geoffrey McRae, 2020/06/14
- [PATCH 5/6] audio/jack: honour the enable state of the audio device, Geoffrey McRae, 2020/06/14
- [PATCH 2/6] audio/jack: remove unused stopped state, Geoffrey McRae, 2020/06/14
- [PATCH 4/6] audio/jack: do not remove ports when finishing, Geoffrey McRae, 2020/06/14
- [PATCH 1/6] audio/jack: fix invalid minimum buffer size check,
Geoffrey McRae <=
- [PATCH 6/6] audio/jack: simplify the re-init code path, Geoffrey McRae, 2020/06/14
- [PATCH 3/6] audio/jack: remove invalid set of input support bool, Geoffrey McRae, 2020/06/14
- Re: [PATCH 0/6] audio/jack: fixes to overall jack behaviour, no-reply, 2020/06/14