Projects
Essentials
pipewire-aptx
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 18
View file
pipewire-aptx.changes
Changed
@@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Sat Dec 3 00:09:52 UTC 2022 - Bjørn Lie <zaitor@opensuse.org> + +- Update to version 0.3.61 + +------------------------------------------------------------------- Mon Nov 21 11:36:55 UTC 2022 - Bjørn Lie <zaitor@opensuse.org> - Update to version 0.3.60
View file
pipewire-aptx.spec
Changed
@@ -7,7 +7,7 @@ %define soversion 0_2 Name: pipewire-aptx -Version: 0.3.60 +Version: 0.3.61 Release: 0 Summary: PipeWire Bluetooth aptX codec plugin License: MIT
View file
pipewire-0.3.60.tar.gz/NEWS -> pipewire-0.3.61.tar.gz/NEWS
Changed
@@ -1,3 +1,73 @@ +# PipeWire 0.3.61 (2022-11-24) + +This is a bugfix release that is API and ABI compatible with previous +0.3.x releases. + +## Highlights + - Fix a bug in audioadapter that could cause crashes when switching + bluetooth profiles. + - Fix sound in QEMU, deadbeef and openal again. + - libcamera plugin fixes, dynamic add and remove should now work with + the next wireplumber version. + - Fix a regression in pw-midiplay where the first buffer would not + play and some events would be missing. + - The network module now doesn't export other network sources + anymore. + - pulse-server now detects clients that keep underrunning for a long time + and will pause them to save power. + - Many more bugfixes and improvements. + + +## PipeWire + - Optimize away some useless graph recalculations. + - Increase alternative sample rates from 16 to 32. + - FreeBSD and musl build fixes. + - Silence some module loading errors when the error can be ignored. + - Fix initial buffer requested size for pw-stream when operating in + async mode. This also indirectly fixes the first buffer in + pw-midiplay. (#2843) + +## Modules + - Set the network property on pulse-tunnel streams so that they are + not exported anymore. (#2384) + - Filter-chain has optimized mix functions now. + +## SPA + - Handle some errors in libcamera better. + - Fix libcamera remove events. Fix the id allocation for devices. + - Fix a bug in audioadapter where it would not renegotiate after + a port reconfiguration, leading to crashes, especially when + automatically switching profiles in bluetooth. (#2764) + - Do ALSA probing in 44100Hz again. Some devices seem to fail + otherwise for some unknown reason. (#2718) + - Force playback start when the ALSA buffer is full. This fixes sound + in QEMU. (#2830) + - Support Digital 5.1 AC3 for Asus Xonar SE. + - Improve format renegotiation in audioadapter. This makes the ALSA + plugin work again for deadbeef. (#2832) + - Fix latency reporting on adapter DSP ports. + +## pulse-server + - Fix a bug where openal based applications would hang. (#2821) + - Improve zeroconf publish. Only publish on the address of the first + running server. This avoids duplicate entries for IPv4 and IPv6. + Add support for republish entries when new servers are started. + - Add a pulse.idle.timeout option (default to 5 seconds) to pause + streams that have been underrunning for this amount of time. Badly + behaving clients will then not keep the graph and device busy so + that devices can be suspended to save battery. This should give + better default behaviour with speech-dispatcher. (#2839) + +## JACK + - Add an option to configure the filter character. + - Fix connect_callbacks. It was only called once for output ports. + (#2841) + - Add option to set node.passive on jack clients. Make some quirks + for qsynth to make it suspend and fade out better. + + +Older versions: + # PipeWire 0.3.60 (2022-11-10) This is a bugfix release that is API and ABI compatible with previous @@ -143,9 +213,6 @@ - jack_port_register() and jack_port_unregister() can be called on an active client so make this thread safe. (#2652) - -Older versions: - # PipeWire 0.3.59 (2022-09-30) This is a bugfix release that is API and ABI compatible with previous
View file
pipewire-0.3.60.tar.gz/meson.build -> pipewire-0.3.61.tar.gz/meson.build
Changed
@@ -1,5 +1,5 @@ project('pipewire', 'c' , - version : '0.3.60', + version : '0.3.61', license : 'MIT', 'LGPL-2.1-or-later', 'GPL-2.0-only' , meson_version : '>= 0.59.0', default_options : 'warning_level=3',
View file
pipewire-0.3.60.tar.gz/pipewire-jack/src/pipewire-jack.c -> pipewire-0.3.61.tar.gz/pipewire-jack/src/pipewire-jack.c
Changed
@@ -404,6 +404,7 @@ int rt_max; unsigned int fix_midi_events:1; unsigned int global_buffer_size:1; + char filter_char; jack_position_t jack_position; jack_transport_state_t jack_state; @@ -2483,7 +2484,7 @@ else mix->peer_port = l->port_link.our_input; - pw_log_info("peer port %p %p %p", mix->peer_port, + pw_log_debug("peer port %p %p %p", mix->peer_port, l->port_link.our_output, l->port_link.our_input); if (!l->port_link.is_complete) { @@ -2793,12 +2794,12 @@ #define FILTER_NAME " ().:*$" #define FILTER_PORT " ().*$" -static void filter_name(char *str, const char *filter) +static void filter_name(char *str, const char *filter, char filter_char) { char *p; for (p = str; *p; p++) { if (strchr(filter, *p) != NULL) - *p = ' '; + *p = filter_char; } } @@ -2863,7 +2864,7 @@ snprintf(tmp, sizeof(tmp), "%s", str); if (c->filter_name) - filter_name(tmp, FILTER_NAME); + filter_name(tmp, FILTER_NAME, c->filter_char); ot = find_node(c, tmp); if (ot != NULL && o->node.client_id != ot->node.client_id) { @@ -2980,7 +2981,7 @@ snprintf(tmp, sizeof(tmp), "%s:%s", ot->node.name, str); if (c->filter_name) - filter_name(tmp, FILTER_PORT); + filter_name(tmp, FILTER_PORT, c->filter_char); op = find_port_by_name(c, tmp); if (op != NULL) @@ -3388,6 +3389,8 @@ pw_properties_set(client->props, PW_KEY_NODE_LATENCY, str); if ((str = getenv("PIPEWIRE_RATE")) != NULL) pw_properties_set(client->props, PW_KEY_NODE_RATE, str); + if ((str = getenv("PIPEWIRE_LINK_PASSIVE")) != NULL) + pw_properties_set(client->props, PW_KEY_NODE_PASSIVE, str); if ((str = pw_properties_get(client->props, PW_KEY_NODE_LATENCY)) != NULL) { uint32_t num, denom; @@ -3444,6 +3447,9 @@ client->merge_monitor = pw_properties_get_bool(client->props, "jack.merge-monitor", false); client->short_name = pw_properties_get_bool(client->props, "jack.short-name", false); client->filter_name = pw_properties_get_bool(client->props, "jack.filter-name", false); + client->filter_char = ' '; + if ((str = pw_properties_get(client->props, "jack.filter-char")) != NULL && str0 != '\0') + client->filter_char = str0; client->locked_process = pw_properties_get_bool(client->props, "jack.locked-process", true); client->default_as_system = pw_properties_get_bool(client->props, "jack.default-as-system", false); client->fix_midi_events = pw_properties_get_bool(client->props, "jack.fix-midi-events", true); @@ -5168,7 +5174,7 @@ itemsprops.n_items++ = SPA_DICT_ITEM_INIT(PW_KEY_LINK_INPUT_NODE, val2); itemsprops.n_items++ = SPA_DICT_ITEM_INIT(PW_KEY_LINK_INPUT_PORT, val3); itemsprops.n_items++ = SPA_DICT_ITEM_INIT(PW_KEY_OBJECT_LINGER, "true"); - if ((str = getenv("PIPEWIRE_LINK_PASSIVE")) != NULL && + if ((str = pw_properties_get(c->props, PW_KEY_NODE_PASSIVE)) != NULL && pw_properties_parse_bool(str)) itemsprops.n_items++ = SPA_DICT_ITEM_INIT(PW_KEY_LINK_PASSIVE, "true");
View file
pipewire-0.3.60.tar.gz/po/ka.po -> pipewire-0.3.61.tar.gz/po/ka.po
Changed
@@ -1,7 +1,7 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# Georgian translation for pipewire. +# Copyright (C) 2022 pipewire'S authors # This file is distributed under the same license as the pipewire package. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# Temuri Doghonadze <temuri.doghonadze@gmail.com>, 2022. # msgid "" msgstr "" @@ -9,15 +9,15 @@ "Report-Msgid-Bugs-To: https://gitlab.freedesktop.org/pipewire/pipewire/" "issues/new\n" "POT-Creation-Date: 2022-06-30 12:50+0200\n" -"PO-Revision-Date: 2022-07-25 13:11+0200\n" +"PO-Revision-Date: 2022-11-20 11:50+0100\n" "Last-Translator: Temuri Doghonadze <temuri.doghonadze@gmail.com>\n" -"Language-Team: Georgian <(nothing)>\n" +"Language-Team: \n" "Language: ka\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 3.1.1\n" +"X-Generator: Poedit 3.2\n" #: src/daemon/pipewire.c:46 #, c-format @@ -42,7 +42,7 @@ msgid "Dummy Output" msgstr "ნულოვანი გამოყვანა" -#: src/modules/module-pulse-tunnel.c:648 +#: src/modules/module-pulse-tunnel.c:662 #, c-format msgid "Tunnel for %s@%s" msgstr "გვირაბი %s@%s-სთვის" @@ -153,7 +153,7 @@ " -d, --dsd DSD რეჟიმი\n" "\n" -#: src/tools/pw-cli.c:3165 +#: src/tools/pw-cli.c:2250 #, c-format msgid "" "%s options command\n" @@ -174,8 +174,8 @@ msgid "Pro Audio" msgstr "Pro Audio" -#: spa/plugins/alsa/acp/acp.c:446 spa/plugins/alsa/acp/alsa-mixer.c:4648 -#: spa/plugins/bluez5/bluez5-device.c:1161 +#: spa/plugins/alsa/acp/acp.c:444 spa/plugins/alsa/acp/alsa-mixer.c:4648 +#: spa/plugins/bluez5/bluez5-device.c:1236 msgid "Off" msgstr "გამორთული" @@ -202,7 +202,7 @@ #: spa/plugins/alsa/acp/alsa-mixer.c:2657 #: spa/plugins/alsa/acp/alsa-mixer.c:2741 -#: spa/plugins/bluez5/bluez5-device.c:1330 +#: spa/plugins/bluez5/bluez5-device.c:1454 msgid "Microphone" msgstr "მიკროფონი" @@ -268,7 +268,7 @@ msgstr "Bass-ის გაძლიერების გარეშე" #: spa/plugins/alsa/acp/alsa-mixer.c:2672 -#: spa/plugins/bluez5/bluez5-device.c:1335 +#: spa/plugins/bluez5/bluez5-device.c:1460 msgid "Speaker" msgstr "დინამიკი" @@ -383,7 +383,7 @@ #: spa/plugins/alsa/acp/alsa-mixer.c:4484 #: spa/plugins/alsa/acp/alsa-mixer.c:4642 -#: spa/plugins/bluez5/bluez5-device.c:1320 +#: spa/plugins/bluez5/bluez5-device.c:1442 msgid "Headset" msgstr "ყურსაცვამები & მიკროფონი" @@ -507,7 +507,7 @@ msgid "%s Input" msgstr "%s შეყვანა" -#: spa/plugins/alsa/acp/alsa-util.c:1173 spa/plugins/alsa/acp/alsa-util.c:1267 +#: spa/plugins/alsa/acp/alsa-util.c:1187 spa/plugins/alsa/acp/alsa-util.c:1281 #, c-format msgid "" "snd_pcm_avail() returned a value that is exceptionally large: %lu byte (%lu " @@ -530,7 +530,7 @@ "ყველაზე ხშირად ეს ALSA-ს დრაივერის (%s) შეცდომის გამო ხდება. დაუკავშირდით " "ALSA-ის პროგრამისტებს." -#: spa/plugins/alsa/acp/alsa-util.c:1239 +#: spa/plugins/alsa/acp/alsa-util.c:1253 #, c-format msgid "" "snd_pcm_delay() returned a value that is exceptionally large: %li byte (%s" @@ -553,7 +553,7 @@ "ყველაზე ხშირად ეს ALSA-ს დრაივერის (%s) შეცდომის გამო ხდება. დაუკავშირდით " "ALSA-ის პროგრამისტებს." -#: spa/plugins/alsa/acp/alsa-util.c:1286 +#: spa/plugins/alsa/acp/alsa-util.c:1300 #, c-format msgid "" "snd_pcm_avail_delay() returned strange values: delay %lu is less than avail " @@ -566,7 +566,7 @@ "ყველაზე ხშირად ეს ALSA-ს დრაივერის (%s) შეცდომის გამო ხდება. დაუკავშირდით " "ALSA-ის პროგრამისტებს." -#: spa/plugins/alsa/acp/alsa-util.c:1329 +#: spa/plugins/alsa/acp/alsa-util.c:1343 #, c-format msgid "" "snd_pcm_mmap_begin() returned a value that is exceptionally large: %lu byte " @@ -601,61 +601,92 @@ msgid "Modem" msgstr "მოდემი" -#: spa/plugins/bluez5/bluez5-device.c:1172 +#: spa/plugins/bluez5/bluez5-device.c:1247 msgid "Audio Gateway (A2DP Source & HSP/HFP AG)" msgstr "Audio Gateway (A2DP წყარო & HSP/HFP AG)" -#: spa/plugins/bluez5/bluez5-device.c:1197 +#: spa/plugins/bluez5/bluez5-device.c:1272 #, c-format msgid "High Fidelity Playback (A2DP Sink, codec %s)" msgstr "მაღალი ხარისხის ხმა (A2DP Sink, კოდეკი %s)" -#: spa/plugins/bluez5/bluez5-device.c:1200 +#: spa/plugins/bluez5/bluez5-device.c:1275 #, c-format msgid "High Fidelity Duplex (A2DP Source/Sink, codec %s)" msgstr "მაღალი ხარისხის დუპლექსი (A2DP წყარო/Sink, კოდეკი %s)" -#: spa/plugins/bluez5/bluez5-device.c:1208 +#: spa/plugins/bluez5/bluez5-device.c:1283 msgid "High Fidelity Playback (A2DP Sink)" msgstr "მაღალი ხარისხის ხმა (A2DP Sink)" -#: spa/plugins/bluez5/bluez5-device.c:1210 +#: spa/plugins/bluez5/bluez5-device.c:1285 msgid "High Fidelity Duplex (A2DP Source/Sink)" msgstr "მაღალი ხარისხის დუპლექსი(A2DP წყარო/Sink)" -#: spa/plugins/bluez5/bluez5-device.c:1238 +#: spa/plugins/bluez5/bluez5-device.c:1322 +#, c-format +msgid "High Fidelity Playback (BAP Sink, codec %s)" +msgstr "მაღალი ხარისხის დაკვრა (BAP Sink, კოდეკი %s)" + +#: spa/plugins/bluez5/bluez5-device.c:1326 +#, c-format +msgid "High Fidelity Input (BAP Source, codec %s)" +msgstr "მაღალი ხარისხის შეყვანა (BAP წყარო, კოდეკი %s)" + +#: spa/plugins/bluez5/bluez5-device.c:1330 +#, c-format +msgid "High Fidelity Duplex (BAP Source/Sink, codec %s)" +msgstr "მაღალი ხარისხის დუპლექსი (BAP წყარო/Sink, კოდეკი %s)" + +#: spa/plugins/bluez5/bluez5-device.c:1359 #, c-format msgid "Headset Head Unit (HSP/HFP, codec %s)" msgstr "Headset Head Unit (HSP/HFP, კოდეკი %s)" -#: spa/plugins/bluez5/bluez5-device.c:1243 +#: spa/plugins/bluez5/bluez5-device.c:1364 msgid "Headset Head Unit (HSP/HFP)" msgstr "Headset Head Unit (HSP/HFP)" -#: spa/plugins/bluez5/bluez5-device.c:1325 +#: spa/plugins/bluez5/bluez5-device.c:1443 +#: spa/plugins/bluez5/bluez5-device.c:1448 +#: spa/plugins/bluez5/bluez5-device.c:1455 +#: spa/plugins/bluez5/bluez5-device.c:1461 +#: spa/plugins/bluez5/bluez5-device.c:1467 +#: spa/plugins/bluez5/bluez5-device.c:1473 +#: spa/plugins/bluez5/bluez5-device.c:1479 +#: spa/plugins/bluez5/bluez5-device.c:1485 +#: spa/plugins/bluez5/bluez5-device.c:1491 msgid "Handsfree" msgstr "ხელის გარეშე სამართავი" -#: spa/plugins/bluez5/bluez5-device.c:1340 +#: spa/plugins/bluez5/bluez5-device.c:1449 +msgid "Handsfree (HFP)" +msgstr "ხელის გარეშე სამართავი (HFP)" + +#: spa/plugins/bluez5/bluez5-device.c:1466 msgid "Headphone" msgstr "ყურსაცვამი"
View file
pipewire-0.3.60.tar.gz/spa/plugins/alsa/acp/acp.c -> pipewire-0.3.61.tar.gz/spa/plugins/alsa/acp/acp.c
Changed
@@ -34,6 +34,8 @@ struct spa_i18n *acp_i18n; +#define DEFAULT_RATE 44100 + #define VOLUME_ACCURACY (PA_VOLUME_NORM/100) /* don't require volume adjustments to be perfectly correct. don't necessarily extend granularity in software unless the differences get greater than this level */ static const uint32_t channel_tablePA_CHANNEL_POSITION_MAX = { @@ -312,7 +314,7 @@ snd_pcm_uframes_t try_period_size, try_buffer_size; ss.format = PA_SAMPLE_S32LE; - ss.rate = 48000; + ss.rate = DEFAULT_RATE; ss.channels = 64; ap = pa_xnew0(pa_alsa_profile, 1); @@ -1571,7 +1573,7 @@ } impl->ucm.default_sample_spec.format = PA_SAMPLE_S16NE; - impl->ucm.default_sample_spec.rate = 48000; + impl->ucm.default_sample_spec.rate = DEFAULT_RATE; impl->ucm.default_sample_spec.channels = 2; pa_channel_map_init_extend(&impl->ucm.default_channel_map, impl->ucm.default_sample_spec.channels, PA_CHANNEL_MAP_ALSA);
View file
pipewire-0.3.60.tar.gz/spa/plugins/alsa/alsa-pcm.c -> pipewire-0.3.61.tar.gz/spa/plugins/alsa/alsa-pcm.c
Changed
@@ -2128,7 +2128,7 @@ state->sample_count += total_written; - if (SPA_UNLIKELY(!state->alsa_started && total_written > 0)) + if (SPA_UNLIKELY(!state->alsa_started && (total_written > 0 || frames == 0))) do_start(state); return 0;
View file
pipewire-0.3.60.tar.gz/spa/plugins/alsa/mixer/profile-sets/asus-xonar-se.conf -> pipewire-0.3.61.tar.gz/spa/plugins/alsa/mixer/profile-sets/asus-xonar-se.conf
Changed
@@ -76,4 +76,18 @@ device-strings = iec958:%f channel-map = left,right paths-output = iec958-stereo-output -priority = 5 \ No newline at end of file +priority = 5 + +Mapping iec958-ac3-surround-40 +device-strings = a52:%f +channel-map = front-left,front-right,rear-left,rear-right +paths-output = iec958-stereo-output +priority = 2 +direction = output + +Mapping iec958-ac3-surround-51 +device-strings = a52:%f +channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe +paths-output = iec958-stereo-output +priority = 3 +direction = output
View file
pipewire-0.3.60.tar.gz/spa/plugins/audioconvert/audioadapter.c -> pipewire-0.3.61.tar.gz/spa/plugins/audioconvert/audioadapter.c
Changed
@@ -438,6 +438,9 @@ { int res; + if (format == NULL && !this->have_format) + return 0; + spa_log_debug(this->log, "%p: configure format:", this); if (format && spa_log_level_enabled(this->log, SPA_LOG_LEVEL_DEBUG)) spa_debug_format(0, NULL, format); @@ -894,10 +897,11 @@ (this->paramsidx.flags & SPA_PARAM_INFO_SERIAL) | (info->paramsi.flags & SPA_PARAM_INFO_READWRITE); - if (!this->add_listener) { - this->paramsidx.user++; - spa_log_debug(this->log, "param %d changed", info->paramsi.id); - } + if (this->add_listener) + continue; + + this->paramsidx.user++; + spa_log_debug(this->log, "param %d changed", info->paramsi.id); } } emit_node_info(this, false); @@ -1002,10 +1006,11 @@ (this->paramsidx.flags & SPA_PARAM_INFO_SERIAL) | (info->paramsi.flags & SPA_PARAM_INFO_READWRITE); - if (!this->add_listener) { - this->paramsidx.user++; - spa_log_debug(this->log, "param %d changed", info->paramsi.id); - } + if (this->add_listener) + continue; + + this->paramsidx.user++; + spa_log_debug(this->log, "param %d changed", info->paramsi.id); } } emit_node_info(this, false); @@ -1082,26 +1087,32 @@ default: continue; } + if (!this->add_listener && this->follower_params_flagsidx == info->paramsi.flags) continue; + this->info.change_mask |= SPA_NODE_CHANGE_MASK_PARAMS; this->follower_params_flagsidx = info->paramsi.flags; this->paramsidx.flags = (this->paramsidx.flags & SPA_PARAM_INFO_SERIAL) | (info->paramsi.flags & SPA_PARAM_INFO_READWRITE); + if (this->add_listener) + continue; + if (idx == IDX_Latency) { res = recalc_latency(this, direction, port_id); spa_log_debug(this->log, "latency: %d (%s)", res, spa_strerror(res)); } - - this->info.change_mask |= SPA_NODE_CHANGE_MASK_PARAMS; - if (!this->add_listener) { - this->paramsidx.user++; - spa_log_debug(this->log, "param %d changed", info->paramsi.id); + if (idx == IDX_EnumFormat) { + spa_log_debug(this->log, "new formats"); + configure_format(this, 0, NULL); } + + this->paramsidx.user++; + spa_log_debug(this->log, "param %d changed", info->paramsi.id); } } emit_node_info(this, false);
View file
pipewire-0.3.60.tar.gz/spa/plugins/audioconvert/audioconvert.c -> pipewire-0.3.61.tar.gz/spa/plugins/audioconvert/audioconvert.c
Changed
@@ -979,6 +979,7 @@ } this->monitor = monitor; + this->setup = false; dir->control = control; dir->have_profile = true; dir->mode = mode; @@ -1645,7 +1646,6 @@ struct spa_pod_builder *builder) { struct impl *this = object; - struct port *port = GET_PORT(this, direction, port_id); switch (index) { case 0: @@ -1659,11 +1659,7 @@ SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_application), SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_control)); - } else if (port->have_format) { - *param = spa_format_audio_raw_build(builder, - SPA_PARAM_EnumFormat, &this->dirdirection.format.info.raw); - } - else { + } else { uint32_t rate = this->io_position ? this->io_position->clock.rate.denom : DEFAULT_RATE; @@ -1873,7 +1869,7 @@ const struct spa_pod *latency) { struct impl *this = object; - struct port *port; + struct port *port, *oport; enum spa_direction other = SPA_DIRECTION_REVERSE(direction); uint32_t i; @@ -1895,10 +1891,10 @@ } for (i = 0; i < this->dirother.n_ports; i++) { - port = GET_PORT(this, other, i); - port->info.change_mask |= SPA_PORT_CHANGE_MASK_PARAMS; - port->paramsIDX_Latency.user++; - emit_port_info(this, port, false); + oport = GET_PORT(this, other, i); + oport->info.change_mask |= SPA_PORT_CHANGE_MASK_PARAMS; + oport->paramsIDX_Latency.user++; + emit_port_info(this, oport, false); } port->info.change_mask |= SPA_PORT_CHANGE_MASK_PARAMS; port->paramsIDX_Latency.user++; @@ -1988,6 +1984,7 @@ } this->dirdirection.format = info; this->dirdirection.have_format = true; + this->setup = false; } port->format = info; port->have_format = true;
View file
pipewire-0.3.60.tar.gz/spa/plugins/audioconvert/resample-native-impl.h -> pipewire-0.3.61.tar.gz/spa/plugins/audioconvert/resample-native-impl.h
Changed
@@ -94,6 +94,14 @@ *out_len = ooffs; \ } +#define INC(index,phase,n_phases) \ + index += inc; \ + phase += frac; \ + if (phase >= n_phases) { \ + phase -= n_phases; \ + index += 1; \ + } + #define MAKE_RESAMPLER_FULL(arch) \ DEFINE_RESAMPLER(full,arch) \ { \ @@ -114,17 +122,10 @@ phase = data->phase; \ \ for (o = ooffs; o < olen && index + n_taps <= ilen; o++) { \ - const float *ip, *taps; \ - \ - ip = &sindex; \ - taps = &data->filterphase * stride; \ - index += inc; \ - phase += frac; \ - if (phase >= n_phases) { \ - phase -= n_phases; \ - index += 1; \ - } \ - inner_product_##arch(&do, ip, taps, n_taps); \ + inner_product_##arch(&do, &sindex, \ + &data->filterphase * stride, \ + n_taps); \ + INC(index, phase, n_phases); \ } \ } \ *in_len = index; \ @@ -153,24 +154,13 @@ phase = data->phase; \ \ for (o = ooffs; o < olen && index + n_taps <= ilen; o++) { \ - const float *ip, *t0, *t1; \ - float ph, x; \ - uint32_t offset; \ - \ - ip = &sindex; \ - ph = (float)phase * n_phases / out_rate; \ - offset = floor(ph); \ - x = ph - (float)offset; \ - \ - t0 = &data->filter(offset + 0) * stride; \ - t1 = &data->filter(offset + 1) * stride; \ - index += inc; \ - phase += frac; \ - if (phase >= out_rate) { \ - phase -= out_rate; \ - index += 1; \ - } \ - inner_product_ip_##arch(&do, ip, t0, t1, x, n_taps); \ + float ph = (float)phase * n_phases / out_rate; \ + uint32_t offset = floorf(ph); \ + inner_product_ip_##arch(&do, &sindex, \ + &data->filter(offset + 0) * stride, \ + &data->filter(offset + 1) * stride, \ + ph - offset, n_taps); \ + INC(index, phase, out_rate); \ } \ } \ *in_len = index; \
View file
pipewire-0.3.60.tar.gz/spa/plugins/audioconvert/test-channelmix.c -> pipewire-0.3.61.tar.gz/spa/plugins/audioconvert/test-channelmix.c
Changed
@@ -269,9 +269,19 @@ 0.0, 1.0, 0.707107, 0.0, 0.0, 0.707107, 0.0, 0.707107)); } +static void check_samples(float **s1, float **s2, uint32_t n_s, uint32_t n_samples) +{ + uint32_t i, j; + for (i = 0; i < n_s; i++) { + for (j = 0; j < n_samples; j++) { + spa_assert_se(CLOSE_ENOUGH(s1ij, s2ij)); + } + } +} + static void run_n_m_impl(struct channelmix *mix, const void **src, uint32_t n_samples) { - uint32_t dst_chan = mix->dst_chan, i, j; + uint32_t dst_chan = mix->dst_chan, i; float dst_c_datadst_chann_samples; float dst_x_datadst_chann_samples; void *dst_cdst_chan, *dst_xdst_chan; @@ -283,14 +293,13 @@ channelmix_f32_n_m_c(mix, dst_c, src, n_samples); + channelmix_f32_n_m_c(mix, dst_x, src, n_samples); + check_samples((float**)dst_c, (float**)dst_x, dst_chan, n_samples); + #if defined(HAVE_SSE) if (cpu_flags & SPA_CPU_FLAG_SSE) { channelmix_f32_n_m_sse(mix, dst_x, src, n_samples); - for (i = 0; i < mix->dst_chan; i++) { - for (j = 0; j < n_samples; j++) { - spa_assert_se(CLOSE_ENOUGH(dst_c_dataij, dst_x_dataij)); - } - } + check_samples((float**)dst_c, (float**)dst_x, dst_chan, n_samples); } #endif }
View file
pipewire-0.3.60.tar.gz/spa/plugins/bluez5/backend-native.c -> pipewire-0.3.61.tar.gz/spa/plugins/bluez5/backend-native.c
Changed
@@ -1111,10 +1111,10 @@ return true; } } else if (spa_strstartswith(buf, "ATD")) { - char number30; + char number31, sep; enum cmee_error error; - if (sscanf(buf, "ATD%30s;", number) != 1) { + if (sscanf(buf, "ATD%30^;%c", number, &sep) != 2 || sep != ';') { spa_log_debug(backend->log, "Failed to parse ATD: \"%s\"", buf); rfcomm_send_error(rfcomm, CMEE_AG_FAILURE); return true;
View file
pipewire-0.3.60.tar.gz/spa/plugins/bluez5/bap-codec-lc3.c -> pipewire-0.3.61.tar.gz/spa/plugins/bluez5/bap-codec-lc3.c
Changed
@@ -24,7 +24,6 @@ * DEALINGS IN THE SOFTWARE. */ -#include <bits/stdint-uintn.h> #include <string.h> #include <unistd.h> #include <stddef.h>
View file
pipewire-0.3.60.tar.gz/spa/plugins/bluez5/modemmanager.c -> pipewire-0.3.61.tar.gz/spa/plugins/bluez5/modemmanager.c
Changed
@@ -1023,35 +1023,25 @@ dbus_message_iter_close_container(dict, &dict_entry_it); } +static inline bool is_valid_dial_string_char(char c) +{ + return ('0' <= c && c <= '9') + || ('A' <= c && c <= 'C') + || c == '*' + || c == '#' + || c == '+'; +} + bool mm_do_call(void *modemmanager, const char* number, void *user_data, enum cmee_error *error) { struct impl *this = modemmanager; - unsigned int k, j; - char *number_filtered; struct dbus_cmd_data *data; DBusMessage *m; DBusMessageIter iter, dict; - /* Filter extracted number from invalid characters - * Allowed characters: 0-9, *, #, +, A-C - */ - k=0; - number_filtered = calloc(1, 30); - for (j=0; j < 30; j++) { - if ((numberj >= '0' && numberj <= '9') - || (numberj == '*') - || (numberj == '#') - || (numberj == '+') - || (numberj >= 'A' && numberj <= 'C')) { - number_filteredk = numberj; - k++; - } - /* ATD commands ends with ';' */ - else if (numberj == ';') - break; - /* Send error for invalid characters */ - else { - spa_log_warn(this->log, "Call creation canceled, invalid character found in dial string: %c", numberj); + for (size_t i = 0; numberi; i++) { + if (!is_valid_dial_string_char(numberi)) { + spa_log_warn(this->log, "Call creation canceled, invalid character found in dial string: %c", numberi); if (error) *error = CMEE_INVALID_CHARACTERS_DIAL_STRING; return false; @@ -1075,7 +1065,7 @@ } dbus_message_iter_init_append(m, &iter); dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "{sv}", &dict); - append_basic_variant_dict_entry(&dict, "number", DBUS_TYPE_STRING, "s", &number_filtered); + append_basic_variant_dict_entry(&dict, "number", DBUS_TYPE_STRING, "s", &number); dbus_message_iter_close_container(&iter, &dict); if (!mm_dbus_connection_send_with_reply(this, m, &this->voice_pending, mm_get_call_create_reply, data)) { spa_log_error(this->log, "dbus call failure");
View file
pipewire-0.3.60.tar.gz/spa/plugins/libcamera/libcamera-client.c -> pipewire-0.3.61.tar.gz/spa/plugins/libcamera/libcamera-client.c
Changed
@@ -77,8 +77,8 @@ itemsn_items++ = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_API, "libcamera"); itemsn_items++ = SPA_DICT_ITEM_INIT(SPA_KEY_MEDIA_CLASS, "Video/Device"); - info.props = &SPA_DICT_INIT(items, n_items); - spa_device_emit_object_info(&this->hooks, id, &info); + info.props = &SPA_DICT_INIT(items, n_items); + spa_device_emit_object_info(&this->hooks, id, &info); return 1; } @@ -112,18 +112,18 @@ const struct spa_device_events *events, void *data) { struct impl *this = object; - struct spa_hook_list save; + struct spa_hook_list save; spa_return_val_if_fail(this != NULL, -EINVAL); spa_return_val_if_fail(events != NULL, -EINVAL); - spa_hook_list_isolate(&this->hooks, &save, listener, events, data); + spa_hook_list_isolate(&this->hooks, &save, listener, events, data); emit_device_info(this, true); emit_object_info(this, 0); - spa_hook_list_join(&this->hooks, &save); + spa_hook_list_join(&this->hooks, &save); listener->removed = impl_hook_removed; listener->priv = this;
View file
pipewire-0.3.60.tar.gz/spa/plugins/libcamera/libcamera-manager.cpp -> pipewire-0.3.61.tar.gz/spa/plugins/libcamera/libcamera-manager.cpp
Changed
@@ -117,6 +117,13 @@ return manager; } +static uint32_t get_free_id(struct impl *impl) +{ + for (std::size_t i = 0; i < MAX_DEVICES; i++) + if (impl->devicesi.camera == nullptr) + return i; + return 0; +} static struct device *add_device(struct impl *impl, std::shared_ptr<Camera> camera) { @@ -125,10 +132,11 @@ if (impl->n_devices >= MAX_DEVICES) return NULL; - id = impl->n_devices++; + id = get_free_id(impl);; device = &impl->devicesid; - device->id = id; + device->id = get_free_id(impl);; device->camera = std::move(camera); + impl->n_devices++; return device; } @@ -144,8 +152,10 @@ static void remove_device(struct impl *impl, struct device *device) { + uint32_t old = --impl->n_devices; device->camera.reset(); - *device = std::move(impl->devices--impl->n_devices); + *device = std::move(impl->devicesold); + impl->devicesold.camera = nullptr; } static void clear_devices(struct impl *impl) @@ -196,7 +206,8 @@ if ((device = add_device(impl, std::move(camera))) == NULL) return; - spa_log_info(impl->log, "camera added: %s", device->camera->id().c_str()); + spa_log_info(impl->log, "camera added: id:%d %s", device->id, + device->camera->id().c_str()); emit_object_info(impl, device); } @@ -207,7 +218,9 @@ if ((device = find_device(impl, camera)) == NULL) return; - spa_log_info(impl->log, "camera removed: %s", device->camera->id().c_str()); + spa_log_info(impl->log, "camera removed: id:%d %s", device->id, + device->camera->id().c_str()); + spa_device_emit_object_info(&impl->hooks, device->id, NULL); remove_device(impl, device); }
View file
pipewire-0.3.60.tar.gz/spa/plugins/libcamera/libcamera-source.cpp -> pipewire-0.3.61.tar.gz/spa/plugins/libcamera/libcamera-source.cpp
Changed
@@ -833,15 +833,9 @@ return res; } -static void set_control(struct impl *impl, struct port *port, uint32_t control_id, float value) -{ - spa_log_error(impl->log, "Failed to set control"); -} - static int process_control(struct impl *impl, struct spa_pod_sequence *control) { struct spa_pod_control *c; - struct port *port; SPA_POD_SEQUENCE_FOREACH(control, c) { switch (c->type) { @@ -851,9 +845,7 @@ struct spa_pod_object *obj = (struct spa_pod_object *) &c->value; SPA_POD_OBJECT_FOREACH(obj, prop) { - port = GET_OUT_PORT(impl, 0); - set_control(impl, port, prop->key, - SPA_POD_VALUE(struct spa_pod_float, &prop->value)); + spa_libcamera_set_control(impl, prop); } break; }
View file
pipewire-0.3.60.tar.gz/spa/plugins/libcamera/libcamera-utils.cpp -> pipewire-0.3.61.tar.gz/spa/plugins/libcamera/libcamera-utils.cpp
Changed
@@ -857,11 +857,11 @@ spa_log_info(impl->log, "starting camera %s", impl->device_id.c_str()); if ((res = impl->camera->start()) < 0) - return res == -EACCES ? -EBUSY : res; + goto error; for (Request *req : impl->pendingRequests) { if ((res = impl->camera->queueRequest(req)) < 0) - return res == -EACCES ? -EBUSY : res; + goto error_stop; } impl->pendingRequests.clear(); @@ -872,13 +872,20 @@ impl->source.rmask = 0; if (impl->source.fd < 0) { spa_log_error(impl->log, "Failed to create eventfd: %s", spa_strerror(impl->source.fd)); - return impl->source.fd; + res = impl->source.fd; + goto error_stop; } spa_loop_add_source(impl->data_loop, &impl->source); impl->active = true; return 0; + +error_stop: + impl->camera->stop(); +error: + impl->camera->requestCompleted.disconnect(impl, &impl::requestComplete); + return res == -EACCES ? -EBUSY : res; } static int do_remove_source(struct spa_loop *loop,
View file
pipewire-0.3.60.tar.gz/spa/plugins/v4l2/v4l2-source.c -> pipewire-0.3.61.tar.gz/spa/plugins/v4l2/v4l2-source.c
Changed
@@ -325,7 +325,6 @@ struct props *p = &this->props; struct spa_pod_object *obj = (struct spa_pod_object *) param; struct spa_pod_prop *prop; - int res = 0; if (param == NULL) { reset_props(p); @@ -339,11 +338,9 @@ sizeof(p->device)-1); break; default: - res = spa_v4l2_set_control(this, prop->key, prop); + spa_v4l2_set_control(this, prop->key, prop); break; } - if (res < 0) - return res; } break; @@ -825,45 +822,9 @@ return res; } -static uint32_t prop_to_control_id(uint32_t prop) -{ - switch (prop) { - case SPA_PROP_brightness: - return V4L2_CID_BRIGHTNESS; - case SPA_PROP_contrast: - return V4L2_CID_CONTRAST; - case SPA_PROP_saturation: - return V4L2_CID_SATURATION; - case SPA_PROP_hue: - return V4L2_CID_HUE; - case SPA_PROP_gamma: - return V4L2_CID_GAMMA; - case SPA_PROP_exposure: - return V4L2_CID_EXPOSURE; - case SPA_PROP_gain: - return V4L2_CID_GAIN; - case SPA_PROP_sharpness: - return V4L2_CID_SHARPNESS; - default: - return 0; - } -} - -static void set_control(struct impl *this, struct port *port, uint32_t control_id, float value) -{ - struct v4l2_control c; - - spa_zero(c); - c.id = control_id; - c.value = value; - if (ioctl(port->dev.fd, VIDIOC_S_CTRL, &c) < 0) - spa_log_error(this->log, "VIDIOC_S_CTRL %m"); -} - static int process_control(struct impl *this, struct spa_pod_sequence *control) { struct spa_pod_control *c; - struct port *port; SPA_POD_SEQUENCE_FOREACH(control, c) { switch (c->type) { @@ -873,14 +834,7 @@ struct spa_pod_object *obj = (struct spa_pod_object *) &c->value; SPA_POD_OBJECT_FOREACH(obj, prop) { - uint32_t control_id; - - if ((control_id = prop_to_control_id(prop->key)) == 0) - continue; - - port = GET_OUT_PORT(this, 0); - set_control(this, port, control_id, - SPA_POD_VALUE(struct spa_pod_float, &prop->value)); + spa_v4l2_set_control(this, prop->key, prop); } break; }
View file
pipewire-0.3.60.tar.gz/spa/plugins/v4l2/v4l2-utils.c -> pipewire-0.3.61.tar.gz/spa/plugins/v4l2/v4l2-utils.c
Changed
@@ -56,7 +56,7 @@ return -EIO; } - spa_log_info(dev->log, "Playback device is '%s'", path); + spa_log_info(dev->log, "device is '%s'", path); dev->fd = open(path, O_RDWR | O_NONBLOCK, 0); if (dev->fd == -1) { @@ -84,6 +84,7 @@ spa_log_error(dev->log, "'%s' QUERYCAP: %m", path); goto error_close; } + snprintf(dev->path, sizeof(dev->path), "%s", path); return 0; error_close: @@ -109,7 +110,7 @@ if (dev->active || dev->have_format) return 0; - spa_log_info(dev->log, "close"); + spa_log_info(dev->log, "close '%s'", dev->path); if (close(dev->fd)) spa_log_warn(dev->log, "close: %m"); @@ -972,7 +973,7 @@ return match ? 0 : 1; spa_log_info(this->log, "'%s' got %.4s %dx%d %d/%d", - this->props.device, (char *)&fmt.fmt.pix.pixelformat, + dev->path, (char *)&fmt.fmt.pix.pixelformat, fmt.fmt.pix.width, fmt.fmt.pix.height, streamparm.parm.capture.timeperframe.denominator, streamparm.parm.capture.timeperframe.numerator); @@ -1610,7 +1611,7 @@ } spa_v4l2_buffer_recycle(this, i); } - spa_log_info(this->log, "have %u buffers using %s", n_buffers, + spa_log_info(this->log, "%s: have %u buffers using %s", dev->path, n_buffers, use_expbuf ? "EXPBUF" : "MMAP"); port->n_buffers = n_buffers;
View file
pipewire-0.3.60.tar.gz/spa/plugins/v4l2/v4l2.h -> pipewire-0.3.61.tar.gz/spa/plugins/v4l2/v4l2.h
Changed
@@ -41,6 +41,7 @@ struct v4l2_capability cap; unsigned int active:1; unsigned int have_format:1; + char path64; }; int spa_v4l2_open(struct spa_v4l2_device *dev, const char *path);
View file
pipewire-0.3.60.tar.gz/src/daemon/jack.conf.in -> pipewire-0.3.61.tar.gz/src/daemon/jack.conf.in
Changed
@@ -73,6 +73,7 @@ #jack.merge-monitor = false #jack.short-name = false #jack.filter-name = false + #jack.filter-char = " " # # allow: Don't restrict self connect requests # fail-external: Fail self connect requests to external ports only @@ -103,15 +104,22 @@ } } } - { - matches = - { - application.process.binary = "jack_bufsize" + { matches = + { application.process.binary = "jack_bufsize" } + + actions = { + update-props = { + jack.global-buffer-size = true # quantum set globally using metadata } + } + } + { matches = + { application.process.binary = "qsynth" } actions = { update-props = { - jack.global-buffer-size = true + node.pause-on-idle = false # makes audio fade out when idle + node.passive = true # makes the sink and qsynth suspend } } }
View file
pipewire-0.3.60.tar.gz/src/daemon/pipewire-pulse.conf.in -> pipewire-0.3.61.tar.gz/src/daemon/pipewire-pulse.conf.in
Changed
@@ -90,6 +90,7 @@ #pulse.default.frag = 96000/48000 # 2 seconds #pulse.default.tlength = 96000/48000 # 2 seconds #pulse.min.quantum = 256/48000 # 5ms + #pulse.idle.timeout = 5 # pause after 5s of underruns #pulse.default.format = F32 #pulse.default.position = FL FR # These overrides are only applied when running in a vm. @@ -141,6 +142,7 @@ update-props = { pulse.min.req = 1024/48000 # 21ms pulse.min.quantum = 1024/48000 # 21ms + #pulse.idle.timeout = 0 } } }
View file
pipewire-0.3.60.tar.gz/src/examples/audio-capture.c -> pipewire-0.3.61.tar.gz/src/examples/audio-capture.c
Changed
@@ -42,6 +42,7 @@ struct pw_stream *stream; struct spa_audio_info format; + unsigned move:1; }; /* our data processing function is in general: @@ -73,6 +74,9 @@ n_channels = data->format.info.raw.channels; n_samples = buf->datas0.chunk->size / sizeof(float); + /* move cursor up */ + if (data->move) + fprintf(stdout, "%c%dA", 0x1b, n_channels + 1); fprintf(stdout, "captured %d samples\n", n_samples / n_channels); for (c = 0; c < data->format.info.raw.channels; c++) { max = 0.0f; @@ -84,8 +88,7 @@ fprintf(stdout, "channel %d: |%*s%*s| peak:%f\n", c, peak+1, "*", 40 - peak, "", max); } - /* move cursor up */ - fprintf(stdout, "%c%dA", 0x1b, n_channels + 1); + data->move = true; fflush(stdout); pw_stream_queue_buffer(data->stream, b);
View file
pipewire-0.3.60.tar.gz/src/modules/meson.build -> pipewire-0.3.61.tar.gz/src/modules/meson.build
Changed
@@ -61,33 +61,36 @@ simd_dependencies = if have_sse - pffft_sse = static_library('pffft_sse', - 'module-filter-chain/pffft.c' , + filter_chain_sse = static_library('filter_chain_sse', + 'module-filter-chain/pffft.c', + 'module-filter-chain/dsp-ops-sse.c' , c_args : sse_args, '-O3', '-DHAVE_SSE', dependencies : spa_dep , install : false ) simd_cargs += '-DHAVE_SSE' - simd_dependencies += pffft_sse + simd_dependencies += filter_chain_sse endif if have_neon - pffft_neon = static_library('pffft_neon', + filter_chain_neon = static_library('filter_chain_neon', 'module-filter-chain/pffft.c' , c_args : neon_args, '-O3', '-DHAVE_NEON', dependencies : spa_dep , install : false ) simd_cargs += '-DHAVE_NEON' - simd_dependencies += pffft_neon + simd_dependencies += filter_chain_neon endif -pffft_c = static_library('pffft_c', - 'module-filter-chain/pffft.c' , +filter_chain_c = static_library('filter_chain_c', + 'module-filter-chain/pffft.c', + 'module-filter-chain/dsp-ops.c', + 'module-filter-chain/dsp-ops-c.c' , c_args : simd_cargs, '-O3', '-DPFFFT_SIMD_DISABLE', dependencies : spa_dep , install : false ) -simd_dependencies += pffft_c +simd_dependencies += filter_chain_c filter_chain_sources = 'module-filter-chain.c',
View file
pipewire-0.3.60.tar.gz/src/modules/module-client-node/client-node.c -> pipewire-0.3.61.tar.gz/src/modules/module-client-node/client-node.c
Changed
@@ -744,7 +744,7 @@ struct node *this = &impl->node; struct port *p; struct mix *mix; - uint32_t i, j, peer_id; + uint32_t i, j; struct pw_client_node_buffer *mb; p = GET_PORT(this, direction, port_id); @@ -762,8 +762,6 @@ if ((mix = find_mix(p, mix_id)) == NULL || !mix->valid) return -EINVAL; - peer_id = mix->peer_id; - if (direction == SPA_DIRECTION_OUTPUT) { mix_id = SPA_ID_INVALID; if ((mix = find_mix(p, mix_id)) == NULL || !mix->valid) @@ -881,10 +879,6 @@ } mix->n_buffers = n_buffers; - if (this->resource->version >= 4) - pw_client_node_resource_port_set_mix_info(this->resource, - direction, port_id, mix_id, - peer_id, NULL); return pw_client_node_resource_port_use_buffers(this->resource, direction, port_id, mix_id, flags, n_buffers, mb); @@ -1486,6 +1480,7 @@ struct port *p = object; struct pw_impl_port *port = p->port; struct impl *impl = port->owner_data; + struct node *this = &impl->node; struct pw_impl_port_mix *mix; mix = pw_map_lookup(&port->mix_port_map, mix_id); @@ -1497,6 +1492,11 @@ mix->io = data; else mix->io = NULL; + + if (mix->io != NULL && this->resource && this->resource->version >= 4) + pw_client_node_resource_port_set_mix_info(this->resource, + direction, port->port_id, + mix->port.port_id, mix->peer_id, NULL); } return do_port_set_io(impl, @@ -1558,14 +1558,14 @@ struct impl *impl = data; struct port *p = pw_impl_port_get_user_data(port); - pw_impl_port_set_mix(port, &p->mix_node, - PW_IMPL_PORT_MIX_FLAG_MULTI | - PW_IMPL_PORT_MIX_FLAG_MIX_ONLY); - port->flags |= PW_IMPL_PORT_FLAG_NO_MIXER; port->impl = SPA_CALLBACKS_INIT(&port_impl, p); port->owner_data = impl; + + pw_impl_port_set_mix(port, &p->mix_node, + PW_IMPL_PORT_MIX_FLAG_MULTI | + PW_IMPL_PORT_MIX_FLAG_MIX_ONLY); } static void node_port_removed(void *data, struct pw_impl_port *port)
View file
pipewire-0.3.60.tar.gz/src/modules/module-client-node/protocol-native.c -> pipewire-0.3.61.tar.gz/src/modules/module-client-node/protocol-native.c
Changed
@@ -556,6 +556,8 @@ SPA_POD_Id(&m->type), SPA_POD_Int(&m->size), NULL) < 0) return -EINVAL; + + m->data = NULL; } if (spa_pod_parser_get(&prs, SPA_POD_Int(&buf->n_datas), NULL) < 0) @@ -576,7 +578,9 @@ SPA_POD_Int(&d->maxsize), NULL) < 0) return -EINVAL; + d->fd = -1; d->data = SPA_UINT32_TO_PTR(data_id); + d->chunk = NULL; } } pw_proxy_notify(proxy, struct pw_client_node_events, port_use_buffers, 0,
View file
pipewire-0.3.60.tar.gz/src/modules/module-filter-chain/builtin_plugin.c -> pipewire-0.3.61.tar.gz/src/modules/module-filter-chain/builtin_plugin.c
Changed
@@ -40,6 +40,9 @@ #include "biquad.h" #include "pffft.h" #include "convolver.h" +#include "dsp-ops.h" + +static struct dsp_ops dsp_ops; struct builtin { unsigned long rate; @@ -82,7 +85,7 @@ { struct builtin *impl = Instance; float *in = impl->port1, *out = impl->port0; - memcpy(out, in, SampleCount * sizeof(float)); + dsp_ops_copy(&dsp_ops, out, in, SampleCount); } static struct fc_port copy_ports = { @@ -112,10 +115,10 @@ static void mixer_run(void * Instance, unsigned long SampleCount) { struct builtin *impl = Instance; - int i; - unsigned long j; + int i, n_src = 0; float *out = impl->port0; - bool first = true; + const void *src8; + float gains8; if (out == NULL) return; @@ -127,24 +130,10 @@ if (in == NULL || gain == 0.0f) continue; - if (first) { - if (gain == 1.0f) - memcpy(out, in, SampleCount * sizeof(float)); - else - for (j = 0; j < SampleCount; j++) - outj = inj * gain; - first = false; - } else { - if (gain == 1.0f) - for (j = 0; j < SampleCount; j++) - outj += inj; - else - for (j = 0; j < SampleCount; j++) - outj += inj * gain; - } + srcn_src = in; + gainsn_src++ = gain; } - if (first) - memset(out, 0, SampleCount * sizeof(float)); + dsp_ops_mix_gain(&dsp_ops, out, src, gains, n_src, SampleCount); } static struct fc_port mixer_ports = { @@ -941,7 +930,11 @@ const char *plugin, const char *config) { struct spa_cpu *cpu_iface; + uint32_t cpu_flags; cpu_iface = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_CPU); - pffft_select_cpu(cpu_iface ? spa_cpu_get_flags(cpu_iface) : 0); + cpu_flags = cpu_iface ? spa_cpu_get_flags(cpu_iface) : 0; + dsp_ops.cpu_flags = cpu_flags; + dsp_ops_init(&dsp_ops); + pffft_select_cpu(cpu_flags); return &builtin_plugin; }
View file
pipewire-0.3.61.tar.gz/src/modules/module-filter-chain/dsp-ops-c.c
Added
@@ -0,0 +1,100 @@ +/* Spa + * + * Copyright © 2022 Wim Taymans + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include <string.h> +#include <stdio.h> +#include <math.h> + +#include <spa/utils/defs.h> + +#include "dsp-ops.h" + +static inline void dsp_clear_c(struct dsp_ops *ops, void * SPA_RESTRICT dst, uint32_t n_samples) +{ + memset(dst, 0, sizeof(float) * n_samples); +} + +static inline void dsp_add_c(struct dsp_ops *ops, void * SPA_RESTRICT dst, + const void * SPA_RESTRICT src, uint32_t n_samples) +{ + uint32_t i; + const float *s = src; + float *d = dst; + for (i = 0; i < n_samples; i++) + di += si; +} + +static inline void dsp_gain_c(struct dsp_ops *ops, void * SPA_RESTRICT dst, + const void * SPA_RESTRICT src, float gain, uint32_t n_samples) +{ + uint32_t i; + const float *s = src; + float *d = dst; + for (i = 0; i < n_samples; i++) + di = si * gain; +} + +static inline void dsp_gain_add_c(struct dsp_ops *ops, void * SPA_RESTRICT dst, + const void * SPA_RESTRICT src, float gain, uint32_t n_samples) +{ + uint32_t i; + const float *s = src; + float *d = dst; + for (i = 0; i < n_samples; i++) + di += si * gain; +} + + +void dsp_copy_c(struct dsp_ops *ops, void * SPA_RESTRICT dst, + const void * SPA_RESTRICT src, uint32_t n_samples) +{ + if (dst != src) + spa_memcpy(dst, src, sizeof(float) * n_samples); +} + +void dsp_mix_gain_c(struct dsp_ops *ops, + void * SPA_RESTRICT dst, + const void * SPA_RESTRICT src, + float gain, uint32_t n_src, uint32_t n_samples) +{ + uint32_t i; + if (n_src == 0) { + dsp_clear_c(ops, dst, n_samples); + } else if (n_src == 1) { + if (dst != src0) + dsp_copy_c(ops, dst, src0, n_samples); + } else { + if (gain0 == 1.0f) + dsp_copy_c(ops, dst, src0, n_samples); + else + dsp_gain_c(ops, dst, src0, gain0, n_samples); + + for (i = 1; i < n_src; i++) { + if (gaini == 1.0f) + dsp_add_c(ops, dst, srci, n_samples); + else + dsp_gain_add_c(ops, dst, srci, gaini, n_samples); + } + } +}
View file
pipewire-0.3.61.tar.gz/src/modules/module-filter-chain/dsp-ops-sse.c
Added
@@ -0,0 +1,91 @@ +/* Spa + * + * Copyright © 2022 Wim Taymans + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include <string.h> +#include <stdio.h> +#include <math.h> + +#include <spa/utils/defs.h> + +#include "dsp-ops.h" + +#include <xmmintrin.h> + +void dsp_mix_gain_sse(struct dsp_ops *ops, + void * SPA_RESTRICT dst, + const void * SPA_RESTRICT src, + float gain, uint32_t n_src, uint32_t n_samples) +{ + if (n_src == 0) { + memset(dst, 0, n_samples * sizeof(float)); + } else if (n_src == 1) { + if (dst != src0) + spa_memcpy(dst, src0, n_samples * sizeof(float)); + } else { + uint32_t n, i, unrolled; + __m128 in4, g; + const float **s = (const float **)src; + float *d = dst; + + if (SPA_LIKELY(SPA_IS_ALIGNED(dst, 16))) { + unrolled = n_samples & ~15; + for (i = 0; i < n_src; i++) { + if (SPA_UNLIKELY(!SPA_IS_ALIGNED(srci, 16))) { + unrolled = 0; + break; + } + } + } else + unrolled = 0; + + for (n = 0; n < unrolled; n += 16) { + g = _mm_set1_ps(gain0); + in0 = _mm_mul_ps(g, _mm_load_ps(&s0n+ 0)); + in1 = _mm_mul_ps(g, _mm_load_ps(&s0n+ 4)); + in2 = _mm_mul_ps(g, _mm_load_ps(&s0n+ 8)); + in3 = _mm_mul_ps(g, _mm_load_ps(&s0n+12)); + + for (i = 1; i < n_src; i++) { + g = _mm_set1_ps(gaini); + in0 = _mm_add_ps(in0, _mm_mul_ps(g, _mm_load_ps(&sin+ 0))); + in1 = _mm_add_ps(in1, _mm_mul_ps(g, _mm_load_ps(&sin+ 4))); + in2 = _mm_add_ps(in2, _mm_mul_ps(g, _mm_load_ps(&sin+ 8))); + in3 = _mm_add_ps(in3, _mm_mul_ps(g, _mm_load_ps(&sin+12))); + } + _mm_store_ps(&dn+ 0, in0); + _mm_store_ps(&dn+ 4, in1); + _mm_store_ps(&dn+ 8, in2); + _mm_store_ps(&dn+12, in3); + } + for (; n < n_samples; n++) { + g = _mm_set_ss(gain0); + in0 = _mm_mul_ss(g, _mm_load_ss(&s0n)); + for (i = 1; i < n_src; i++) { + g = _mm_set_ss(gaini); + in0 = _mm_add_ss(in0, _mm_mul_ss(g, _mm_load_ss(&sin))); + } + _mm_store_ss(&dn, in0); + } + } +}
View file
pipewire-0.3.61.tar.gz/src/modules/module-filter-chain/dsp-ops.c
Added
@@ -0,0 +1,92 @@ +/* Spa + * + * Copyright © 2022 Wim Taymans + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include <string.h> +#include <stdio.h> +#include <math.h> + +#include <spa/support/cpu.h> +#include <spa/utils/defs.h> +#include <spa/param/audio/format-utils.h> + +#include "dsp-ops.h" + +struct dsp_info { + uint32_t cpu_flags; + + void (*copy) (struct dsp_ops *ops, + void * SPA_RESTRICT dst, + const void * SPA_RESTRICT src, uint32_t n_samples); + void (*mix_gain) (struct dsp_ops *ops, + void * SPA_RESTRICT dst, + const void * SPA_RESTRICT src, + float gain, uint32_t n_src, uint32_t n_samples); +}; + +static struct dsp_info dsp_table = +{ +#if defined (HAVE_SSE) + { SPA_CPU_FLAG_SSE, + .copy = dsp_copy_c, + .mix_gain = dsp_mix_gain_sse, + }, +#endif + { 0, + .copy = dsp_copy_c, + .mix_gain = dsp_mix_gain_c, + }, +}; + +#define MATCH_CPU_FLAGS(a,b) ((a) == 0 || ((a) & (b)) == a) + +static const struct dsp_info *find_dsp_info(uint32_t cpu_flags) +{ + SPA_FOR_EACH_ELEMENT_VAR(dsp_table, t) { + if (MATCH_CPU_FLAGS(t->cpu_flags, cpu_flags)) + return t; + } + return NULL; +} + +static void impl_dsp_ops_free(struct dsp_ops *ops) +{ + spa_zero(*ops); +} + +int dsp_ops_init(struct dsp_ops *ops) +{ + const struct dsp_info *info; + + info = find_dsp_info(ops->cpu_flags); + if (info == NULL) + return -ENOTSUP; + + ops->priv = info; + ops->cpu_flags = info->cpu_flags; + ops->copy = info->copy; + ops->mix_gain = info->mix_gain; + ops->free = impl_dsp_ops_free; + + return 0; +}
View file
pipewire-0.3.61.tar.gz/src/modules/module-filter-chain/dsp-ops.h
Added
@@ -0,0 +1,62 @@ +/* Spa + * + * Copyright © 2022 Wim Taymans + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include <spa/utils/defs.h> + +struct dsp_ops { + uint32_t cpu_flags; + + void (*clear) (struct dsp_ops *ops, void * SPA_RESTRICT dst, uint32_t n_samples); + void (*copy) (struct dsp_ops *ops, + void * SPA_RESTRICT dst, + const void * SPA_RESTRICT src, uint32_t n_samples); + void (*mix_gain) (struct dsp_ops *ops, + void * SPA_RESTRICT dst, + const void * SPA_RESTRICT src, + float gain, uint32_t n_src, uint32_t n_samples); + void (*free) (struct dsp_ops *ops); + + const void *priv; +}; + +int dsp_ops_init(struct dsp_ops *ops); + +#define dsp_ops_copy(ops,...) (ops)->copy(ops, __VA_ARGS__) +#define dsp_ops_mix_gain(ops,...) (ops)->mix_gain(ops, __VA_ARGS__) +#define dsp_ops_free(ops) (ops)->free(ops) + + +#define MAKE_COPY_FUNC(arch) \ +void dsp_copy_##arch(struct dsp_ops *ops, void * SPA_RESTRICT dst, \ + const void * SPA_RESTRICT src, uint32_t n_samples) +#define MAKE_MIX_GAIN_FUNC(arch) \ +void dsp_mix_gain_##arch(struct dsp_ops *ops, void * SPA_RESTRICT dst, \ + const void * SPA_RESTRICT src, float gain, uint32_t n_src, uint32_t n_samples) + + +MAKE_COPY_FUNC(c); +MAKE_MIX_GAIN_FUNC(c); +#if defined (HAVE_SSE) +MAKE_MIX_GAIN_FUNC(sse); +#endif
View file
pipewire-0.3.60.tar.gz/src/modules/module-protocol-pulse/internal.h -> pipewire-0.3.61.tar.gz/src/modules/module-protocol-pulse/internal.h
Changed
@@ -36,6 +36,7 @@ #include <pipewire/private.h> #include "format.h" +#include "server.h" struct pw_loop; struct pw_context; @@ -52,6 +53,7 @@ struct sample_spec sample_spec; struct channel_map channel_map; uint32_t quantum_limit; + uint32_t idle_timeout; }; struct stats { @@ -72,6 +74,7 @@ struct ratelimit rate_limit; + struct spa_hook_list hooks; struct spa_list servers; struct pw_work_queue *work_queue; @@ -85,6 +88,19 @@ struct stats stat; }; +struct impl_events { +#define VERSION_IMPL_EVENTS 0 + uint32_t version; + + void (*server_started) (void *data, struct server *server); + + void (*server_stopped) (void *data, struct server *server); +}; + +void impl_add_listener(struct impl *impl, + struct spa_hook *listener, + const struct impl_events *events, void *data); + extern bool debug_messages; void broadcast_subscribe_event(struct impl *impl, uint32_t mask, uint32_t event, uint32_t id);
View file
pipewire-0.3.60.tar.gz/src/modules/module-protocol-pulse/modules/module-zeroconf-publish.c -> pipewire-0.3.61.tar.gz/src/modules/module-protocol-pulse/modules/module-zeroconf-publish.c
Changed
@@ -24,6 +24,7 @@ */ #include <sys/utsname.h> +#include <arpa/inet.h> #include <pipewire/pipewire.h> @@ -32,6 +33,7 @@ #include "../manager.h" #include "../module.h" #include "../pulse-server.h" +#include "../server.h" #include "../../module-zeroconf-discover/avahi-poll.h" #include <avahi-client/client.h> @@ -83,6 +85,7 @@ struct pw_properties *props; char service_nameAVAHI_LABEL_MAX; + unsigned published:1; }; struct module_zeroconf_publish_data { @@ -93,8 +96,7 @@ struct spa_hook core_listener; struct spa_hook manager_listener; - - unsigned int port; + struct spa_hook impl_listener; AvahiPoll *avahi_poll; AvahiClient *client; @@ -151,6 +153,7 @@ { spa_list_remove(&s->link); spa_list_append(&s->userdata->pending, &s->link); + s->published = false; } static void unpublish_all_services(struct module_zeroconf_publish_data *d) @@ -315,6 +318,11 @@ struct service *s = userdata; spa_assert(s); + if (!s->published) { + pw_log_info("cancel unpublished service: %s", s->service_name); + clear_entry_group(s); + return; + } switch (state) { case AVAHI_ENTRY_GROUP_ESTABLISHED: @@ -389,17 +397,47 @@ return txt; } +static int find_port(struct service *s, int *proto, uint16_t *port) +{ + struct module_zeroconf_publish_data *d = s->userdata; + struct impl *impl = d->module->impl; + struct server *server; + + spa_list_for_each(server, &impl->servers, link) { + if (server->addr.ss_family == AF_INET) { + *proto = AVAHI_PROTO_INET; + *port = ntohs(((struct sockaddr_in*) &server->addr)->sin_port); + return 0; + } else if (server->addr.ss_family == AF_INET6) { + *proto = AVAHI_PROTO_INET6; + *port = ntohs(((struct sockaddr_in6*) &server->addr)->sin6_port); + return 0; + } + } + return -ENODEV; +} + static void publish_service(struct service *s) { - if (!s->userdata->client || avahi_client_get_state(s->userdata->client) != AVAHI_CLIENT_S_RUNNING) + struct module_zeroconf_publish_data *d = s->userdata; + int proto; + uint16_t port; + + if (find_port(s, &proto, &port) < 0) + return; + + pw_log_debug("found proto:%d port:%d", proto, port); + + if (!d->client || avahi_client_get_state(d->client) != AVAHI_CLIENT_S_RUNNING) return; + s->published = true; if (!s->entry_group) { - s->entry_group = avahi_entry_group_new(s->userdata->client, service_entry_group_callback, s); + s->entry_group = avahi_entry_group_new(d->client, service_entry_group_callback, s); if (s->entry_group == NULL) { pw_log_error("avahi_entry_group_new(): %s", - avahi_strerror(avahi_client_errno(s->userdata->client))); - return; + avahi_strerror(avahi_client_errno(d->client))); + goto error; } } else { avahi_entry_group_reset(s->entry_group); @@ -410,22 +448,22 @@ if (avahi_entry_group_add_service_strlst( s->entry_group, - AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, + AVAHI_IF_UNSPEC, proto, 0, s->service_name, s->service_type, NULL, NULL, - s->userdata->port, + port, s->txt) < 0) { pw_log_error("avahi_entry_group_add_service_strlst(): %s", - avahi_strerror(avahi_client_errno(s->userdata->client))); - return; + avahi_strerror(avahi_client_errno(d->client))); + goto error; } if (avahi_entry_group_add_service_subtype( s->entry_group, - AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, + AVAHI_IF_UNSPEC, proto, 0, s->service_name, s->service_type, @@ -434,35 +472,40 @@ (s->subtype == SUBTYPE_HARDWARE ? SERVICE_SUBTYPE_SOURCE_HARDWARE : (s->subtype == SUBTYPE_VIRTUAL ? SERVICE_SUBTYPE_SOURCE_VIRTUAL : SERVICE_SUBTYPE_SOURCE_MONITOR))) < 0) { pw_log_error("avahi_entry_group_add_service_subtype(): %s", - avahi_strerror(avahi_client_errno(s->userdata->client))); - return; + avahi_strerror(avahi_client_errno(d->client))); + goto error; } if (!s->is_sink && s->subtype != SUBTYPE_MONITOR) { if (avahi_entry_group_add_service_subtype( s->entry_group, - AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, + AVAHI_IF_UNSPEC, proto, 0, s->service_name, SERVICE_TYPE_SOURCE, NULL, SERVICE_SUBTYPE_SOURCE_NON_MONITOR) < 0) { pw_log_error("avahi_entry_group_add_service_subtype(): %s", - avahi_strerror(avahi_client_errno(s->userdata->client))); - return; + avahi_strerror(avahi_client_errno(d->client))); + goto error; } } if (avahi_entry_group_commit(s->entry_group) < 0) { pw_log_error("avahi_entry_group_commit(): %s", - avahi_strerror(avahi_client_errno(s->userdata->client))); - return; + avahi_strerror(avahi_client_errno(d->client))); + goto error; } spa_list_remove(&s->link); - spa_list_append(&s->userdata->published, &s->link); + spa_list_append(&d->published, &s->link); pw_log_info("created service: %s", s->service_name); + return; + +error: + s->published = false; + return; } static void publish_pending(struct module_zeroconf_publish_data *data) @@ -571,6 +614,28 @@ .removed = manager_removed, }; + +static void impl_server_started(void *data, struct server *server) +{ + struct module_zeroconf_publish_data *d = data; + pw_log_info("a new server is started, try publish"); + publish_pending(d); +} + +static void impl_server_stopped(void *data, struct server *server) +{ + struct module_zeroconf_publish_data *d = data; + pw_log_info("a server stopped, try republish"); + unpublish_all_services(d);
View file
pipewire-0.3.60.tar.gz/src/modules/module-protocol-pulse/pulse-server.c -> pipewire-0.3.61.tar.gz/src/modules/module-protocol-pulse/pulse-server.c
Changed
@@ -85,6 +85,7 @@ #define DEFAULT_MIN_QUANTUM "256/48000" #define DEFAULT_FORMAT "F32" #define DEFAULT_POSITION " FL FR " +#define DEFAULT_IDLE_TIMEOUT "5" #define MAX_FORMATS 32 /* The max amount of data we send in one block when capturing. In PulseAudio this @@ -1241,7 +1242,7 @@ SPA_PROP_mute, 1, &val, 0); } if (stream->corked) - pw_stream_set_active(stream->stream, false); + stream_set_paused(stream, true, "cork after create"); /* if peer exists, reply immediately, otherwise reply when the link is created */ peer = find_linked(stream->client->manager, stream->id, stream->direction); @@ -1276,6 +1277,7 @@ uint32_t minreq; uint32_t quantum; unsigned int underrun:1; + unsigned int idle:1; }; static int @@ -1315,6 +1317,17 @@ else stream_send_started(stream); } + if (pd->idle) { + if (!stream->is_idle) { + stream->idle_time = stream->timestamp; + } else if (!stream->is_paused && + stream->idle_timeout_sec > 0 && + stream->timestamp - stream->idle_time > + (stream->idle_timeout_sec * SPA_NSEC_PER_SEC)) { + stream_set_paused(stream, true, "long underrun"); + } + } + stream->is_idle = pd->idle; stream->playing_for += pd->playing_for; if (stream->underrun_for != (uint64_t)-1) stream->underrun_for += pd->underrun_for; @@ -1433,12 +1446,14 @@ stream->buffer, MAXLENGTH, index % MAXLENGTH, p, avail); - index += avail; - pd.read_inc = avail; - spa_ringbuffer_read_update(&stream->ring, index); } + index += size; + pd.read_inc = size; + spa_ringbuffer_read_update(&stream->ring, index); + pd.playing_for = size; } + pd.idle = true; pw_log_debug("%p: %s underrun read:%u avail:%d max:%u", stream, client->name, index, avail, minreq); } else { @@ -1523,7 +1538,7 @@ reply_simple_ack(stream->client, stream->drain_tag); stream->drain_tag = 0; - pw_stream_set_active(stream->stream, true); + stream_set_paused(stream, false, "complete drain"); } } @@ -2701,7 +2716,7 @@ return -ENOENT; stream->corked = cork; - pw_stream_set_active(stream->stream, !cork); + stream_set_paused(stream, cork, "cork request"); if (cork) { stream->is_underrun = true; } else { @@ -3461,7 +3476,7 @@ stream->drain_tag = tag; stream->draining = true; - pw_stream_set_active(stream->stream, true); + stream_set_paused(stream, false, "drain start"); return 0; } @@ -5460,6 +5475,8 @@ pw_map_for_each(&impl->samples, impl_free_sample, impl); pw_map_clear(&impl->samples); + spa_hook_list_clean(&impl->hooks); + #ifdef HAVE_DBUS if (impl->dbus_name) { dbus_release_name(impl->dbus_name); @@ -5499,8 +5516,10 @@ if (props == NULL || (str = pw_properties_get(props, key)) == NULL) str = def; - if (sscanf(str, "%u/%u", &res->num, &res->denom) != 2 || res->denom == 0) - return -EINVAL; + if (sscanf(str, "%u/%u", &res->num, &res->denom) != 2 || res->denom == 0) { + pw_log_warn(": invalid fraction %s, default to %s", str, def); + sscanf(def, "%u/%u", &res->num, &res->denom); + } pw_log_info(": defaults: %s = %u/%u", key, res->num, res->denom); return 0; } @@ -5540,7 +5559,21 @@ pw_log_warn(": unknown format %s, default to %s", str, def); res->format = format_name2id(def); } - pw_log_info(": defaults: %s = %s", key, str); + pw_log_info(": defaults: %s = %s", key, format_id2name(res->format)); + return 0; +} +static int parse_uint32(struct pw_properties *props, const char *key, const char *def, + uint32_t *res) +{ + const char *str; + if (props == NULL || + (str = pw_properties_get(props, key)) == NULL) + str = def; + if (!spa_atou32(str, res, 0)) { + pw_log_warn(": invalid uint32_t %s, default to %s", str, def); + spa_atou32(def, res, 0); + } + pw_log_info(": defaults: %s = %u", key, *res); return 0; } @@ -5554,6 +5587,7 @@ parse_frac(props, "pulse.min.quantum", DEFAULT_MIN_QUANTUM, &def->min_quantum); parse_format(props, "pulse.default.format", DEFAULT_FORMAT, &def->sample_spec); parse_position(props, "pulse.default.position", DEFAULT_POSITION, &def->channel_map); + parse_uint32(props, "pulse.idle.timeout", DEFAULT_IDLE_TIMEOUT, &def->idle_timeout); def->sample_spec.channels = def->channel_map.channels; def->quantum_limit = 8192; } @@ -5598,6 +5632,7 @@ impl->work_queue = pw_context_get_work_queue(context); + spa_hook_list_init(&impl->hooks); spa_list_init(&impl->servers); impl->rate_limit.interval = 2 * SPA_NSEC_PER_SEC; impl->rate_limit.burst = 1; @@ -5649,6 +5684,13 @@ return NULL; } +void impl_add_listener(struct impl *impl, + struct spa_hook *listener, + const struct impl_events *events, void *data) +{ + spa_hook_list_append(&impl->hooks, listener, events, data); +} + void *pw_protocol_pulse_get_user_data(struct pw_protocol_pulse *pulse) { return SPA_PTROFF(pulse, sizeof(struct impl), void);
View file
pipewire-0.3.60.tar.gz/src/modules/module-protocol-pulse/server.c -> pipewire-0.3.61.tar.gz/src/modules/module-protocol-pulse/server.c
Changed
@@ -191,6 +191,9 @@ stream_send_request(stream); + if (stream->is_paused && !stream->corked) + stream_set_paused(stream, false, "new data"); + finish: message_free(msg, false, false); return res; @@ -899,7 +902,7 @@ static int server_start(struct server *server, const struct sockaddr_storage *addr) { - const struct impl * const impl = server->impl; + struct impl * const impl = server->impl; int res = 0, fd; switch (addr->ss_family) { @@ -924,6 +927,8 @@ res = -errno; pw_log_error("server %p: can't create server source: %m", impl); } + if (res >= 0) + spa_hook_list_call(&impl->hooks, struct impl_events, server_started, 0, server); return res; } @@ -1069,6 +1074,8 @@ client_unref(c); } + spa_hook_list_call(&impl->hooks, struct impl_events, server_stopped, 0, server); + if (server->source) pw_loop_destroy_source(impl->loop, server->source);
View file
pipewire-0.3.60.tar.gz/src/modules/module-protocol-pulse/stream.c -> pipewire-0.3.61.tar.gz/src/modules/module-protocol-pulse/stream.c
Changed
@@ -64,6 +64,7 @@ { int res; struct defs *defs = &client->impl->defs; + const char *str; struct stream *stream = calloc(1, sizeof(*stream)); if (stream == NULL) @@ -90,6 +91,9 @@ parse_frac(client->props, "pulse.default.req", &defs->default_req, &stream->default_req); parse_frac(client->props, "pulse.default.frag", &defs->default_frag, &stream->default_frag); parse_frac(client->props, "pulse.default.tlength", &defs->default_tlength, &stream->default_tlength); + stream->idle_timeout_sec = defs->idle_timeout; + if ((str = pw_properties_get(client->props, "pulse.idle.timeout")) != NULL) + spa_atou32(str, &stream->idle_timeout_sec, 0); switch (type) { case STREAM_TYPE_RECORD: @@ -207,6 +211,20 @@ return missing; } +void stream_set_paused(struct stream *stream, bool paused, const char *reason) +{ + if (stream->is_paused == paused) + return; + + if (reason && stream->client) + pw_log_info("%p: %s %s because of %s", + stream, stream->client->name, + paused ? "paused" : "resumed", reason); + + stream->is_paused = paused; + pw_stream_set_active(stream->stream, !paused); +} + int stream_send_underflow(struct stream *stream, int64_t offset) { struct client *client = stream->client;
View file
pipewire-0.3.60.tar.gz/src/modules/module-protocol-pulse/stream.h -> pipewire-0.3.61.tar.gz/src/modules/module-protocol-pulse/stream.h
Changed
@@ -82,6 +82,7 @@ uint64_t playing_for; uint64_t ticks_base; uint64_t timestamp; + uint64_t idle_time; int64_t delay; uint32_t last_quantum; @@ -93,6 +94,7 @@ struct spa_fraction default_frag; struct spa_fraction default_tlength; struct spa_fraction min_quantum; + uint32_t idle_timeout_sec; struct sample_spec ss; struct channel_map map; @@ -115,6 +117,8 @@ unsigned int in_prebuf:1; unsigned int killed:1; unsigned int pending:1; + unsigned int is_idle:1; + unsigned int is_paused:1; }; struct stream *stream_new(struct client *client, enum stream_type type, uint32_t create_tag, @@ -124,6 +128,8 @@ void stream_flush(struct stream *stream); uint32_t stream_pop_missing(struct stream *stream); +void stream_set_paused(struct stream *stream, bool paused, const char *reason); + int stream_send_underflow(struct stream *stream, int64_t offset); int stream_send_overflow(struct stream *stream); int stream_send_killed(struct stream *stream);
View file
pipewire-0.3.60.tar.gz/src/modules/module-pulse-tunnel.c -> pipewire-0.3.61.tar.gz/src/modules/module-pulse-tunnel.c
Changed
@@ -72,7 +72,7 @@ * (Default `sink`) * - `pulse.server.address`: the address of the PulseAudio server to tunnel to. * - `pulse.latency`: the latency to end-to-end latency in milliseconds to - * maintain (Default 200ms). + * maintain (Default 200). * - `stream.props`: Extra properties for the local stream. * * ## General options @@ -101,6 +101,7 @@ * tunnel.mode = sink * # Set the remote address to tunnel to * pulse.server.address = "tcp:192.168.1.126" + * #pulse.latency = 200 * #audio.rate=<sample rate> * #audio.channels=<number of channels> * #audio.position=<channel map> @@ -1012,6 +1013,7 @@ copy_props(impl, props, PW_KEY_NODE_GROUP); copy_props(impl, props, PW_KEY_NODE_LATENCY); copy_props(impl, props, PW_KEY_NODE_VIRTUAL); + copy_props(impl, props, PW_KEY_NODE_NETWORK); copy_props(impl, props, PW_KEY_MEDIA_CLASS); parse_audio_info(impl->stream_props, &impl->info);
View file
pipewire-0.3.60.tar.gz/src/modules/module-raop-sink.c -> pipewire-0.3.61.tar.gz/src/modules/module-raop-sink.c
Changed
@@ -579,10 +579,10 @@ if (ip_version == 4) { sa4.sin_port = htons(*port); - ret = bind(fd, &sa4, sizeof(sa4)); + ret = bind(fd, (struct sockaddr*)&sa4, sizeof(sa4)); } else { sa6.sin6_port = htons(*port); - ret = bind(fd, &sa6, sizeof(sa6)); + ret = bind(fd, (struct sockaddr*)&sa6, sizeof(sa6)); } if (ret == 0) break;
View file
pipewire-0.3.60.tar.gz/src/modules/module-rtp-sink.c -> pipewire-0.3.61.tar.gz/src/modules/module-rtp-sink.c
Changed
@@ -31,6 +31,7 @@ #include <sys/ioctl.h> #include <arpa/inet.h> #include <netinet/ip.h> +#include <netinet/in.h> #include <net/if.h> #include <ctype.h> @@ -439,14 +440,14 @@ if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &val, sizeof(val)) < 0) pw_log_warn("setsockopt(IP_MULTICAST_TTL) failed: %m"); } - +#ifdef SO_PRIORITY val = 6; if (setsockopt(fd, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)) < 0) pw_log_warn("setsockopt(SO_PRIORITY) failed: %m"); - +#endif val = IPTOS_LOWDELAY; if (setsockopt(fd, IPPROTO_IP, IP_TOS, &val, sizeof(val)) < 0) - pw_log_warn("setsockopt(SO_PRIORITY) failed: %m"); + pw_log_warn("setsockopt(IP_TOS) failed: %m"); return fd;
View file
pipewire-0.3.60.tar.gz/src/modules/module-rtp-source.c -> pipewire-0.3.61.tar.gz/src/modules/module-rtp-source.c
Changed
@@ -46,6 +46,9 @@ #include <module-rtp/sap.h> #include <module-rtp/rtp.h> +#ifdef __FreeBSD__ +#define ifr_ifindex ifr_index +#endif /** \page page_module_rtp_source PipeWire Module: RTP source *
View file
pipewire-0.3.60.tar.gz/src/pipewire/context.c -> pipewire-0.3.61.tar.gz/src/pipewire/context.c
Changed
@@ -1168,6 +1168,10 @@ if (s->active) running = !n->passive; + pw_log_debug("%p: follower %p running:%d passive:%d rate:%u/%u latency %u/%u '%s'", + context, s, running, s->passive, rate.num, rate.denom, + latency.num, latency.denom, s->name); + s->moved = false; } @@ -1195,6 +1199,7 @@ } if (target_rate != current_rate) { + bool do_suspend = false; /* we doing a rate switch */ pw_log_info("(%s-%u) state:%s new rate:%u->%u", n->name, n->info.id, @@ -1204,18 +1209,21 @@ if (force_rate) { if (settings->clock_rate_update_mode == CLOCK_RATE_UPDATE_MODE_HARD) - suspend_driver(context, n); + do_suspend = true; } else { if (n->info.state >= PW_NODE_STATE_SUSPENDED) - suspend_driver(context, n); + do_suspend = true; } + if (do_suspend) + suspend_driver(context, n); /* we're setting the pending rate. This will become the new * current rate in the next iteration of the graph. */ n->current_rate = SPA_FRACTION(1, target_rate); n->current_pending = true; current_rate = target_rate; /* we might be suspended now and the links need to be prepared again */ - goto again; + if (do_suspend) + goto again; } if (rate_quantum != 0 && current_rate != rate_quantum) {
View file
pipewire-0.3.60.tar.gz/src/pipewire/impl-module.c -> pipewire-0.3.61.tar.gz/src/pipewire/impl-module.c
Changed
@@ -178,6 +178,8 @@ NULL }; + pw_log_info("%p: name:%s args:%s", context, name, args); + module_dir = getenv("PIPEWIRE_MODULE_DIR"); if (module_dir == NULL) { module_dir = MODULEDIR; @@ -276,10 +278,10 @@ error_not_found: res = -ENOENT; - pw_log_error("No module \"%s\" was found", name); + pw_log_info("No module \"%s\" was found", name); goto error_cleanup; error_open_failed: - res = -ENOENT; + res = -EIO; pw_log_error("Failed to open module: \"%s\" %s", filename, dlerror()); goto error_free_filename; error_no_pw_module:
View file
pipewire-0.3.60.tar.gz/src/pipewire/private.h -> pipewire-0.3.61.tar.gz/src/pipewire/private.h
Changed
@@ -49,7 +49,7 @@ #define spa_debug(...) pw_log_trace(__VA_ARGS__) #endif -#define MAX_RATES 16u +#define MAX_RATES 32u #define CLOCK_MIN_QUANTUM 4u #define CLOCK_MAX_QUANTUM 65536u
View file
pipewire-0.3.60.tar.gz/src/pipewire/stream.c -> pipewire-0.3.61.tar.gz/src/pipewire/stream.c
Changed
@@ -587,6 +587,28 @@ return 0; } +static inline void copy_position(struct stream *impl, int64_t queued) +{ + struct spa_io_position *p = impl->rt.position; + + SEQ_WRITE(impl->seq); + if (SPA_LIKELY(p != NULL)) { + impl->time.now = p->clock.nsec; + impl->time.rate = p->clock.rate; + if (SPA_UNLIKELY(impl->clock_id != p->clock.id)) { + impl->base_pos = p->clock.position - impl->time.ticks; + impl->clock_id = p->clock.id; + } + impl->time.ticks = p->clock.position - impl->base_pos; + impl->time.delay = 0; + impl->time.queued = queued; + impl->quantum = p->clock.duration; + } + if (SPA_LIKELY(impl->rate_match != NULL)) + impl->rate_queued = impl->rate_match->delay; + SEQ_WRITE(impl->seq); +} + static int impl_send_command(void *object, const struct spa_command *command) { struct stream *impl = object; @@ -614,8 +636,10 @@ if (impl->direction == SPA_DIRECTION_INPUT) impl->io->status = SPA_STATUS_NEED_DATA; - else if (!impl->process_rt && !impl->driving) + else if (!impl->process_rt && !impl->driving) { + copy_position(impl, impl->queued.incount); call_process(impl); + } stream_set_state(stream, PW_STREAM_STATE_STREAMING, NULL); } @@ -963,28 +987,6 @@ return 0; } -static inline void copy_position(struct stream *impl, int64_t queued) -{ - struct spa_io_position *p = impl->rt.position; - - SEQ_WRITE(impl->seq); - if (SPA_LIKELY(p != NULL)) { - impl->time.now = p->clock.nsec; - impl->time.rate = p->clock.rate; - if (SPA_UNLIKELY(impl->clock_id != p->clock.id)) { - impl->base_pos = p->clock.position - impl->time.ticks; - impl->clock_id = p->clock.id; - } - impl->time.ticks = p->clock.position - impl->base_pos; - impl->time.delay = 0; - impl->time.queued = queued; - impl->quantum = p->clock.duration; - } - if (SPA_LIKELY(impl->rate_match != NULL)) - impl->rate_queued = impl->rate_match->delay; - SEQ_WRITE(impl->seq); -} - static int impl_node_process_input(void *object) { struct stream *impl = object;
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.