Hello community, here is the log from the commit of package pipewire for openSUSE:Factory checked in at 2020-04-07 10:20:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pipewire (Old) and /work/SRC/openSUSE:Factory/.pipewire.new.3248 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pipewire" Tue Apr 7 10:20:13 2020 rev:8 rq:790690 version:0.3.2 Changes: -------- --- /work/SRC/openSUSE:Factory/pipewire/pipewire.changes 2020-03-26 23:31:16.158731605 +0100 +++ /work/SRC/openSUSE:Factory/.pipewire.new.3248/pipewire.changes 2020-04-07 10:20:15.345758042 +0200 @@ -1,0 +2,51 @@ +Wed Apr 1 07:35:48 UTC 2020 - Antonio Larrosa <[email protected]> + +- Use the License rpm tag to specify that although most of + pipewire is licensed under MIT, the pulseaudio replacement + library is licensed under LGPL-2.1+. + +------------------------------------------------------------------- +Tue Mar 31 15:11:45 UTC 2020 - Antonio Larrosa <[email protected]> + +- Use gcc9 to build in SLE-15 / Leap 15, since at least gcc8 is + needed now. + +------------------------------------------------------------------- +Tue Mar 31 10:48:28 UTC 2020 - Antonio Larrosa <[email protected]> + +- Update to version 0.3.2: + + build fixes + + Added support for data type negotiation. This makes it + possible for a client to say that it can handle DMABuf + and MemFd and then let the server select a compatible + format. + + Handle errors when enumerating parameters better. + + Add support for rate, format, channels and period_bytes + to the alsa config file to restrict what alsa apps can + negotiate. + + Fix JACK midi output. + + Optimizations in common audio format conversions using + AVX2. Small optimizations to plugins. + + Change the vulkan compute example to an MIT licensed + shader. + + Remove some hardcoded defaults in the audio and video + processing and use the values from the processing + context. This also fixes the vulkan example. + + Correct the documentation and defaults in the daemon + config file. + + Fix alsa and v4l2 buffer recycle. A paused client could + cause the server to leak all buffers. + + Remove some warnings that should be ignored. + + Fix a crash in the bluez5 plugins. + + Try to select higher quality formats first when + negotiating a format with an audio device. + + Fix an infinite loop in udev detection in some cases. + + Add non-interactive mode to pw-cli. You can now just + do "pw-cli ls Port" to get a listing of all ports. + pw-cli will now also connect to the default server by + default and has options to select a different server. + + Allow the server to go up to the maximum quantum (8192 + samples or ~=180ms) if a client explicitly wants this. + + +------------------------------------------------------------------- Old: ---- pipewire-0.3.1+48.obscpio New: ---- pipewire-0.3.2.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pipewire.spec ++++++ --- /var/tmp/diff_new_pack.9eaDrl/_old 2020-04-07 10:20:16.189758980 +0200 +++ /var/tmp/diff_new_pack.9eaDrl/_new 2020-04-07 10:20:16.189758980 +0200 @@ -18,13 +18,13 @@ %define libpipewire libpipewire-0_3-0 -%define sover 0_3_1 +%define sover 0_3_2 %define apiver 0.3 %define spa_ver 0.2 %define spa_ver_str 0_2 Name: pipewire -Version: 0.3.1+48 +Version: 0.3.2 Release: 0 Summary: A Multimedia Framework designed to be an audio and video server and more License: MIT @@ -35,6 +35,9 @@ BuildRequires: doxygen BuildRequires: fdupes +%if 0%{?suse_version} <= 1500 +BuildRequires: gcc9 +%endif BuildRequires: graphviz BuildRequires: meson BuildRequires: pkgconfig @@ -85,6 +88,7 @@ %package -n %{libpipewire} Summary: A Multimedia Framework designed to be an audio and video server and more +License: MIT Group: System/Libraries %description -n %{libpipewire} @@ -102,6 +106,7 @@ %package -n libjack-pw%{sover} Summary: A Multimedia Framework designed to be an audio and video server and more +License: MIT Group: Development/Libraries/C and C++ %description -n libjack-pw%{sover} @@ -120,6 +125,7 @@ %package -n libpulse-mainloop-glib-pw%{sover} Summary: A Multimedia Framework designed to be an audio and video server and more +License: LGPL-2.1-or-later Group: Development/Libraries/C and C++ %description -n libpulse-mainloop-glib-pw%{sover} @@ -137,6 +143,7 @@ %package -n libpulse-pw%{sover} Summary: A Multimedia Framework designed to be an audio and video server and more +License: LGPL-2.1-or-later Group: Development/Libraries/C and C++ %description -n libpulse-pw%{sover} @@ -154,6 +161,7 @@ %package -n libpulse-simple-pw%{sover} Summary: A Multimedia Framework designed to be an audio and video server and more +License: LGPL-2.1-or-later Group: Development/Libraries/C and C++ %description -n libpulse-simple-pw%{sover} @@ -171,6 +179,7 @@ %package -n gstreamer-plugin-pipewire Summary: Gstreamer Plugin for PipeWire +License: MIT Group: System/Libraries %description -n gstreamer-plugin-pipewire @@ -180,6 +189,7 @@ %package tools Summary: The PipeWire Tools +License: MIT Group: Productivity/Multimedia/Other %description tools @@ -189,6 +199,7 @@ %package spa-tools Summary: The PipeWire SPA Tools +License: MIT Group: Productivity/Multimedia/Other %description spa-tools @@ -198,6 +209,7 @@ %package modules Summary: Modules For PipeWire, A Multimedia Framework +License: MIT Group: Productivity/Multimedia/Other Requires: pipewire @@ -214,6 +226,7 @@ %package spa-plugins-%{spa_ver_str} Summary: Plugins For PipeWire SPA +License: MIT Group: Productivity/Multimedia/Other Requires: pipewire @@ -238,6 +251,7 @@ %package devel Summary: Development Files For PipeWire, A Multimedia Framework +License: MIT Group: Development/Libraries/C and C++ Requires: %{libpipewire} >= %{version} @@ -248,6 +262,7 @@ %package doc Summary: PipeWire media server documentation +License: MIT Group: Development/Libraries/C and C++ %description doc @@ -260,6 +275,9 @@ %endif %build +%if %{pkg_vcmp gcc < 8} +export CC=gcc-9 +%endif %meson \ -Ddocs=true \ -Dman=true \ @@ -315,12 +333,15 @@ %{_libdir}/libjack-pw.so.* %files -n libpulse-mainloop-glib-pw%{sover} +%license pipewire-pulseaudio/LICENSE %{_libdir}/libpulse-mainloop-glib-pw.so.* %files -n libpulse-pw%{sover} +%license pipewire-pulseaudio/LICENSE %{_libdir}/libpulse-pw.so.* %files -n libpulse-simple-pw%{sover} +%license pipewire-pulseaudio/LICENSE %{_libdir}/libpulse-simple-pw.so.* %files -n gstreamer-plugin-pipewire ++++++ _service ++++++ --- /var/tmp/diff_new_pack.9eaDrl/_old 2020-04-07 10:20:16.217759011 +0200 +++ /var/tmp/diff_new_pack.9eaDrl/_new 2020-04-07 10:20:16.217759011 +0200 @@ -3,7 +3,7 @@ <service name="obs_scm" mode="disabled"> <param name="scm">git</param> <param name="url">https://gitlab.freedesktop.org/pipewire/pipewire.git</param> - <param name="revision">b8a1ea1d</param> + <param name="revision">0.3.2</param> <param name="versionformat">@PARENT_TAG@+@TAG_OFFSET@</param> <param name="versionrewrite-pattern">(.*)\+0</param> <param name="versionrewrite-replacement">\1</param> ++++++ pipewire-0.3.1+48.obscpio -> pipewire-0.3.2.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipewire-0.3.1+48/NEWS new/pipewire-0.3.2/NEWS --- old/pipewire-0.3.1+48/NEWS 2020-03-23 14:18:10.000000000 +0100 +++ new/pipewire-0.3.2/NEWS 2020-03-26 12:34:54.000000000 +0100 @@ -1,3 +1,44 @@ +PipeWire 0.3.2 + +This is a bugfix release that is API and ABI compatible +with previous 0.3.x releases. + +- build fixes +- Added support for data type negotiation. This makes it + possible for a client to say that it can handle DMABuf + and MemFd and then let the server select a compatible + format. +- Handle errors when enumerating parameters better. +- Add support for rate, format, channels and period_bytes + to the alsa config file to restrict what alsa apps can + negotiate. +- Fix JACK midi output. +- Optimizations in common audio format conversions using + AVX2. Small optimizations to plugins. +- Change the vulkan compute example to an MIT licensed + shader. +- Remove some hardcoded defaults in the audio and video + processing and use the values from the processing + context. This also fixes the vulkan example. +- Correct the documentation and defaults in the daemon + config file. +- Fix alsa and v4l2 buffer recycle. A paused client could + cause the server to leak all buffers. +- Remove some warnings that should be ignored. +- Fix a crash in the bluez5 plugins. +- Try to select higher quality formats first when + negotiating a format with an audio device. +- Fix an infinite loop in udev detection in some cases. +- Add non-interactive mode to pw-cli. You can now just + do "pw-cli ls Port" to get a listing of all ports. + pw-cli will now also connect to the default server by + default and has options to select a different server. +- Allow the server to go up to the maximum quantum (8192 + samples or ~=180ms) if a client explicitly wants this. + + +Older versions: + PipeWire 0.3.1 This is a bugfix release that is API and ABI compatible @@ -36,8 +77,6 @@ - pulseaudio: improve compatibility -Older versions: - PipeWire 0.3.0 The 0.3 release is a major milestone in the developement of diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipewire-0.3.1+48/meson.build new/pipewire-0.3.2/meson.build --- old/pipewire-0.3.1+48/meson.build 2020-03-23 14:18:10.000000000 +0100 +++ new/pipewire-0.3.2/meson.build 2020-03-26 12:34:54.000000000 +0100 @@ -1,5 +1,5 @@ project('pipewire', ['c' ], - version : '0.3.1', + version : '0.3.2', license : 'MIT', meson_version : '>= 0.50.0', default_options : [ 'warning_level=1', @@ -226,6 +226,10 @@ ? dependency('epoll-shim', required: true) : dependency('', required: false)) +alsa_dep = (get_option('pipewire-alsa') + ? dependency('alsa') + : dependency('', required: false)) + subdir('spa') subdir('src') @@ -240,7 +244,6 @@ endif if get_option('pipewire-alsa') - alsa_dep = dependency('alsa') subdir('pipewire-alsa/alsa-plugins') endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipewire-0.3.1+48/spa/plugins/alsa/alsa-udev.c new/pipewire-0.3.2/spa/plugins/alsa/alsa-udev.c --- old/pipewire-0.3.1+48/spa/plugins/alsa/alsa-udev.c 2020-03-23 14:18:10.000000000 +0100 +++ new/pipewire-0.3.2/spa/plugins/alsa/alsa-udev.c 2020-03-26 12:34:54.000000000 +0100 @@ -460,18 +460,17 @@ udev_enumerate_add_match_subsystem(enumerate, "sound"); udev_enumerate_scan_devices(enumerate); - devices = udev_enumerate_get_list_entry(enumerate); - - while (devices) { + for (devices = udev_enumerate_get_list_entry(enumerate); devices; + devices = udev_list_entry_get_next(devices)) { struct udev_device *dev; dev = udev_device_new_from_syspath(this->udev, udev_list_entry_get_name(devices)); + if (dev == NULL) + continue; emit_device(this, ACTION_ADD, true, dev); udev_device_unref(dev); - - devices = udev_list_entry_get_next(devices); } udev_enumerate_unref(enumerate); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipewire-0.3.1+48/spa/plugins/audioconvert/fmtconvert.c new/pipewire-0.3.2/spa/plugins/audioconvert/fmtconvert.c --- old/pipewire-0.3.1+48/spa/plugins/audioconvert/fmtconvert.c 2020-03-23 14:18:10.000000000 +0100 +++ new/pipewire-0.3.2/spa/plugins/audioconvert/fmtconvert.c 2020-03-26 12:34:54.000000000 +0100 @@ -363,23 +363,23 @@ spa_pod_builder_add(builder, SPA_FORMAT_AUDIO_format, SPA_POD_CHOICE_ENUM_Id(18, info.info.raw.format, - SPA_AUDIO_FORMAT_U8P, - SPA_AUDIO_FORMAT_U8, - SPA_AUDIO_FORMAT_S16P, - SPA_AUDIO_FORMAT_S16, - SPA_AUDIO_FORMAT_S16_OE, SPA_AUDIO_FORMAT_F32P, SPA_AUDIO_FORMAT_F32, SPA_AUDIO_FORMAT_F32_OE, + SPA_AUDIO_FORMAT_S24_32P, + SPA_AUDIO_FORMAT_S24_32, + SPA_AUDIO_FORMAT_S24_32_OE, SPA_AUDIO_FORMAT_S32P, SPA_AUDIO_FORMAT_S32, SPA_AUDIO_FORMAT_S32_OE, + SPA_AUDIO_FORMAT_S16P, + SPA_AUDIO_FORMAT_S16, + SPA_AUDIO_FORMAT_S16_OE, SPA_AUDIO_FORMAT_S24P, SPA_AUDIO_FORMAT_S24, SPA_AUDIO_FORMAT_S24_OE, - SPA_AUDIO_FORMAT_S24_32P, - SPA_AUDIO_FORMAT_S24_32, - SPA_AUDIO_FORMAT_S24_32_OE), + SPA_AUDIO_FORMAT_U8P, + SPA_AUDIO_FORMAT_U8), 0); } else { spa_pod_builder_add(builder, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipewire-0.3.1+48/spa/plugins/v4l2/v4l2-udev.c new/pipewire-0.3.2/spa/plugins/v4l2/v4l2-udev.c --- old/pipewire-0.3.1+48/spa/plugins/v4l2/v4l2-udev.c 2020-03-23 14:18:10.000000000 +0100 +++ new/pipewire-0.3.2/spa/plugins/v4l2/v4l2-udev.c 2020-03-26 12:34:54.000000000 +0100 @@ -338,9 +338,8 @@ udev_enumerate_add_match_subsystem(enumerate, "video4linux"); udev_enumerate_scan_devices(enumerate); - devices = udev_enumerate_get_list_entry(enumerate); - - while (devices) { + for (devices = udev_enumerate_get_list_entry(enumerate); devices; + devices = udev_list_entry_get_next(devices)) { struct udev_device *dev; uint32_t id; @@ -348,14 +347,10 @@ if (dev == NULL) continue; - if ((id = get_device_id(this, dev)) == SPA_ID_INVALID) - continue; - - emit_object_info(this, id, dev); + if ((id = get_device_id(this, dev)) != SPA_ID_INVALID) + emit_object_info(this, id, dev); udev_device_unref(dev); - - devices = udev_list_entry_get_next(devices); } udev_enumerate_unref(enumerate); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipewire-0.3.1+48/src/pipewire/context.c new/pipewire-0.3.2/src/pipewire/context.c --- old/pipewire-0.3.1+48/src/pipewire/context.c 2020-03-23 14:18:10.000000000 +0100 +++ new/pipewire-0.3.2/src/pipewire/context.c 2020-03-26 12:34:54.000000000 +0100 @@ -43,6 +43,8 @@ #define NAME "context" +#define CLOCK_MIN_QUANTUM 4u +#define CLOCK_MAX_QUANTUM 8192u #define DEFAULT_CLOCK_RATE 48000u #define DEFAULT_CLOCK_QUANTUM 1024u @@ -165,14 +167,19 @@ this->defaults.clock_quantum = get_default_int(p, "default.clock.quantum", DEFAULT_CLOCK_QUANTUM); this->defaults.clock_min_quantum = get_default_int(p, "default.clock.min-quantum", DEFAULT_CLOCK_MIN_QUANTUM); this->defaults.clock_max_quantum = get_default_int(p, "default.clock.max-quantum", DEFAULT_CLOCK_MAX_QUANTUM); - this->defaults.clock_quantum = SPA_CLAMP(this->defaults.clock_quantum, - this->defaults.clock_min_quantum, this->defaults.clock_max_quantum); this->defaults.video_size.width = get_default_int(p, "default.video.width", DEFAULT_VIDEO_WIDTH); this->defaults.video_size.height = get_default_int(p, "default.video.height", DEFAULT_VIDEO_HEIGHT); this->defaults.video_rate.num = get_default_int(p, "default.video.rate.num", DEFAULT_VIDEO_RATE_NUM); this->defaults.video_rate.denom = get_default_int(p, "default.video.rate.denom", DEFAULT_VIDEO_RATE_DENOM); this->defaults.link_max_buffers = get_default_int(p, "link.max-buffers", DEFAULT_LINK_MAX_BUFFERS); this->defaults.mem_allow_mlock = get_default_bool(p, "mem.allow-mlock", DEFAULT_MEM_ALLOW_MLOCK); + + this->defaults.clock_max_quantum = SPA_CLAMP(this->defaults.clock_max_quantum, + CLOCK_MIN_QUANTUM, CLOCK_MAX_QUANTUM); + this->defaults.clock_min_quantum = SPA_CLAMP(this->defaults.clock_min_quantum, + CLOCK_MIN_QUANTUM, this->defaults.clock_max_quantum); + this->defaults.clock_quantum = SPA_CLAMP(this->defaults.clock_quantum, + this->defaults.clock_min_quantum, this->defaults.clock_max_quantum); } /** Create a new context object @@ -790,7 +797,7 @@ * go to max but we should really only do this when in power save mode */ driver->quantum_current = SPA_CLAMP(quantum, driver->context->defaults.clock_min_quantum, - driver->context->defaults.clock_quantum); + driver->context->defaults.clock_max_quantum); return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipewire-0.3.1+48/src/pipewire/impl-node.c new/pipewire-0.3.2/src/pipewire/impl-node.c --- old/pipewire-0.3.1+48/src/pipewire/impl-node.c 2020-03-23 14:18:10.000000000 +0100 +++ new/pipewire-0.3.2/src/pipewire/impl-node.c 2020-03-26 12:34:54.000000000 +0100 @@ -747,7 +747,8 @@ quantum_size = flp2((num * node->context->defaults.clock_rate / denom)); if (quantum_size != node->quantum_size) { - pw_log_info(NAME" %p: latency '%s' quantum %d", node, str, quantum_size); + pw_log_info(NAME" %p: latency '%s' quantum %u/%u", + node, str, quantum_size, node->context->defaults.clock_rate); node->quantum_size = quantum_size; do_recalc |= node->active; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipewire-0.3.1+48/src/tools/pw-cat.c new/pipewire-0.3.2/src/tools/pw-cat.c --- old/pipewire-0.3.1+48/src/tools/pw-cat.c 2020-03-23 14:18:10.000000000 +0100 +++ new/pipewire-0.3.2/src/tools/pw-cat.c 2020-03-26 12:34:54.000000000 +0100 @@ -1169,7 +1169,7 @@ return -EINVAL; } data->latency_value = atoi(data->latency); - if (!data->latency_value) { + if (!data->latency_value && data->latency_unit != unit_none) { fprintf(stderr, "error: bad latency value %s (is zero)\n", data->latency); return -EINVAL; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipewire-0.3.1+48/src/tools/pw-cli.c new/pipewire-0.3.2/src/tools/pw-cli.c --- old/pipewire-0.3.1+48/src/tools/pw-cli.c 2020-03-23 14:18:10.000000000 +0100 +++ new/pipewire-0.3.2/src/tools/pw-cli.c 2020-03-26 12:34:54.000000000 +0100 @@ -29,6 +29,7 @@ #include <string.h> #include <ctype.h> #include <alloca.h> +#include <getopt.h> #include <spa/utils/result.h> #include <spa/debug/pod.h> @@ -51,6 +52,8 @@ struct remote_data *current; struct pw_map vars; + unsigned int interactive:1; + unsigned int monitoring:1; }; struct global { @@ -276,11 +279,13 @@ struct remote_data *rd = _data; free(rd->name); rd->name = info->name ? strdup(info->name) : NULL; - fprintf(stdout, "remote %d is named '%s'\n", rd->id, rd->name); + if (rd->data->interactive) + fprintf(stdout, "remote %d is named '%s'\n", rd->id, rd->name); } static void show_prompt(struct remote_data *rd) { + rd->data->monitoring = true; fprintf(stdout, "%s>>", rd->name); fflush(stdout); } @@ -288,9 +293,14 @@ static void on_core_done(void *_data, uint32_t id, int seq) { struct remote_data *rd = _data; + struct data *d = rd->data; - if (seq == rd->prompt_pending) - show_prompt(rd); + if (seq == rd->prompt_pending) { + if (d->interactive) + show_prompt(rd); + else + pw_main_loop_quit(d->loop); + } } static int print_global(void *obj, void *data) @@ -333,8 +343,10 @@ global->version = version; global->properties = props ? pw_properties_new_dict(props) : NULL; - fprintf(stdout, "remote %d added global: ", rd->id); - print_global(global, NULL); + if (rd->data->monitoring) { + fprintf(stdout, "remote %d added global: ", rd->id); + print_global(global, NULL); + } size = pw_map_get_size(&rd->globals); while (id > size) @@ -344,7 +356,8 @@ /* immediately bind the object always */ ret = bind_global(rd, global, &error); if (!ret) { - fprintf(stdout, "Error: \"%s\"\n", error); + if (rd->data->interactive) + fprintf(stdout, "Error: \"%s\"\n", error); free(error); } } @@ -375,8 +388,11 @@ return; } - fprintf(stdout, "remote %d removed global: ", rd->id); - print_global(global, NULL); + if (rd->data->monitoring) { + fprintf(stdout, "remote %d removed global: ", rd->id); + print_global(global, NULL); + } + destroy_global(global, rd); } @@ -434,7 +450,7 @@ struct pw_core *core; struct remote_data *rd; - n = pw_split_ip(args, WHITESPACE, 1, a); + n = args ? pw_split_ip(args, WHITESPACE, 1, a) : 0; if (n == 1) { props = pw_properties_new(PW_KEY_REMOTE_NAME, a[0], NULL); } @@ -451,7 +467,9 @@ rd->id = pw_map_insert_new(&data->vars, rd); spa_list_append(&data->remotes, &rd->link); - fprintf(stdout, "%d = @remote:%p\n", rd->id, rd->core); + if (rd->data->interactive) + fprintf(stdout, "%d = @remote:%p\n", rd->id, rd->core); + data->current = rd; pw_core_add_listener(rd->core, @@ -776,8 +794,9 @@ struct proxy_data *data = object; struct remote_data *rd = data->rd; - fprintf(stdout, "remote %d object %d param %d index %d\n", - rd->id, data->global->id, id, index); + if (rd->data->interactive) + fprintf(stdout, "remote %d object %d param %d index %d\n", + rd->id, data->global->id, id, index); if (spa_pod_is_object_type(param, SPA_TYPE_OBJECT_Format)) spa_debug_format(2, NULL, param); @@ -1183,6 +1202,8 @@ global->proxy = proxy; + rd->prompt_pending = pw_core_sync(rd->core, 0, 0); + return true; } @@ -2722,14 +2743,60 @@ pw_main_loop_quit(d->loop); } +static void show_help(struct data *data, const char *name) +{ + fprintf(stdout, "%s [options] [command]\n" + " -h, --help Show this help\n" + " -v, --version Show version\n" + " -d, --daemon Start as daemon (Default false)\n" + " -r, --remote Remote daemon name\n\n", + name); + + do_help(data, "help", "", NULL); +} + int main(int argc, char *argv[]) { struct data data = { 0 }; struct pw_loop *l; + char *opt_remote = NULL; char *error; + bool daemon = false; + static const struct option long_options[] = { + {"help", 0, NULL, 'h'}, + {"version", 0, NULL, 'v'}, + {"daemon", 0, NULL, 'd'}, + {"remote", 1, NULL, 'r'}, + {NULL, 0, NULL, 0} + }; + int c, i; pw_init(&argc, &argv); + while ((c = getopt_long(argc, argv, "hvdr:", long_options, NULL)) != -1) { + switch (c) { + case 'h': + show_help(&data, argv[0]); + return 0; + case 'v': + fprintf(stdout, "%s\n" + "Compiled with libpipewire %s\n" + "Linked with libpipewire %s\n", + argv[0], + pw_get_headers_version(), + pw_get_library_version()); + return 0; + case 'd': + daemon = true; + break; + case 'r': + opt_remote = optarg; + break; + default: + return -1; + } + } + data.loop = pw_main_loop_new(NULL); l = pw_main_loop_get_loop(data.loop); pw_loop_add_signal(l, SIGINT, do_quit, &data); @@ -2738,18 +2805,45 @@ spa_list_init(&data.remotes); pw_map_init(&data.vars, 64, 16); - data.context = pw_context_new(l, pw_properties_new(PW_KEY_CORE_DAEMON, "true", NULL), 0); + data.context = pw_context_new(l, + pw_properties_new( + PW_KEY_CORE_DAEMON, daemon ? "true" : NULL, + NULL), + 0); pw_context_load_module(data.context, "libpipewire-module-link-factory", NULL, NULL); - pw_loop_add_io(l, STDIN_FILENO, SPA_IO_IN|SPA_IO_HUP, false, do_input, &data); + do_connect(&data, "connect", opt_remote, &error); + + if (optind == argc) { + data.interactive = true; + + pw_loop_add_io(l, STDIN_FILENO, SPA_IO_IN|SPA_IO_HUP, false, do_input, &data); + + fprintf(stdout, "Welcome to PipeWire version %s. Type 'help' for usage.\n", + pw_get_library_version()); - fprintf(stdout, "Welcome to PipeWire version %s. Type 'help' for usage.\n", - pw_get_library_version()); + pw_main_loop_run(data.loop); + } else { + char buf[4096], *p, *error; + + p = buf; + for (i = optind; i < argc; i++) { + p = stpcpy(p, argv[i]); + p = stpcpy(p, " "); + } - do_connect(&data, "connect", "internal", &error); + pw_main_loop_run(data.loop); - pw_main_loop_run(data.loop); + if (!parse(&data, buf, p - buf, &error)) { + fprintf(stdout, "Error: \"%s\"\n", error); + free(error); + } + if (data.current) { + data.current->prompt_pending = pw_core_sync(data.current->core, 0, 0); + pw_main_loop_run(data.loop); + } + } pw_context_destroy(data.context); pw_main_loop_destroy(data.loop); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipewire-0.3.1+48/src/tools/pw-dot.c new/pipewire-0.3.2/src/tools/pw-dot.c --- old/pipewire-0.3.1+48/src/tools/pw-dot.c 2020-03-23 14:18:10.000000000 +0100 +++ new/pipewire-0.3.2/src/tools/pw-dot.c 2020-03-26 12:34:54.000000000 +0100 @@ -761,8 +761,7 @@ { struct data data = { 0 }; struct pw_loop *l; - struct pw_properties *props = NULL; - const char *remote_name = NULL; + const char *opt_remote = NULL; const char *dot_path = DEFAULT_DOT_PATH; static const struct option long_options[] = { {"help", 0, NULL, 'h'}, @@ -804,8 +803,8 @@ fprintf(stdout, "detail option enabled\n"); break; case 'r' : - remote_name = optarg; - fprintf(stdout, "set remote to %s\n", remote_name); + opt_remote = optarg; + fprintf(stdout, "set remote to %s\n", opt_remote); break; case 'o' : dot_path = optarg; @@ -828,10 +827,11 @@ if (data.context == NULL) return -1; - if (remote_name) - props = pw_properties_new(PW_KEY_REMOTE_NAME, remote_name, NULL); - - data.core = pw_context_connect(data.context, props, 0); + data.core = pw_context_connect(data.context, + pw_properties_new( + PW_KEY_REMOTE_NAME, opt_remote, + NULL), + 0); if (data.core == NULL) return -1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipewire-0.3.1+48/src/tools/pw-mon.c new/pipewire-0.3.2/src/tools/pw-mon.c --- old/pipewire-0.3.1+48/src/tools/pw-mon.c 2020-03-23 14:18:10.000000000 +0100 +++ new/pipewire-0.3.2/src/tools/pw-mon.c 2020-03-26 12:34:54.000000000 +0100 @@ -24,6 +24,7 @@ #include <stdio.h> #include <signal.h> +#include <getopt.h> #include <spa/utils/result.h> #include <spa/debug/pod.h> @@ -678,14 +679,51 @@ pw_main_loop_quit(d->loop); } +static void show_help(const char *name) +{ + fprintf(stdout, "%s [options]\n" + " -h, --help Show this help\n" + " -v, --version Show version\n" + " -r, --remote Remote daemon name\n", + name); +} + int main(int argc, char *argv[]) { struct data data = { 0 }; struct pw_loop *l; - struct pw_properties *props = NULL; + const char *opt_remote = NULL; + static const struct option long_options[] = { + {"help", 0, NULL, 'h'}, + {"version", 0, NULL, 'v'}, + {"remote", 1, NULL, 'r'}, + {NULL, 0, NULL, 0} + }; + int c; pw_init(&argc, &argv); + while ((c = getopt_long(argc, argv, "hvr:", long_options, NULL)) != -1) { + switch (c) { + case 'h': + show_help(argv[0]); + return 0; + case 'v': + fprintf(stdout, "%s\n" + "Compiled with libpipewire %s\n" + "Linked with libpipewire %s\n", + argv[0], + pw_get_headers_version(), + pw_get_library_version()); + return 0; + case 'r': + opt_remote = optarg; + break; + default: + return -1; + } + } + data.loop = pw_main_loop_new(NULL); if (data.loop == NULL) return -1; @@ -698,12 +736,13 @@ if (data.context == NULL) return -1; - if (argc > 1) - props = pw_properties_new(PW_KEY_REMOTE_NAME, argv[1], NULL); - spa_list_init(&data.pending_list); - data.core = pw_context_connect(data.context, props, 0); + data.core = pw_context_connect(data.context, + pw_properties_new( + PW_KEY_REMOTE_NAME, opt_remote, + NULL), + 0); if (data.core == NULL) return -1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipewire-0.3.1+48/src/tools/pw-profiler.c new/pipewire-0.3.2/src/tools/pw-profiler.c --- old/pipewire-0.3.1+48/src/tools/pw-profiler.c 2020-03-23 14:18:10.000000000 +0100 +++ new/pipewire-0.3.2/src/tools/pw-profiler.c 2020-03-26 12:34:54.000000000 +0100 @@ -24,6 +24,7 @@ #include <stdio.h> #include <signal.h> +#include <getopt.h> #include <spa/utils/result.h> #include <spa/pod/parser.h> @@ -483,7 +484,7 @@ proxy = pw_registry_bind(d->registry, id, type, PW_VERSION_PROFILER, 0); if (proxy == NULL) - goto no_mem; + goto error_proxy; fprintf(stderr, "Attaching to Profiler id:%d\n", id); d->profiler = proxy; @@ -491,8 +492,8 @@ return; -no_mem: - pw_log_error("failed to create proxy"); +error_proxy: + pw_log_error("failed to create proxy: %m"); return; } @@ -507,9 +508,9 @@ pw_log_error("error id:%u seq:%d res:%d (%s): %s", id, seq, res, spa_strerror(res), message); - if (id == 0) { + + if (id == PW_ID_CORE) pw_main_loop_quit(data->loop); - } } static void on_core_done(void *_data, uint32_t id, int seq) @@ -537,14 +538,58 @@ pw_main_loop_quit(d->loop); } +static void show_help(const char *name) +{ + fprintf(stdout, "%s [options]\n" + " -h, --help Show this help\n" + " -v, --version Show version\n" + " -r, --remote Remote daemon name\n" + " -o, --output Profiler output name (default \"%s\")\n", + name, + DEFAULT_FILENAME); +} + int main(int argc, char *argv[]) { struct data data = { 0 }; struct pw_loop *l; - struct pw_properties *props = NULL; + const char *opt_remote = NULL; + const char *opt_output = DEFAULT_FILENAME; + static const struct option long_options[] = { + {"help", 0, NULL, 'h'}, + {"version", 0, NULL, 'v'}, + {"remote", 1, NULL, 'r'}, + {"output", 1, NULL, 'o'}, + {NULL, 0, NULL, 0} + }; + int c; pw_init(&argc, &argv); + while ((c = getopt_long(argc, argv, "hvr:o:", long_options, NULL)) != -1) { + switch (c) { + case 'h': + show_help(argv[0]); + return 0; + case 'v': + fprintf(stdout, "%s\n" + "Compiled with libpipewire %s\n" + "Linked with libpipewire %s\n", + argv[0], + pw_get_headers_version(), + pw_get_library_version()); + return 0; + case 'o': + opt_output = optarg; + break; + case 'r': + opt_remote = optarg; + break; + default: + return -1; + } + } + data.loop = pw_main_loop_new(NULL); if (data.loop == NULL) { fprintf(stderr, "Can't create data loop: %m"); @@ -563,16 +608,17 @@ pw_context_load_module(data.context, PW_EXTENSION_MODULE_PROFILER, NULL, NULL); - if (argc > 1) - props = pw_properties_new(PW_KEY_REMOTE_NAME, argv[1], NULL); - - data.core = pw_context_connect(data.context, props, 0); + data.core = pw_context_connect(data.context, + pw_properties_new( + PW_KEY_REMOTE_NAME, opt_remote, + NULL), + 0); if (data.core == NULL) { fprintf(stderr, "Can't connect: %m"); return -1; } - data.filename = DEFAULT_FILENAME; + data.filename = opt_output; data.output = fopen(data.filename, "w"); if (data.output == NULL) { @@ -591,7 +637,6 @@ &data.registry_listener, ®istry_events, &data); - data.check_profiler = pw_core_sync(data.core, 0, 0); pw_main_loop_run(data.loop); ++++++ pipewire.obsinfo ++++++ --- /var/tmp/diff_new_pack.9eaDrl/_old 2020-04-07 10:20:16.493759318 +0200 +++ /var/tmp/diff_new_pack.9eaDrl/_new 2020-04-07 10:20:16.493759318 +0200 @@ -1,5 +1,5 @@ name: pipewire -version: 0.3.1+48 -mtime: 1584969490 -commit: b8a1ea1d3a4fc18b202cc625da3a496294e9ab58 +version: 0.3.2 +mtime: 1585222494 +commit: f0f3a0a66032cf693a979dae6187cac07fa353ee
