Cleanup, start script
This commit is contained in:
parent
c6d8180743
commit
e22373233e
5 changed files with 37 additions and 13 deletions
|
@ -7,7 +7,7 @@ main.out: main.o stream_wrapper.o ringbuffer.o passthrough.o
|
|||
|
||||
stream_wrapper.o: stream_wrapper.cc stream_wrapper.h
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
main.o: main.cc circ_buffer.h
|
||||
main.o: main.cc
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
ringbuffer.o: ringbuffer.cc ringbuffer.h
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
pw-link aec-sink:
|
||||
|
||||
pw-link aec-playback:output_FL pw-record:input_FL
|
||||
pw-link aec-playback:output_FR alsa_output.pci-0000_00_1b.0.analog-stereo.playback_FR
|
|
@ -9,7 +9,6 @@
|
|||
#include "spa/param/audio/format-utils.h"
|
||||
#include "spa/param/latency-utils.h"
|
||||
|
||||
#include "circ_buffer.h"
|
||||
#include "passthrough.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
@ -22,7 +21,7 @@ int main(int argc, char** argv) {
|
|||
return 1;
|
||||
}
|
||||
logger_record lr(pw_thread_loop_get_loop(tloop), &rb);
|
||||
logger_playback lp(pw_thread_loop_get_loop(tloop), &rb, true, true);
|
||||
logger_playback lp(pw_thread_loop_get_loop(tloop), &rb);
|
||||
|
||||
pw_thread_loop_start(tloop);
|
||||
|
||||
|
|
25
pw_plugin/start.sh
Executable file
25
pw_plugin/start.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
pactl unload-module module-null-sink # Just kill all null sinks
|
||||
|
||||
pactl load-module module-null-sink sink_name=AEC_sink sink_properties=device.description=AEC_sink
|
||||
pactl set-default-sink AEC_sink
|
||||
|
||||
pactl load-module module-null-sink sink_name=AEC_out sink_properties=device.description=AEC_out
|
||||
pactl set-default-source AEC_out.monitor
|
||||
|
||||
# Launch main.out; ideally it should not autoconnect
|
||||
./main.out &
|
||||
sleep 1
|
||||
|
||||
pw-link AEC_sink:monitor_FL aec-sink:input_FL
|
||||
pw-link AEC_sink:monitor_FR aec-sink:input_FR
|
||||
|
||||
pw-link aec-playback:output_FL alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo:playback_FL
|
||||
pw-link aec-playback:output_FR alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo:playback_FR
|
||||
|
||||
pw-link alsa_input.pci-0000_00_1b.0.analog-stereo:capture_FL aec-record:input_FL
|
||||
pw-link alsa_input.pci-0000_00_1b.0.analog-stereo:capture_FR aec-record:input_FR
|
||||
|
||||
pw-link aec-output:capture_FL AEC_out:input_FL
|
||||
pw-link aec-output:capture_FR AEC_out:input_FR
|
|
@ -8,18 +8,24 @@ pw_loop* lp, const char* name, pw_properties* props):
|
|||
|
||||
b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
|
||||
|
||||
auto fmt = SPA_AUDIO_INFO_RAW_INIT(
|
||||
.format = SPA_AUDIO_FORMAT_F32LE,
|
||||
spa_audio_info_raw fmt = {
|
||||
.format = SPA_AUDIO_FORMAT_F32,
|
||||
.rate = rate,
|
||||
.channels = channels,
|
||||
);
|
||||
.position = {SPA_AUDIO_CHANNEL_MONO}
|
||||
};
|
||||
|
||||
if(channels==2) {
|
||||
fmt.position[0] = SPA_AUDIO_CHANNEL_FL;
|
||||
fmt.position[1] = SPA_AUDIO_CHANNEL_FR;
|
||||
}
|
||||
|
||||
params[0] = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat, &fmt);
|
||||
|
||||
pw_stream_connect(strm,
|
||||
(direction ? PW_DIRECTION_OUTPUT : PW_DIRECTION_INPUT),
|
||||
PW_ID_ANY,
|
||||
(pw_stream_flags) (PW_STREAM_FLAG_AUTOCONNECT |
|
||||
(pw_stream_flags) (
|
||||
PW_STREAM_FLAG_MAP_BUFFERS |
|
||||
PW_STREAM_FLAG_RT_PROCESS), params, 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue