@signalapp/ringrtc 2.59.0 → 2.59.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -669,7 +669,7 @@ For more information on this, and how to apply and follow the GNU AGPL, see
669
669
 
670
670
  ```
671
671
 
672
- ## libsignal-account-keys 0.1.0, libsignal-core 0.1.0, mrp 2.59.0, protobuf 2.59.0, ringrtc 2.59.0, regex-aot 0.1.0, partial-default-derive 0.1.0
672
+ ## libsignal-account-keys 0.1.0, libsignal-core 0.1.0, mrp 2.59.3, protobuf 2.59.3, ringrtc 2.59.3, regex-aot 0.1.0, partial-default-derive 0.1.0
673
673
 
674
674
  ```
675
675
  GNU AFFERO GENERAL PUBLIC LICENSE
@@ -8,7 +8,7 @@ set -eou pipefail
8
8
 
9
9
  usage()
10
10
  {
11
- echo "usage: $0 [--setup|--teardown|--play|--stop] [--input-source <name>] [--output-sink <name>] [--input-file <path>] [--input-loops <count>] [--output-file <path>] [--start-pipewire-pulse]
11
+ echo "usage: $0 [--setup|--teardown|--play|--stop] [--input-source <name>] [--output-sink <name>] [--input-file <path>] [--input-loops <count>] [--output-file <path>] [--blackhole-path <path>]
12
12
  where:
13
13
  --setup: Set up the specified devices
14
14
  --teardown: Tear down the specified devices.
@@ -20,13 +20,14 @@ usage()
20
20
  --input-file: The name of the file to play to your application (should be a .wav).
21
21
  --input-loops: Optional. The number of times to loop |input|. Default 1.
22
22
  --output-file: The name of the file to record your application to (should be a .wav).
23
+ --blackhole-path: Optional, macOS only. Path to a checkout of the BlackHole github repo.
24
+ If unspecified, setup will create a temp dir and clone to there.
23
25
 
24
- --start-pipewire-pulse: Optional, linux only. Assume that there is no pulse server running and start one.
25
26
  -h, --help: Display this usage text.
26
27
 
27
28
  Examples:
28
- # Setup 'my_spiffy_input_source' as an input and 'my_spiffy_output_sink' as an out, and start pipewire if needed.
29
- $0 --setup --input-source my_spiffy_input_source --output-sink my_spiffy_output_sink --start-pipewire-pulse
29
+ # Setup 'my_spiffy_input_source' as an input and 'my_spiffy_output_sink' as an out
30
+ $0 --setup --input-source my_spiffy_input_source --output-sink my_spiffy_output_sink
30
31
  # Start playing foo.wav to my_spiffy_input_source
31
32
  $0 --play --input-source my_spiffy_input_source --output-sink my_spiffy_output_sink --input-file foo.wav
32
33
  # Stop playing to my_spiffy_input_source
@@ -44,7 +45,7 @@ OUTPUT_SINK=
44
45
  INPUT_FILE=
45
46
  INPUT_LOOPS=1
46
47
  OUTPUT_FILE=
47
- START_PIPEWIRE_PULSE=
48
+ BLACKHOLE_PATH=
48
49
 
49
50
  while [[ $# -gt 0 ]]; do
50
51
  case $1 in
@@ -80,8 +81,9 @@ while [[ $# -gt 0 ]]; do
80
81
  INPUT_LOOPS="$2"
81
82
  shift
82
83
  ;;
83
- --start-pipewire-pulse )
84
- START_PIPEWIRE_PULSE=y
84
+ --blackhole-path )
85
+ BLACKHOLE_PATH="$2"
86
+ shift
85
87
  ;;
86
88
  -h | --help )
87
89
  usage
@@ -95,18 +97,74 @@ while [[ $# -gt 0 ]]; do
95
97
  shift
96
98
  done
97
99
 
98
- start_pipewire_pulse()
100
+ setup_macos()
99
101
  {
100
- if pactl info | grep -q "Server Name: PulseAudio (on PipeWire"; then
101
- echo "not re-initializing pulse/pipewire"
102
+ CLEANUP_GIT=
103
+ if [ -n "$BLACKHOLE_PATH" ]; then
104
+ cd "$BLACKHOLE_PATH"
102
105
  else
103
- echo "Starting a new pipewire, wireplumber, and pipewire-pulse"
104
- pipewire &
105
- wireplumber &
106
- pipewire-pulse &
106
+ BLACKHOLE_PATH=$(mktemp -d -t virtual_audio)
107
+ CLEANUP_GIT=1
108
+
109
+ cd "$BLACKHOLE_PATH"
110
+ git clone https://github.com/ExistentialAudio/BlackHole.git --revision=v0.6.1
111
+ cd BlackHole
112
+ fi
113
+
114
+ xcodebuild CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO \
115
+ -project BlackHole.xcodeproj -configuration Release -target BlackHole \
116
+ CONFIGURATION_BUILD_DIR=build \
117
+ GCC_PREPROCESSOR_DEFINITIONS='kNumber_Of_Channels=2 kDriver_Name=\"'"$INPUT_SOURCE"'\" kDevice_Name=\"'"$INPUT_SOURCE"'\"'
118
+ echo "Copying $INPUT_SOURCE driver to /Library/Audio/Plug-Ins/HAL: will require sudo"
119
+ sudo cp -r build/BlackHole.driver /Library/Audio/Plug-Ins/HAL/"$INPUT_SOURCE".driver
120
+
121
+ xcodebuild CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO \
122
+ -project BlackHole.xcodeproj -configuration Release -target BlackHole \
123
+ CONFIGURATION_BUILD_DIR=build \
124
+ GCC_PREPROCESSOR_DEFINITIONS='kNumber_Of_Channels=2 kDriver_Name=\"'"$OUTPUT_SINK"'\" kDevice_Name=\"'"$OUTPUT_SINK"'\"'
125
+ echo "Copying $OUTPUT_SINK driver to /Library/Audio/Plug-Ins/HAL: will require sudo"
126
+ sudo cp -r build/BlackHole.driver /Library/Audio/Plug-Ins/HAL/"$OUTPUT_SINK".driver
127
+
128
+ echo "Restarting coreaudiod; audio output may glitch"
129
+ sudo killall -9 coreaudiod
130
+
131
+ if [ -n "$CLEANUP_GIT" ]; then
132
+ echo "cleanup tempdir $BLACKHOLE_PATH"
133
+ rm -fr "$BLACKHOLE_PATH"
134
+ fi
135
+ }
136
+
137
+ teardown_macos()
138
+ {
139
+ echo "Removing $INPUT_SOURCE from install dir; will require sudo"
140
+ sudo rm -r /Library/Audio/Plug-Ins/HAL/"$INPUT_SOURCE".driver
141
+
142
+ echo "Removing $OUTPUT_SINK from install dir; will require sudo"
143
+ sudo rm -r /Library/Audio/Plug-Ins/HAL/"$OUTPUT_SINK".driver
144
+
145
+ echo "Restarting coreaudiod; audio output may glitch"
146
+ sudo killall -9 coreaudiod
147
+ }
148
+
149
+ play_macos()
150
+ {
151
+ if [ -n "$INPUT_FILE" ] && [ -e "$INPUT_FILE" ]; then
152
+ # "repeat" is the number of times to repeat, not the total number of plays
153
+ nohup sox -q "$INPUT_FILE" -t coreaudio "$INPUT_SOURCE" repeat $((INPUT_LOOPS - 1)) &
154
+ fi
155
+ if [ -n "$OUTPUT_FILE" ]; then
156
+ nohup sox -q -t coreaudio "$OUTPUT_SINK" "$OUTPUT_FILE" &
107
157
  fi
108
158
  }
109
159
 
160
+ stop_macos()
161
+ {
162
+ # Kill the record process
163
+ pkill -f "sox.*${OUTPUT_SINK}" || true
164
+ # Kill the play process
165
+ pkill -f "sox.*${INPUT_SOURCE}" || true
166
+ }
167
+
110
168
  setup_linux()
111
169
  {
112
170
  pactl load-module module-null-sink sink_name="${INPUT_SINK}" \
@@ -177,12 +235,26 @@ fi
177
235
  UNAME=$(uname)
178
236
 
179
237
  if [ "$UNAME" = "Darwin" ]; then
180
- echo "macOS is not yet supported"
181
- exit 1
182
- elif [ "$UNAME" = "Linux" ]; then
183
- if [[ "$START_PIPEWIRE_PULSE" ]]; then
184
- start_pipewire_pulse
238
+ if ! which -s sox ; then
239
+ echo "sox is required to play audio"
240
+ exit 1
241
+ fi
242
+ if [ "$TYPE" = "setup" ]; then
243
+ setup_macos
244
+ elif [ "$TYPE" = "teardown" ]; then
245
+ teardown_macos
246
+ elif [ "$TYPE" = "play" ]; then
247
+ if [ -z "$INPUT_FILE" ]; then
248
+ echo "--input-file was not specified with --play; assuming silence"
249
+ fi
250
+ if [ -z "$OUTPUT_FILE" ]; then
251
+ echo "--output-file was not specified with --play; will not record"
252
+ fi
253
+ play_macos
254
+ elif [ "$TYPE" = "stop" ]; then
255
+ stop_macos
185
256
  fi
257
+ elif [ "$UNAME" = "Linux" ]; then
186
258
  if [ "$TYPE" = "setup" ]; then
187
259
  setup_linux
188
260
  elif [ "$TYPE" = "teardown" ]; then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalapp/ringrtc",
3
- "version": "2.59.0",
3
+ "version": "2.59.3",
4
4
  "description": "Signal Messenger voice and video calling library.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "config": {
30
30
  "prebuildUrl": "https://build-artifacts.signal.org/libraries/ringrtc-desktop-build-v${npm_package_version}.tar.gz",
31
- "prebuildChecksum": "616acca5c1d1d6a12d0258a761880df80b937755db8ddebe0375e07a7c3e5a5f"
31
+ "prebuildChecksum": "b79c73ba870bbaad7dd1de621b6731b943eac036f00559ce660d9af97f5aae26"
32
32
  },
33
33
  "author": "",
34
34
  "license": "AGPL-3.0-only",