[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/12] audio/pw: add more error reporting
|
From: |
marcandre . lureau |
|
Subject: |
[PATCH 09/12] audio/pw: add more error reporting |
|
Date: |
Sat, 6 May 2023 20:37:32 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
audio/pwaudio.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/audio/pwaudio.c b/audio/pwaudio.c
index 67df53948c..5c706a9fde 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;
}
--
2.40.1
- Re: [PATCH 04/12] audio/pw: drop needless case statement, (continued)
- [PATCH 05/12] audio/pw: needless check for NULL, marcandre . lureau, 2023/05/06
- [PATCH 06/12] audio/pw: trace during init before calling pipewire API, marcandre . lureau, 2023/05/06
- [PATCH 07/12] audio/pw: add more details on error, marcandre . lureau, 2023/05/06
- [PATCH 08/12] audio/pw: factorize some common code, marcandre . lureau, 2023/05/06
- [PATCH 09/12] audio/pw: add more error reporting,
marcandre . lureau <=
- [PATCH 10/12] audio/pw: simplify error reporting in stream creation, marcandre . lureau, 2023/05/06
- [PATCH 11/12] audio/pw: remove wrong comment, marcandre . lureau, 2023/05/06
- [PATCH 12/12] audio/pw: improve channel position code, marcandre . lureau, 2023/05/06