* [PATCH 6/6] audio/jack: simplify the re-init code path
@ 2020-06-11 15:25 Geoffrey McRae
0 siblings, 0 replies; 3+ messages in thread
From: Geoffrey McRae @ 2020-06-11 15:25 UTC (permalink / raw)
To: qemu-devel; +Cc: kraxel
Signed-off-by: Geoffrey McRae <geoff@hostfission.com>
---
audio/jackaudio.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/audio/jackaudio.c b/audio/jackaudio.c
index b2b53985ae..72ed7c4929 100644
--- a/audio/jackaudio.c
+++ b/audio/jackaudio.c
@@ -395,6 +395,10 @@ static int qjack_client_init(QJackClient *c)
char client_name[jack_client_name_size()];
jack_options_t options = JackNullOption;
+ if (c->state == QJACK_STATE_RUNNING) {
+ return 0;
+ }
+
c->connect_ports = true;
snprintf(client_name, sizeof(client_name), "%s-%s",
@@ -485,9 +489,7 @@ static int qjack_init_out(HWVoiceOut *hw, struct audsettings *as,
QJackOut *jo = (QJackOut *)hw;
Audiodev *dev = (Audiodev *)drv_opaque;
- if (jo->c.state != QJACK_STATE_DISCONNECTED) {
- return 0;
- }
+ qjack_client_fini(&jo->c);
jo->c.out = true;
jo->c.enabled = false;
@@ -523,9 +525,7 @@ static int qjack_init_in(HWVoiceIn *hw, struct audsettings *as,
QJackIn *ji = (QJackIn *)hw;
Audiodev *dev = (Audiodev *)drv_opaque;
- if (ji->c.state != QJACK_STATE_DISCONNECTED) {
- return 0;
- }
+ qjack_client_fini(&ji->c);
ji->c.out = false;
ji->c.enabled = false;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 6/6] audio/jack: simplify the re-init code path
@ 2020-06-11 15:25 Geoffrey McRae
0 siblings, 0 replies; 3+ messages in thread
From: Geoffrey McRae @ 2020-06-11 15:25 UTC (permalink / raw)
To: qemu-devel; +Cc: kraxel
Signed-off-by: Geoffrey McRae <geoff@hostfission.com>
---
audio/jackaudio.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/audio/jackaudio.c b/audio/jackaudio.c
index b2b53985ae..72ed7c4929 100644
--- a/audio/jackaudio.c
+++ b/audio/jackaudio.c
@@ -395,6 +395,10 @@ static int qjack_client_init(QJackClient *c)
char client_name[jack_client_name_size()];
jack_options_t options = JackNullOption;
+ if (c->state == QJACK_STATE_RUNNING) {
+ return 0;
+ }
+
c->connect_ports = true;
snprintf(client_name, sizeof(client_name), "%s-%s",
@@ -485,9 +489,7 @@ static int qjack_init_out(HWVoiceOut *hw, struct audsettings *as,
QJackOut *jo = (QJackOut *)hw;
Audiodev *dev = (Audiodev *)drv_opaque;
- if (jo->c.state != QJACK_STATE_DISCONNECTED) {
- return 0;
- }
+ qjack_client_fini(&jo->c);
jo->c.out = true;
jo->c.enabled = false;
@@ -523,9 +525,7 @@ static int qjack_init_in(HWVoiceIn *hw, struct audsettings *as,
QJackIn *ji = (QJackIn *)hw;
Audiodev *dev = (Audiodev *)drv_opaque;
- if (ji->c.state != QJACK_STATE_DISCONNECTED) {
- return 0;
- }
+ qjack_client_fini(&ji->c);
ji->c.out = false;
ji->c.enabled = false;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 0/6] audio/jack: fixes to overall jack behaviour
@ 2020-06-13 4:05 Geoffrey McRae
2020-06-13 4:05 ` [PATCH 6/6] audio/jack: simplify the re-init code path Geoffrey McRae
0 siblings, 1 reply; 3+ messages in thread
From: Geoffrey McRae @ 2020-06-13 4:05 UTC (permalink / raw)
To: qemu-devel; +Cc: kraxel, geoff
This patch set addresses several issues that cause inconsistent
behaviour in the guest when the sound device is stopped and started or
the JACK server stops responding on the host.
Geoffrey McRae (6):
audio/jack: fix invalid minimum buffer size check
audio/jack: remove unused stopped state
audio/jack: remove invalid set of input support bool
audio/jack: do not remove ports when finishing
audio/jack: honour the enable state of the audio device
audio/jack: simplify the re-init code path
audio/jackaudio.c | 73 ++++++++++++++++++++++++-----------------------
1 file changed, 38 insertions(+), 35 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 6/6] audio/jack: simplify the re-init code path
2020-06-13 4:05 [PATCH 0/6] audio/jack: fixes to overall jack behaviour Geoffrey McRae
@ 2020-06-13 4:05 ` Geoffrey McRae
0 siblings, 0 replies; 3+ messages in thread
From: Geoffrey McRae @ 2020-06-13 4:05 UTC (permalink / raw)
To: qemu-devel; +Cc: kraxel, geoff
Instead of checking for the audodev state in each code path, centralize
the check into the initialize function itself to make it safe to call it
at any time.
Signed-off-by: Geoffrey McRae <geoff@hostfission.com>
---
audio/jackaudio.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/audio/jackaudio.c b/audio/jackaudio.c
index b2b53985ae..72ed7c4929 100644
--- a/audio/jackaudio.c
+++ b/audio/jackaudio.c
@@ -395,6 +395,10 @@ static int qjack_client_init(QJackClient *c)
char client_name[jack_client_name_size()];
jack_options_t options = JackNullOption;
+ if (c->state == QJACK_STATE_RUNNING) {
+ return 0;
+ }
+
c->connect_ports = true;
snprintf(client_name, sizeof(client_name), "%s-%s",
@@ -485,9 +489,7 @@ static int qjack_init_out(HWVoiceOut *hw, struct audsettings *as,
QJackOut *jo = (QJackOut *)hw;
Audiodev *dev = (Audiodev *)drv_opaque;
- if (jo->c.state != QJACK_STATE_DISCONNECTED) {
- return 0;
- }
+ qjack_client_fini(&jo->c);
jo->c.out = true;
jo->c.enabled = false;
@@ -523,9 +525,7 @@ static int qjack_init_in(HWVoiceIn *hw, struct audsettings *as,
QJackIn *ji = (QJackIn *)hw;
Audiodev *dev = (Audiodev *)drv_opaque;
- if (ji->c.state != QJACK_STATE_DISCONNECTED) {
- return 0;
- }
+ qjack_client_fini(&ji->c);
ji->c.out = false;
ji->c.enabled = false;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-06-14 4:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-11 15:25 [PATCH 6/6] audio/jack: simplify the re-init code path Geoffrey McRae
-- strict thread matches above, loose matches on Subject: below --
2020-06-11 15:25 Geoffrey McRae
2020-06-13 4:05 [PATCH 0/6] audio/jack: fixes to overall jack behaviour Geoffrey McRae
2020-06-13 4:05 ` [PATCH 6/6] audio/jack: simplify the re-init code path Geoffrey McRae
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).