aboutsummaryrefslogtreecommitdiffstats
path: root/community/pipewire/0001-Revert-pulse-tunnel-use-format-channels-and-rate-pro.patch
blob: 97d8e24b3434cae4065d35b95659078fca9e4f61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
diff --git a/src/modules/module-protocol-pulse/modules/module-tunnel-sink.c b/src/modules/module-protocol-pulse/modules/module-tunnel-sink.c
index 064c09812..134dfc601 100644
--- a/src/modules/module-protocol-pulse/modules/module-tunnel-sink.c
+++ b/src/modules/module-protocol-pulse/modules/module-tunnel-sink.c
@@ -202,15 +202,6 @@ struct module *create_module_tunnel_sink(struct impl *impl, const char *argument
 	}
 
 	audio_info_to_props(&info, stream_props);
-	if ((str = pw_properties_get(props, "format")) != NULL) {
-		uint32_t id = format_paname2id(str, strlen(str));
-		if (id == SPA_AUDIO_FORMAT_UNKNOWN) {
-			res = -EINVAL;
-			goto out;
-		}
-
-		pw_properties_set(stream_props, PW_KEY_AUDIO_FORMAT, format_id2name(id));
-	}
 
 	module = module_new(impl, sizeof(*d));
 	if (module == NULL) {
diff --git a/src/modules/module-pulse-tunnel.c b/src/modules/module-pulse-tunnel.c
index 84e969a04..203de371e 100644
--- a/src/modules/module-pulse-tunnel.c
+++ b/src/modules/module-pulse-tunnel.c
@@ -52,7 +52,6 @@
 #include <pipewire/private.h>
 
 #include <pulse/pulseaudio.h>
-#include "module-protocol-pulse/format.h"
 
 /** \page page_module_pulse_tunnel PipeWire Module: Pulse Tunnel
  */
@@ -325,6 +324,13 @@ static int create_stream(struct impl *impl)
 				&playback_stream_events, impl);
 	}
 
+	impl->info = SPA_AUDIO_INFO_RAW_INIT(
+			.format = SPA_AUDIO_FORMAT_S16,
+			.rate = 48000,
+			.channels = 2,
+			.position = { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR });
+	impl->frame_size = 2 * 2;
+
 	n_params = 0;
 	spa_pod_builder_init(&b, buffer, sizeof(buffer));
 	params[n_params++] = spa_format_audio_raw_build(&b,
@@ -538,9 +544,9 @@ static int create_pulse_stream(struct impl *impl)
 		pa_threaded_mainloop_wait(impl->pa_mainloop);
 	}
 
-	ss.format = (pa_sample_format_t) format_id2pa(impl->info.format);
-	ss.channels = impl->info.channels;
-	ss.rate = impl->info.rate;
+	ss.format = PA_SAMPLE_S16NE;
+	ss.channels = 2;
+	ss.rate = 48000;
 
 	snprintf(stream_name, sizeof(stream_name), _("Tunnel for %s@%s"),
 			pw_get_user_name(), pw_get_host_name());
@@ -862,7 +858,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
 	if ((str = pw_properties_get(props, "stream.props")) != NULL)
 		pw_properties_update_string(impl->stream_props, str, strlen(str));
 
-	copy_props(impl, props, PW_KEY_AUDIO_FORMAT);
 	copy_props(impl, props, PW_KEY_AUDIO_RATE);
 	copy_props(impl, props, PW_KEY_AUDIO_CHANNELS);
 	copy_props(impl, props, SPA_KEY_AUDIO_POSITION);