aboutsummaryrefslogtreecommitdiff
path: root/audio/pwaudio.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-05-06 20:37:32 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-07-17 15:23:31 +0400
commit0c57a05533d12a3788739666f67b425709f4a132 (patch)
tree93888f0b6eb37b9a1934463225df38d66eed1744 /audio/pwaudio.c
parent92fd78689d0b06a00637e4e821a502b194d09328 (diff)
downloadqemu-0c57a05533d12a3788739666f67b425709f4a132.zip
qemu-0c57a05533d12a3788739666f67b425709f4a132.tar.gz
qemu-0c57a05533d12a3788739666f67b425709f4a132.tar.bz2
audio/pw: add more error reporting
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20230506163735.3481387-10-marcandre.lureau@redhat.com>
Diffstat (limited to 'audio/pwaudio.c')
-rw-r--r--audio/pwaudio.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/audio/pwaudio.c b/audio/pwaudio.c
index 70f0c46..f1c5e5d 100644
--- a/audio/pwaudio.c
+++ b/audio/pwaudio.c
@@ -429,6 +429,10 @@ create_stream(pwaudio *c, PWVoice *v, const char *stream_name,
struct pw_properties *props;
props = pw_properties_new(NULL, NULL);
+ if (!props) {
+ error_report("Failed to create PW properties: %s", g_strerror(errno));
+ return -1;
+ }
/* 75% of the timer period for faster updates */
buf_samples = (uint64_t)v->g->dev->timer_period * v->info.rate
@@ -441,8 +445,8 @@ create_stream(pwaudio *c, PWVoice *v, const char *stream_name,
pw_properties_set(props, PW_KEY_TARGET_OBJECT, name);
}
v->stream = pw_stream_new(c->core, stream_name, props);
-
if (v->stream == NULL) {
+ error_report("Failed to create PW stream: %s", g_strerror(errno));
return -1;
}
@@ -470,6 +474,7 @@ create_stream(pwaudio *c, PWVoice *v, const char *stream_name,
PW_STREAM_FLAG_MAP_BUFFERS |
PW_STREAM_FLAG_RT_PROCESS, params, n_params);
if (res < 0) {
+ error_report("Failed to connect PW stream: %s", g_strerror(errno));
pw_stream_destroy(v->stream);
return -1;
}