diff --git a/Questions_for_Nils.md b/Questions_for_Nils.md new file mode 100644 index 0000000..9b8cbee --- /dev/null +++ b/Questions_for_Nils.md @@ -0,0 +1,12 @@ +# Questions for Nils + +1. Why are there system and user systemd services for twonder and cwonder? Which one should be used? +2. I believe we are using the user services for twonder and cwonder. +3. The jack.service file has After=sound.target local-fs.target, but these targets do not exist on the systems. Why are they there? +4. Where is the include directory path for the config.h file defined? +5. The config.h.in file is is not needed right? +6. All those scripts in the scripts directory are not needed right? Except for the start-twonder.sh script. +7. Where is the Dante pcie driver from? +8. Is pinging really needed for the twonder and cwonder services? And if not, cann't we just go without jfwonder? +9. Do you know what the twonder_config.xml file is for and the the Negative Delay in the cluster configuration? +10. Why shall we need jfwonder? diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..b70ca9b --- /dev/null +++ b/TODO.md @@ -0,0 +1,5 @@ +# TODO + +- [x] Add runpaths to the final executables +- [ ] Uncomment the saving of old clients +- [ ] Change the default paths of c and t wonder config files diff --git a/configs/EN325/cluster.conf b/configs/EN325/cluster.conf deleted file mode 100644 index b8bc11b..0000000 --- a/configs/EN325/cluster.conf +++ /dev/null @@ -1,22 +0,0 @@ -# This file contains shared information for the WONDER modules - -# USER_NAME='studio'; - -CWONDER_IP='130.149.23.24'; - -# Ping rate of cwonder in seconds (uses JACK_SAMPLERATE to calculate seconds) -CWONDER_PING=2; - -NUM_SOURCES=64; - -# Negative delay for focused sources (in meters) -NEG_DELAY=7.585; - -# Execute this command to list all devices and insert the name in the square brackets behind the "hw:" part, e.g. 'hw:Intel': cat /proc/asound/cards -JACK_DEVICE='hw:DantePCIe'; - -JACK_BLOCKSIZE=512; -JACK_SAMPLERATE=48000; - -JACK_INPUTS=128; -JACK_OUTPUTS=128; diff --git a/configs/EN325/twonder_riviera.conf b/configs/EN325/twonder_riviera.conf deleted file mode 100644 index 5892ef8..0000000 --- a/configs/EN325/twonder_riviera.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Array of twonder output channels - -NODE=riviera; -CHANNELS='16 16 16 16'; diff --git a/configs/EN325/twonder_wintermute.conf b/configs/EN325/twonder_wintermute.conf deleted file mode 100644 index 82a3998..0000000 --- a/configs/EN325/twonder_wintermute.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Array of twonder output channels - -NODE=wintermute; -CHANNELS='16 16 16 16 16 16 16 16'; diff --git a/docs/Installation/Build.md b/docs/Installation/Build.md index 7cf7631..2f6e257 100644 --- a/docs/Installation/Build.md +++ b/docs/Installation/Build.md @@ -80,6 +80,6 @@ can change the owner of files in your build directory to root. Running |Files|Location| |--- |--- | -|Startup Scripts |*/usr/share/wonder/scripts*| -|XML DTD |*/usr/share/wonder/dtd*| -|Configuration files|*/etc/wonder*| +|Startup Scripts |*/usr/local/share/wonder/scripts*| +|XML DTD |*/usr/local/share/wonder/dtd*| +|Configuration files|*/usr/local/etc/wonder*| diff --git a/docs/Installation/Config.md b/docs/Installation/Config.md index 61cfd8f..214ea4a 100644 --- a/docs/Installation/Config.md +++ b/docs/Installation/Config.md @@ -1,10 +1,10 @@ # Wonder Configuration -Wonder's configuration files must be put in `/etc/wonder`. +Wonder's configuration files must be put in `/usr/local/etc/wonder`. ## Cluster configuration -`/etc/wonder/cluster.conf` sets environment variables for wonder. You should +`/usr/local/etc/wonder/cluster.conf` sets environment variables for wonder. You should set the IP address of your CWonder machine, the JACK setup information and the negative delay length in meters for focused sources. @@ -31,7 +31,7 @@ JACK_OUTPUTS=128; ## CWonder -`/etc/wonder/cwonder_config.xml` sets the project path, number of sources and room geometry. +`/usr/local/etc/wonder/cwonder_config.xml` sets the project path, number of sources and room geometry. ## TWonder diff --git a/examples/config/EN325/meson.build b/examples/config/EN325/meson.build new file mode 100644 index 0000000..541bc88 --- /dev/null +++ b/examples/config/EN325/meson.build @@ -0,0 +1,6 @@ +message('Installing configuration files for the TU-Studio EN325.') +message('The configuration files are installed to ' + get_option('prefix') + '/' + get_option('sysconfdir') + '.') + +message('This is the node: ' + get_option('node')) + +subdir('wonder') \ No newline at end of file diff --git a/examples/config/EN325/wonder/cluster.conf b/examples/config/EN325/wonder/cluster.conf new file mode 100644 index 0000000..d28c0b7 --- /dev/null +++ b/examples/config/EN325/wonder/cluster.conf @@ -0,0 +1,10 @@ +# This file contains shared information for the WONDER modules + +# USER_NAME='studio'; + +CWONDER_IP='130.149.23.24'; + +NUM_SOURCES=128; + +# Negative delay for focused sources (in meters) +NEG_DELAY=7.585; \ No newline at end of file diff --git a/configs/EN325/cwonder_config.xml b/examples/config/EN325/wonder/cwonder/cwonder_config.xml similarity index 98% rename from configs/EN325/cwonder_config.xml rename to examples/config/EN325/wonder/cwonder/cwonder_config.xml index 8d12b20..2c03db0 100644 --- a/configs/EN325/cwonder_config.xml +++ b/examples/config/EN325/wonder/cwonder/cwonder_config.xml @@ -31,8 +31,8 @@ - - + + diff --git a/examples/config/EN325/wonder/meson.build b/examples/config/EN325/wonder/meson.build new file mode 100644 index 0000000..a2273b8 --- /dev/null +++ b/examples/config/EN325/wonder/meson.build @@ -0,0 +1,19 @@ +# The speaker configurations need to have the same folder structure for the twonder start script to work. +# Also the speaker configurations need to start with twonder. + +if get_option('node') == 'none' + error('Please specify location with -Dnode=...') +elif get_option('node') == 'riviera' + message('Installing configuration for node riviera.') + install_subdir('cwonder', install_dir : get_option('sysconfdir') / 'wonder') + install_subdir('twonder/riviera', strip_directory : true, install_dir : get_option('sysconfdir') / 'wonder' / 'twonder') +elif get_option('node') == 'wintermute' + message('Installing configuration for node wintermute.') + install_subdir('twonder/wintermute', strip_directory : true, install_dir : get_option('sysconfdir') / 'wonder' / 'twonder') +else + error('Unknown node specified.') +endif + +# Install the remaining files if the node is correct, no error is thrown. +install_data('cluster.conf', install_dir : get_option('sysconfdir') / 'wonder') +install_data('twonder/twonder_config.xml', install_dir : get_option('sysconfdir') / 'wonder' / 'twonder') \ No newline at end of file diff --git a/configs/EN325/speakers/riviera/twonder_speakerarray1.xml b/examples/config/EN325/wonder/twonder/riviera/speaker-positions/twonder_speakerarray_1.xml similarity index 100% rename from configs/EN325/speakers/riviera/twonder_speakerarray1.xml rename to examples/config/EN325/wonder/twonder/riviera/speaker-positions/twonder_speakerarray_1.xml diff --git a/configs/EN325/speakers/riviera/twonder_speakerarray2.xml b/examples/config/EN325/wonder/twonder/riviera/speaker-positions/twonder_speakerarray_2.xml similarity index 100% rename from configs/EN325/speakers/riviera/twonder_speakerarray2.xml rename to examples/config/EN325/wonder/twonder/riviera/speaker-positions/twonder_speakerarray_2.xml diff --git a/configs/EN325/speakers/riviera/twonder_speakerarray3.xml b/examples/config/EN325/wonder/twonder/riviera/speaker-positions/twonder_speakerarray_3.xml similarity index 100% rename from configs/EN325/speakers/riviera/twonder_speakerarray3.xml rename to examples/config/EN325/wonder/twonder/riviera/speaker-positions/twonder_speakerarray_3.xml diff --git a/configs/EN325/speakers/riviera/twonder_speakerarray4.xml b/examples/config/EN325/wonder/twonder/riviera/speaker-positions/twonder_speakerarray_4.xml similarity index 100% rename from configs/EN325/speakers/riviera/twonder_speakerarray4.xml rename to examples/config/EN325/wonder/twonder/riviera/speaker-positions/twonder_speakerarray_4.xml diff --git a/configs/EN325/twonder_config.xml b/examples/config/EN325/wonder/twonder/twonder_config.xml similarity index 100% rename from configs/EN325/twonder_config.xml rename to examples/config/EN325/wonder/twonder/twonder_config.xml diff --git a/configs/EN325/speakers/wintermute/twonder_speakerarray1.xml b/examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_1.xml similarity index 100% rename from configs/EN325/speakers/wintermute/twonder_speakerarray1.xml rename to examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_1.xml diff --git a/configs/EN325/speakers/wintermute/twonder_speakerarray2.xml b/examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_2.xml similarity index 100% rename from configs/EN325/speakers/wintermute/twonder_speakerarray2.xml rename to examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_2.xml diff --git a/configs/EN325/speakers/wintermute/twonder_speakerarray3.xml b/examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_3.xml similarity index 100% rename from configs/EN325/speakers/wintermute/twonder_speakerarray3.xml rename to examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_3.xml diff --git a/configs/EN325/speakers/wintermute/twonder_speakerarray4.xml b/examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_4.xml similarity index 100% rename from configs/EN325/speakers/wintermute/twonder_speakerarray4.xml rename to examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_4.xml diff --git a/configs/EN325/speakers/wintermute/twonder_speakerarray5.xml b/examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_5.xml similarity index 100% rename from configs/EN325/speakers/wintermute/twonder_speakerarray5.xml rename to examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_5.xml diff --git a/configs/EN325/speakers/wintermute/twonder_speakerarray6.xml b/examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_6.xml similarity index 100% rename from configs/EN325/speakers/wintermute/twonder_speakerarray6.xml rename to examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_6.xml diff --git a/configs/EN325/speakers/wintermute/twonder_speakerarray7.xml b/examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_7.xml similarity index 100% rename from configs/EN325/speakers/wintermute/twonder_speakerarray7.xml rename to examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_7.xml diff --git a/configs/EN325/speakers/wintermute/twonder_speakerarray8.xml b/examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_8.xml similarity index 100% rename from configs/EN325/speakers/wintermute/twonder_speakerarray8.xml rename to examples/config/EN325/wonder/twonder/wintermute/speakers-positions/twonder_speakerarray_8.xml diff --git a/configs/HAW/cluster.conf b/examples/config/HAW-draft/cluster.conf similarity index 100% rename from configs/HAW/cluster.conf rename to examples/config/HAW-draft/cluster.conf diff --git a/configs/HAW/cwonder_config.xml b/examples/config/HAW-draft/cwonder_config.xml similarity index 100% rename from configs/HAW/cwonder_config.xml rename to examples/config/HAW-draft/cwonder_config.xml diff --git a/configs/HAW/speakers/HAW-WFS-Lab.png b/examples/config/HAW-draft/speakers/HAW-WFS-Lab.png similarity index 100% rename from configs/HAW/speakers/HAW-WFS-Lab.png rename to examples/config/HAW-draft/speakers/HAW-WFS-Lab.png diff --git a/configs/HAW/speakers/n101/twonder_speakerarray1.xml b/examples/config/HAW-draft/speakers/n101/twonder_speakerarray1.xml similarity index 100% rename from configs/HAW/speakers/n101/twonder_speakerarray1.xml rename to examples/config/HAW-draft/speakers/n101/twonder_speakerarray1.xml diff --git a/configs/HAW/speakers/n101/twonder_speakerarray2.xml b/examples/config/HAW-draft/speakers/n101/twonder_speakerarray2.xml similarity index 100% rename from configs/HAW/speakers/n101/twonder_speakerarray2.xml rename to examples/config/HAW-draft/speakers/n101/twonder_speakerarray2.xml diff --git a/configs/HAW/speakers/n101/twonder_speakerarray3.xml b/examples/config/HAW-draft/speakers/n101/twonder_speakerarray3.xml similarity index 100% rename from configs/HAW/speakers/n101/twonder_speakerarray3.xml rename to examples/config/HAW-draft/speakers/n101/twonder_speakerarray3.xml diff --git a/configs/HAW/speakers/n101/twonder_speakerarray4.xml b/examples/config/HAW-draft/speakers/n101/twonder_speakerarray4.xml similarity index 100% rename from configs/HAW/speakers/n101/twonder_speakerarray4.xml rename to examples/config/HAW-draft/speakers/n101/twonder_speakerarray4.xml diff --git a/configs/HAW/speakers/n101/twonder_speakerarray5.xml b/examples/config/HAW-draft/speakers/n101/twonder_speakerarray5.xml similarity index 100% rename from configs/HAW/speakers/n101/twonder_speakerarray5.xml rename to examples/config/HAW-draft/speakers/n101/twonder_speakerarray5.xml diff --git a/configs/HAW/speakers/n101/twonder_speakerarray6.xml b/examples/config/HAW-draft/speakers/n101/twonder_speakerarray6.xml similarity index 100% rename from configs/HAW/speakers/n101/twonder_speakerarray6.xml rename to examples/config/HAW-draft/speakers/n101/twonder_speakerarray6.xml diff --git a/configs/HAW/speakers/n101/twonder_speakerarray7.xml b/examples/config/HAW-draft/speakers/n101/twonder_speakerarray7.xml similarity index 100% rename from configs/HAW/speakers/n101/twonder_speakerarray7.xml rename to examples/config/HAW-draft/speakers/n101/twonder_speakerarray7.xml diff --git a/configs/HAW/speakers/n102/twonder_speakerarray1.xml b/examples/config/HAW-draft/speakers/n102/twonder_speakerarray1.xml similarity index 100% rename from configs/HAW/speakers/n102/twonder_speakerarray1.xml rename to examples/config/HAW-draft/speakers/n102/twonder_speakerarray1.xml diff --git a/configs/HAW/speakers/n102/twonder_speakerarray2.xml b/examples/config/HAW-draft/speakers/n102/twonder_speakerarray2.xml similarity index 100% rename from configs/HAW/speakers/n102/twonder_speakerarray2.xml rename to examples/config/HAW-draft/speakers/n102/twonder_speakerarray2.xml diff --git a/configs/HAW/speakers/n102/twonder_speakerarray3.xml b/examples/config/HAW-draft/speakers/n102/twonder_speakerarray3.xml similarity index 100% rename from configs/HAW/speakers/n102/twonder_speakerarray3.xml rename to examples/config/HAW-draft/speakers/n102/twonder_speakerarray3.xml diff --git a/configs/HAW/speakers/n102/twonder_speakerarray4.xml b/examples/config/HAW-draft/speakers/n102/twonder_speakerarray4.xml similarity index 100% rename from configs/HAW/speakers/n102/twonder_speakerarray4.xml rename to examples/config/HAW-draft/speakers/n102/twonder_speakerarray4.xml diff --git a/configs/HAW/speakers/n102/twonder_speakerarray5.xml b/examples/config/HAW-draft/speakers/n102/twonder_speakerarray5.xml similarity index 100% rename from configs/HAW/speakers/n102/twonder_speakerarray5.xml rename to examples/config/HAW-draft/speakers/n102/twonder_speakerarray5.xml diff --git a/configs/HAW/speakers/n102/twonder_speakerarray6.xml b/examples/config/HAW-draft/speakers/n102/twonder_speakerarray6.xml similarity index 100% rename from configs/HAW/speakers/n102/twonder_speakerarray6.xml rename to examples/config/HAW-draft/speakers/n102/twonder_speakerarray6.xml diff --git a/configs/HAW/speakers/n102/twonder_speakerarray7.xml b/examples/config/HAW-draft/speakers/n102/twonder_speakerarray7.xml similarity index 100% rename from configs/HAW/speakers/n102/twonder_speakerarray7.xml rename to examples/config/HAW-draft/speakers/n102/twonder_speakerarray7.xml diff --git a/configs/HAW/twonder_config.xml b/examples/config/HAW-draft/twonder_config.xml similarity index 100% rename from configs/HAW/twonder_config.xml rename to examples/config/HAW-draft/twonder_config.xml diff --git a/configs/HAW/twonder_n101.conf b/examples/config/HAW-draft/twonder_n101.conf similarity index 100% rename from configs/HAW/twonder_n101.conf rename to examples/config/HAW-draft/twonder_n101.conf diff --git a/configs/HAW/twonder_n102.conf b/examples/config/HAW-draft/twonder_n102.conf similarity index 100% rename from configs/HAW/twonder_n102.conf rename to examples/config/HAW-draft/twonder_n102.conf diff --git a/configs/HAW/twonder_speakerarray.xml b/examples/config/HAW-draft/twonder_speakerarray.xml similarity index 100% rename from configs/HAW/twonder_speakerarray.xml rename to examples/config/HAW-draft/twonder_speakerarray.xml diff --git a/configs/HuFo/cluster.conf b/examples/config/HuFo-draft/cluster.conf similarity index 100% rename from configs/HuFo/cluster.conf rename to examples/config/HuFo-draft/cluster.conf diff --git a/configs/HuFo/cwonder_config.xml b/examples/config/HuFo-draft/cwonder_config.xml similarity index 100% rename from configs/HuFo/cwonder_config.xml rename to examples/config/HuFo-draft/cwonder_config.xml diff --git a/configs/HuFo/speakers/RE02/twonder_speakerarray1.xml b/examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray1.xml similarity index 100% rename from configs/HuFo/speakers/RE02/twonder_speakerarray1.xml rename to examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray1.xml diff --git a/configs/HuFo/speakers/RE02/twonder_speakerarray2.xml b/examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray2.xml similarity index 100% rename from configs/HuFo/speakers/RE02/twonder_speakerarray2.xml rename to examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray2.xml diff --git a/configs/HuFo/speakers/RE02/twonder_speakerarray3.xml b/examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray3.xml similarity index 100% rename from configs/HuFo/speakers/RE02/twonder_speakerarray3.xml rename to examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray3.xml diff --git a/configs/HuFo/speakers/RE02/twonder_speakerarray4.xml b/examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray4.xml similarity index 100% rename from configs/HuFo/speakers/RE02/twonder_speakerarray4.xml rename to examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray4.xml diff --git a/configs/HuFo/speakers/RE02/twonder_speakerarray5.xml b/examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray5.xml similarity index 100% rename from configs/HuFo/speakers/RE02/twonder_speakerarray5.xml rename to examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray5.xml diff --git a/configs/HuFo/speakers/RE02/twonder_speakerarray6.xml b/examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray6.xml similarity index 100% rename from configs/HuFo/speakers/RE02/twonder_speakerarray6.xml rename to examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray6.xml diff --git a/configs/HuFo/speakers/RE02/twonder_speakerarray7.xml b/examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray7.xml similarity index 100% rename from configs/HuFo/speakers/RE02/twonder_speakerarray7.xml rename to examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray7.xml diff --git a/configs/HuFo/speakers/RE02/twonder_speakerarray8.xml b/examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray8.xml similarity index 100% rename from configs/HuFo/speakers/RE02/twonder_speakerarray8.xml rename to examples/config/HuFo-draft/speakers/RE02/twonder_speakerarray8.xml diff --git a/configs/HuFo/speakers/RE03/twonder_speakerarray1.xml b/examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray1.xml similarity index 100% rename from configs/HuFo/speakers/RE03/twonder_speakerarray1.xml rename to examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray1.xml diff --git a/configs/HuFo/speakers/RE03/twonder_speakerarray2.xml b/examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray2.xml similarity index 100% rename from configs/HuFo/speakers/RE03/twonder_speakerarray2.xml rename to examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray2.xml diff --git a/configs/HuFo/speakers/RE03/twonder_speakerarray3.xml b/examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray3.xml similarity index 100% rename from configs/HuFo/speakers/RE03/twonder_speakerarray3.xml rename to examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray3.xml diff --git a/configs/HuFo/speakers/RE03/twonder_speakerarray4.xml b/examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray4.xml similarity index 100% rename from configs/HuFo/speakers/RE03/twonder_speakerarray4.xml rename to examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray4.xml diff --git a/configs/HuFo/speakers/RE03/twonder_speakerarray5.xml b/examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray5.xml similarity index 100% rename from configs/HuFo/speakers/RE03/twonder_speakerarray5.xml rename to examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray5.xml diff --git a/configs/HuFo/speakers/RE03/twonder_speakerarray6.xml b/examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray6.xml similarity index 100% rename from configs/HuFo/speakers/RE03/twonder_speakerarray6.xml rename to examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray6.xml diff --git a/configs/HuFo/speakers/RE03/twonder_speakerarray7.xml b/examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray7.xml similarity index 100% rename from configs/HuFo/speakers/RE03/twonder_speakerarray7.xml rename to examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray7.xml diff --git a/configs/HuFo/speakers/RE03/twonder_speakerarray8.xml b/examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray8.xml similarity index 100% rename from configs/HuFo/speakers/RE03/twonder_speakerarray8.xml rename to examples/config/HuFo-draft/speakers/RE03/twonder_speakerarray8.xml diff --git a/configs/HuFo/twonder_RE02.conf b/examples/config/HuFo-draft/twonder_RE02.conf similarity index 100% rename from configs/HuFo/twonder_RE02.conf rename to examples/config/HuFo-draft/twonder_RE02.conf diff --git a/configs/HuFo/twonder_RE03.conf b/examples/config/HuFo-draft/twonder_RE03.conf similarity index 100% rename from configs/HuFo/twonder_RE03.conf rename to examples/config/HuFo-draft/twonder_RE03.conf diff --git a/configs/HuFo/twonder_config.xml b/examples/config/HuFo-draft/twonder_config.xml similarity index 100% rename from configs/HuFo/twonder_config.xml rename to examples/config/HuFo-draft/twonder_config.xml diff --git a/projects/empty.xml b/examples/projects/empty.xml similarity index 100% rename from projects/empty.xml rename to examples/projects/empty.xml diff --git a/meson.build b/meson.build index 124c163..f8c9bd0 100644 --- a/meson.build +++ b/meson.build @@ -14,37 +14,36 @@ libsystemd_dep = dependency('libsystemd', required: get_option('systemd')) fmt_dep = dependency('fmt') if libsystemd_dep.found() - defines += '-DWONDER_SYSTEMD' + defines += '-DWONDER_SYSTEMD' # the defines are passed to the excecutables as cppargs endif subdir('src/include') inc = include_directories('src/include') +lib_dir = get_option('prefix') / get_option('libdir') +message('Library directory: ' + lib_dir) subdir('src/lib') subdir('src/cwonder') -subdir('src/jfwonder') -subdir('src/score') +# subdir('src/jfwonder') +# subdir('src/score') subdir('src/twonder') -if get_option('xwonder') == true - qt5 = import('qt5') - qt5_dep = dependency('qt5', modules: ['Core', 'Gui', 'Widgets', 'OpenGL', 'Xml'], include_type: 'system') - glu_dep = dependency('glu') - subdir('src/xwonder') -endif +# if get_option('xwonder') == true +# qt5 = import('qt5') +# qt5_dep = dependency('qt5', modules: ['Core', 'Gui', 'Widgets', 'OpenGL', 'Xml'], include_type: 'system') +# glu_dep = dependency('glu') +# subdir('src/xwonder') +# endif if systemd_dep.found() subdir('services') endif -config_dir = '/etc/wonder' -if get_option('location') == 'none' - message('No location configuration selected.') -elif get_option('location') == 'EN325' - install_subdir('configs/EN325', strip_directory: true, install_dir : config_dir ) -elif get_option('location') == 'HUFO' - install_subdir('configs/HuFo', strip_directory: true, install_dir : config_dir ) -endif +# The configuration directory for locally installed programs should be /usr/local/etc/wonder and not to /etc/wonder as before +# Configuration files examples are in config/examples and could be installed as follows: +# subdir('config/examples/EN325') +# For this to work the option 'location' and 'node' need to be set in the meson.options file +# With install_dir: install_dir: get_option('datadir') the files are installed in the usr/local/share/ directory install_subdir('scripts', install_dir: get_option('datadir') / 'wonder') install_subdir('dtd', install_dir: get_option('datadir') / 'wonder') @@ -52,5 +51,4 @@ summary({'CWonder': true, 'TWonder': true, 'JFWonder': get_option('jfwonder'), 'XWonder': get_option('xwonder'), - 'ScorePlayer': get_option('scoreplayer')}, bool_yn: true, section: 'Components') -summary({'Location': get_option('location'), 'Directory': config_dir}, section: 'Configuration') + 'ScorePlayer': get_option('scoreplayer')}, bool_yn: true, section: 'Components') \ No newline at end of file diff --git a/meson_options.txt b/meson.options similarity index 64% rename from meson_options.txt rename to meson.options index 54c712c..94062cb 100644 --- a/meson_options.txt +++ b/meson.options @@ -2,4 +2,3 @@ option('xwonder', type : 'boolean', value : false) option('jfwonder', type : 'boolean', value : true) option('scoreplayer', type : 'boolean', value : true) option('systemd', type : 'feature', value : 'auto') -option('location', type : 'combo', choices: ['none', 'EN325', 'HUFO'], value : 'none', description : 'Set location') diff --git a/scripts/cluster/reboot.sh b/scripts/cluster/reboot.sh deleted file mode 100755 index cfbbb09..0000000 --- a/scripts/cluster/reboot.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Read config -SCRIPTDIR=`dirname $0` -source ${SCRIPTDIR}/../configs/cluster.conf - -for node in $CLUSTER_NODES; -do - rsh $USER_NAME@$node sudo reboot now -done diff --git a/scripts/cluster/shutdown.sh b/scripts/cluster/shutdown.sh deleted file mode 100755 index 38e74ba..0000000 --- a/scripts/cluster/shutdown.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Read config -SCRIPTDIR=`dirname $0` -source ${SCRIPTDIR}/../configs/cluster.conf - -for node in $CLUSTER_NODES; -do - rsh $USER_NAME@$node sudo shutdown -h now -done diff --git a/scripts/connections/connect-all-twonder.sh b/scripts/connections/connect-all-twonder.sh deleted file mode 100755 index bb5edd7..0000000 --- a/scripts/connections/connect-all-twonder.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# read config -SCRIPTDIR=`dirname $0` -source ${SCRIPTDIR}/../configs/cluster.conf - -# For every node and every twonder instance running on it: -# - connect the inputs of the soundcard with the inputs (Source) of the twonder instance -# - connect the outputs (Speaker) of the twonder instance with the outputs of the soundcard -for node in $CLUSTER_NODES; -do - ssh $USER_NAME@$node "/opt/wonder/current/scripts/connections/connect-twonder.sh $node > /dev/null &" -done diff --git a/scripts/connections/connect-twonder.sh b/scripts/connections/connect-twonder.sh deleted file mode 100755 index 9198f42..0000000 --- a/scripts/connections/connect-twonder.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -NODE=$1 - -# Read config -SCRIPTDIR=`dirname $0` -source ${SCRIPTDIR}/../configs/cluster.conf -source ${SCRIPTDIR}/../configs/twonder_${NODE}.conf - -i=1; -playback=1; - -for NUM_CH in $CHANNELS; -do - # Connect the inputs of the soundcard with the inputs (Source) of a twonder instance - for j in $(seq 1 1 $NUM_SOURCES); - do - jack_connect system:capture_${j} twonder${i}:input$[${j}] &> /dev/null - done - - # Connect the outputs (Speaker) of a twonder instance with the outputs of the soundcard - for k in $(seq 1 1 $NUM_CH); - do - jack_connect twonder${i}:speaker$[${k}] system:playback_${playback} &> /dev/null - playback=$(($playback+1)); - done - - i=$(($i+1)); -done diff --git a/scripts/cwonder/start-cwonder.sh b/scripts/cwonder/start-cwonder.sh deleted file mode 100755 index 7e27269..0000000 --- a/scripts/cwonder/start-cwonder.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# Read config -SCRIPTDIR=`dirname $0` -source ${SCRIPTDIR}/../configs/cluster.conf - -/opt/wonder/current/bin/cwonder -c /opt/wonder/current/configs/cwonder_config.xml -r $(($CWONDER_PING * $JACK_SAMPLERATE)) & diff --git a/scripts/cwonder/stop-cwonder.sh b/scripts/cwonder/stop-cwonder.sh deleted file mode 100755 index 1857454..0000000 --- a/scripts/cwonder/stop-cwonder.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# Read config -SCRIPTDIR=`dirname $0` -source ${SCRIPTDIR}/../configs/cluster.conf - -killall cwonder diff --git a/scripts/jack/start-all-jackd.sh b/scripts/jack/start-all-jackd.sh deleted file mode 100755 index 9ce473f..0000000 --- a/scripts/jack/start-all-jackd.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Read config -SCRIPTDIR=`dirname $0` -source ${SCRIPTDIR}/../configs/cluster.conf - -for node in $CLUSTER_NODES; -do - ssh $USER_NAME@$node "/opt/wonder/current/scripts/jack/start-jackd.sh" -done diff --git a/scripts/jack/start-jackd.sh b/scripts/jack/start-jackd.sh deleted file mode 100755 index 683980c..0000000 --- a/scripts/jack/start-jackd.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# Read config -SCRIPTDIR=`dirname $0` -source ${SCRIPTDIR}/../configs/cluster.conf - -jackd -R -P 70 -p 4096 -d alsa -d ${JACK_DEVICE} -r ${JACK_SAMPLERATE} -p ${JACK_BLOCKSIZE} -i ${JACK_INPUTS} -o ${JACK_OUTPUTS} & diff --git a/scripts/jack/stop-all-jackd.sh b/scripts/jack/stop-all-jackd.sh deleted file mode 100755 index 8750495..0000000 --- a/scripts/jack/stop-all-jackd.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Read config -SCRIPTDIR=`dirname $0` -source ${SCRIPTDIR}/../configs/cluster.conf - -for node in $CLUSTER_NODES; -do - ssh $USER_NAME@$node "killall jackd" -done diff --git a/scripts/remote-start-wonder.sh b/scripts/remote-start-wonder.sh deleted file mode 100755 index c649caa..0000000 --- a/scripts/remote-start-wonder.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -SCRIPTDIR=`dirname $0` - -${SCRIPTDIR}/start-wonder.sh > /dev/null & - -exit 0; diff --git a/scripts/remote-status-status.sh b/scripts/remote-status-status.sh deleted file mode 100755 index 09b30f4..0000000 --- a/scripts/remote-status-status.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -SCRIPTDIR=`dirname $0` - -${SCRIPTDIR}/status-wonder.sh - diff --git a/scripts/remote-stop-wonder.sh b/scripts/remote-stop-wonder.sh deleted file mode 100755 index 64e067d..0000000 --- a/scripts/remote-stop-wonder.sh +++ /dev/null @@ -1,7 +0,0 @@ - #!/bin/bash - -SCRIPTDIR=`dirname $0` - -${SCRIPTDIR}/stop-wonder.sh > /dev/null & - -exit 0; diff --git a/scripts/start-wonder.sh b/scripts/start-wonder.sh deleted file mode 100755 index 1c04f9a..0000000 --- a/scripts/start-wonder.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Read config -SCRIPTDIR=`dirname $0` -source ${SCRIPTDIR}/configs/cluster.conf - -echo "Starting JACK-Server on all nodes..." -${SCRIPTDIR}/jack/start-all-jackd.sh - -echo "Starting cwonder on local machine..." -${SCRIPTDIR}/cwonder/start-cwonder.sh > /dev/null - -sleep 1 - -echo "Starting twonder on all nodes..." -${SCRIPTDIR}/twonder/start-all-twonder.sh - -sleep 1 - -echo "Connecting twonder with JACK-Server on all nodes..." -${SCRIPTDIR}/connections/connect-all-twonder.sh diff --git a/scripts/status-wonder.sh b/scripts/status-wonder.sh deleted file mode 100755 index 6daa38b..0000000 --- a/scripts/status-wonder.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -# Read config -SCRIPTDIR=`dirname $0` -source ${SCRIPTDIR}/configs/cluster.conf - -# Print JACK settings used by all nodes -echo "" -echo ".::| NODE SETTGINGS |::." -echo "JACK Device :" $JACK_DEVICE -echo "JACK Samplerate: $JACK_SAMPLERATE Hz" -echo "JACK Blocksize : $JACK_BLOCKSIZE Samples" -echo "JACK Inputs :" $JACK_INPUTS -echo "JACK Outputs :" $JACK_OUTPUTS -echo "Pre-Delay : $NEG_DELAY meters" - -## Scan control computer -echo "" -echo ".::| WFS CONTROL |::." -ssh $CWONDER_IP pstree | egrep "(jackd|cwonder|twonder|xwonder)" -echo "" - -# Scan nodes -for node in $CLUSTER_NODES; -do - echo $node; - ssh $USER_NAME@$node pstree | egrep "(jackd|cwonder|twonder|xwonder)" - echo "" -done -echo "" diff --git a/scripts/stop-wonder.sh b/scripts/stop-wonder.sh deleted file mode 100755 index 18e06ee..0000000 --- a/scripts/stop-wonder.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# Read config -SCRIPTDIR=`dirname $0` -source ${SCRIPTDIR}/configs/cluster.conf - -echo "Stopping twonder on all nodes..." -${SCRIPTDIR}/twonder/stop-all-twonder.sh - -sleep 1; - -echo "Stopping JACK-Server on all nodes..." -${SCRIPTDIR}/jack/stop-all-jackd.sh - -sleep 1; - -echo "Stopping cwonder on local machine..." -${SCRIPTDIR}/cwonder/stop-cwonder.sh diff --git a/scripts/twonder/start-all-twonder.sh b/scripts/twonder/start-all-twonder.sh deleted file mode 100755 index 45fd875..0000000 --- a/scripts/twonder/start-all-twonder.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Read config -SCRIPTDIR=`dirname $0` -source ${SCRIPTDIR}/../configs/cluster.conf - -for node in $CLUSTER_NODES; -do - ssh $USER_NAME@$node "/opt/wonder/current/scripts/twonder/start-twonder.sh $node" -done diff --git a/scripts/twonder/start-twonder.sh b/scripts/twonder/start-twonder.sh index b16f483..5fe8a8f 100755 --- a/scripts/twonder/start-twonder.sh +++ b/scripts/twonder/start-twonder.sh @@ -1,14 +1,15 @@ #!/bin/bash -# Read config -source /etc/wonder/cluster.conf -source /etc/wonder/twonder.conf +# This is the script with which we start twonder instances, it is executed by the systemd service. + +# This configuration file should be sourced by the systemd service +# source /usr/local/etc/wonder/cluster.conf i=1; -for NUM_CH in $CHANNELS; +for file in /usr/local/etc/wonder/twonder/speaker-positions/twonder_*; do - twonder ${TWONDER_ARGS} -c /etc/wonder/twonder_config.xml -s /etc/wonder/speakers/${NODE}/twonder_speakerarray$i.xml -i $CWONDER_IP -j twonder$i -o $((58200 + $i)) --negdelay $NEG_DELAY & + # for debugging the --verbose flag can be added to the command line + twonder ${TWONDER_ARGS} -c /usr/local/etc/wonder/twonder/twonder_config.xml -s $file -i $CWONDER_IP -j twonder$i -o $((58200 + $i)) --negdelay $NEG_DELAY & i=$(($i+1)); - sleep 1; done diff --git a/scripts/twonder/stop-all-twonder.sh b/scripts/twonder/stop-all-twonder.sh deleted file mode 100755 index 7651d15..0000000 --- a/scripts/twonder/stop-all-twonder.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Read config -SCRIPTDIR=`dirname $0` -source ${SCRIPTDIR}/../configs/cluster.conf - -for node in $CLUSTER_NODES; -do - ssh $USER_NAME@$node "killall twonder" -done diff --git a/services/cwonder.service.in b/services/cwonder.service.in index a0951b6..da6c673 100644 --- a/services/cwonder.service.in +++ b/services/cwonder.service.in @@ -1,15 +1,15 @@ [Unit] Description=CWonder -After=network-online.target [Install] +# There is no multi-user.target for a user service, therefore we use default.target WantedBy=default.target [Service] Type=notify PrivateTmp=true -EnvironmentFile=/etc/wonder/cluster.conf -ExecStart=@bin_dir@/cwonder -c /etc/wonder/cwonder_config.xml -r 2 -b +EnvironmentFile=/usr/local/etc/wonder/cluster.conf +ExecStart=@bin_dir@/cwonder -c /usr/local/etc/wonder/cwonder/cwonder_config.xml -r 2 -b LimitRTPRIO=95 LimitRTTIME=infinity LimitMEMLOCK=infinity diff --git a/services/cwonder@.service.in b/services/cwonder@.service.in deleted file mode 100644 index eeb02a1..0000000 --- a/services/cwonder@.service.in +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=CWonder -After=network-online.target jfwonder.service -Requires=jfwonder.service network-online.target - -[Install] -WantedBy=multi-user.target - -[Service] -Type=notify -PrivateTmp=true -EnvironmentFile=/etc/wonder/cluster.conf -ExecStart=@bin_dir@/cwonder -c /etc/wonder/cwonder_config.xml -r 2 -b -LimitRTPRIO=95 -LimitRTTIME=infinity -LimitMEMLOCK=infinity -User=%i diff --git a/services/jfwonder.service.in b/services/jfwonder.service.in deleted file mode 100644 index 685139c..0000000 --- a/services/jfwonder.service.in +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=JFWonder -After=network-online.target jack.service -Requires=jack.service - - -[Install] -WantedBy=default.target - -[Service] -Type=simple -PrivateTmp=true -# EnvironmentFile=/etc/wonder/cluster.conf -ExecStart=@bin_dir@/jfwonder -LimitRTPRIO=95 -LimitRTTIME=infinity -LimitMEMLOCK=infinity diff --git a/services/meson.build b/services/meson.build index f2c37f9..98a4a02 100644 --- a/services/meson.build +++ b/services/meson.build @@ -1,33 +1,19 @@ -conf_data = configuration_data() -conf_data.set('share_dir', get_option('prefix') / get_option('datadir') / 'wonder') -configure_file(input : 'twonder@.service.in', - output : 'twonder@.service', - configuration : conf_data, - install_dir : '/usr/lib/systemd/system') +# configure_file takes a file and replaces the @variables@ with the values from the configuration data +# the configuration data is a dictionary of key value pairs + +# the /usr/lib/systemd/user directory is used for user services but should only contain systemd files installed by the package manager of our distribution +# therefore we use the /etc/systemd/user directory which is used for user services that are installed by the user -conf_data2 = configuration_data() -conf_data2.set('bin_dir', get_option('prefix') / get_option('bindir')) -configure_file(input : 'cwonder@.service.in', - output : 'cwonder@.service', - configuration : conf_data2, - install_dir : '/usr/lib/systemd/system') conf_data = configuration_data() conf_data.set('share_dir', get_option('prefix') / get_option('datadir') / 'wonder') +conf_data.set('bin_dir', get_option('prefix') / get_option('bindir')) + configure_file(input : 'twonder.service.in', output : 'twonder.service', configuration : conf_data, - install_dir : '/usr/lib/systemd/user') + install_dir : '/etc/systemd/user') -conf_data2 = configuration_data() -conf_data2.set('bin_dir', get_option('prefix') / get_option('bindir')) configure_file(input : 'cwonder.service.in', output : 'cwonder.service', - configuration : conf_data2, - install_dir : '/usr/lib/systemd/user') - -conf_data2 = configuration_data() -conf_data2.set('bin_dir', get_option('prefix') / get_option('bindir')) -configure_file(input : 'jfwonder.service.in', - output : 'jfwonder.service', - configuration : conf_data2, - install_dir : '/usr/lib/systemd/user') + configuration : conf_data, + install_dir : '/etc/systemd/user') diff --git a/services/twonder.service.in b/services/twonder.service.in index 37ed4da..f23c345 100644 --- a/services/twonder.service.in +++ b/services/twonder.service.in @@ -1,6 +1,6 @@ [Unit] Description=TWonder -After=network-online.target jack.service +After=jack.service Requires=jack.service [Install] @@ -9,8 +9,7 @@ WantedBy=default.target [Service] Type=forking PrivateTmp=true -WorkingDirectory=@share_dir@/scripts/twonder/ -ExecStartPre=sleep 5 +EnvironmentFile=/usr/local/etc/wonder/cluster.conf ExecStart=@share_dir@/scripts/twonder/start-twonder.sh LimitRTPRIO=95 LimitRTTIME=infinity diff --git a/services/twonder@.service.in b/services/twonder@.service.in deleted file mode 100644 index 3df349c..0000000 --- a/services/twonder@.service.in +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=TWonder -After=network-online.target jack.service -Requires=network-online.target jack.service - -[Install] -WantedBy=multi-user.target - -[Service] -Type=forking -PrivateTmp=true -WorkingDirectory=@share_dir@/scripts/twonder/ -ExecStart=@share_dir@/scripts/twonder/start-twonder.sh -LimitRTPRIO=95 -LimitRTTIME=infinity -LimitMEMLOCK=infinity -User=%i diff --git a/src/cwonder/meson.build b/src/cwonder/meson.build index ff16475..06ae842 100644 --- a/src/cwonder/meson.build +++ b/src/cwonder/meson.build @@ -6,10 +6,12 @@ cwonder_src = ['cwonder.cpp', 'oscping.cpp', 'oscstream.cpp'] +# Install true installs the executable to the /usr/local/bin directory executable('cwonder', cwonder_src, include_directories: inc, + install_rpath : lib_dir, dependencies: [xml_dep, thread_dep, liblo_dep, libsystemd_dep], cpp_args: defines, link_with: libwonder, install: true - ) + ) \ No newline at end of file diff --git a/src/cwonder/oscstream.cpp b/src/cwonder/oscstream.cpp index 14bc33c..d27776a 100644 --- a/src/cwonder/oscstream.cpp +++ b/src/cwonder/oscstream.cpp @@ -4,7 +4,7 @@ * http://swonder.sourceforge.net * * * * * - * Technische Universität Berlin, Germany * + * Technische Universit�t Berlin, Germany * * Audio Communication Group * * www.ak.tu-berlin.de * * Copyright 2006-2008 * @@ -76,6 +76,7 @@ OSCStream::~OSCStream() { << clientsIter->name << "\n"; } statefile.close(); + std::cout << "Saved " << name << " client list to " << statefilename << "\n"; } else { std::cerr << "Couldn't write " << name << " client list to " << statefilename << "\n"; } diff --git a/src/include/config.h.in b/src/include/config.h.in deleted file mode 100644 index 3f298b9..0000000 --- a/src/include/config.h.in +++ /dev/null @@ -1,39 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * * - * WONDER - Wave field synthesis Of New Dimensions of Electronic music in Realtime * - * http://swonder.sourceforge.net * - * * - * * - * Technische Universität Berlin, Germany * - * Audio Communication Group * - * www.ak.tu-berlin.de * - * Copyright 2006-2008 * - * * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -//////////////// generated by scons //////////////// - -/** - * \file config.h Defines for wonder set by scons - */ - -#define INSTALL_PREFIX "%(install_directory)s" - -#define VERSION_STR "%(version_str)s" - -#define BUILD "%(build)s" diff --git a/src/include/meson.build b/src/include/meson.build index 3ad82c0..4e6b614 100644 --- a/src/include/meson.build +++ b/src/include/meson.build @@ -1,6 +1,9 @@ conf_data = configuration_data() conf_data.set('VERSION_STR', meson.project_version()) -conf_data.set_quoted('CONFIG_DIR', '/etc/wonder') +conf_data.set_quoted('CONFIG_DIR', '/usr/local/etc/wonder') conf_data.set_quoted('DATA_DIR', get_option('prefix') / get_option('datadir') / 'wonder') configure_file(output: 'config.h', configuration: conf_data) +# This configuration file is generated by Meson and saved in the build directory in the same folder as in our repo structure. +# We do not need to install it, since we do not build a shared library. +message('conf_data is :\n' + 'VERSION_STR: ' + conf_data.get('VERSION_STR') + '\nCONFIG_DIR: ' + conf_data.get('CONFIG_DIR') + '\nDATA_DIR: ' + conf_data.get('DATA_DIR')) \ No newline at end of file diff --git a/src/twonder/meson.build b/src/twonder/meson.build index b923239..fae3698 100644 --- a/src/twonder/meson.build +++ b/src/twonder/meson.build @@ -9,6 +9,7 @@ twonder_src = ['angle.cpp', ] executable('twonder', twonder_src, include_directories: inc, + install_rpath: lib_dir, dependencies: [jack_dep, thread_dep, xml_dep, liblo_dep], link_with: libwonder, install: true diff --git a/src/twonder/twonder.cpp b/src/twonder/twonder.cpp index c2c5844..4dd51a4 100644 --- a/src/twonder/twonder.cpp +++ b/src/twonder/twonder.cpp @@ -165,8 +165,10 @@ int process(jack_nframes_t nframes, void* arg) { bool initialize_jack() { bool running = false; // Initialization status - int available_inputs = 0; // Number of physically available inputs - int available_outputs = 0; // Number of physically available outputs + + // not needed since we make the connections after the jack client is started + // int available_inputs = 0; // Number of physically available inputs + // int available_outputs = 0; // Number of physically available outputs const char* client_name = twonderConf->jackName; // Get name from twonderConfig jack_options_t options = JackNoStartServer; // No options needed, since we use the @@ -282,98 +284,104 @@ bool initialize_jack() { } } - // 9. Connect the audio inputs of the soundcard with the input ports of the JACK - // client (JACK calls them "output ports", because they are readable by the JACK - // client). - if (running) { - const char** ports = jack_get_ports(jackClient, nullptr, nullptr, - JackPortIsPhysical | JackPortIsOutput); - - if (ports == nullptr) { - running = false; - std::cerr << "[JACK][ERROR]: No physical audio input (capture) ports are " - "available!\n"; - } - - // Proceed only if the soundcard has physical audio input (capture) ports! - if (running) { - for (int i = 0; i < twonderConf->noSources; ++i) { - if (!((ports[i] == nullptr) - || (jack_port_name(jackInputs[i]) - == nullptr))) { // Do not connect to NULL ports - // jack_connect(jackClient, ports[i], jack_port_name(jackInputs[i])); - // // TODO: Disabled internal auto-connect in favor of external - // startup script! - available_inputs++; - } else { - // Remove JACK client input ports that have no corresponding soundcard - // audio input (capture) port. - jack_port_unregister(jackClient, jackInputs[i]); - // TODO This break is a workaround that this whole loop doesn't work. - break; - } - } - } - - jack_free(ports); // Free the memory allocated by jack_get_ports(...) - } - - // 10. Connect the output ports of the JACK client with the audio outputs of the - // soundcard (JACK calls them "input ports", because they are writable by the JACK - // client). - if (running) { - const char** ports = jack_get_ports(jackClient, nullptr, nullptr, - JackPortIsPhysical | JackPortIsInput); - - if (ports == nullptr) { - running = false; - std::cerr << "[JACK][ERROR]: No physical audio output (playback) ports are " - "available!\n"; - } - - // Proceed only if the soundcard has physical audio output (playback) ports and - // take care of the usable loudspeakers! - if (running) { - for (size_t i = 0; i < speakers->size(); ++i) { - if (!((jack_port_name(jackOutputs[i]) == nullptr) - || (ports[i] == nullptr))) { // Do not connect to NULL ports - // jack_connect(jackClient, jack_port_name(jackOutputs[i]), ports[i]); - // // TODO: Disabled internal auto-connect in favor of external - // startup script! - available_outputs++; - } else { - // Remove the JACK client output port that can not be connected to the - // soundcard audio output (playback) port. - jack_port_unregister(jackClient, jackOutputs[i]); - // TODO This break is a workaround that this whole loop doesn't work. - break; - } - } - } - jack_free(ports); // Free the memory allocated by jack_get_ports(...) - } + /* ========================================================================== + + The following code is disabled, because we connect the JACK client ports differently + + ========================================================================== */ + + // // 9. Connect the audio inputs of the soundcard with the input ports of the JACK + // // client (JACK calls them "output ports", because they are readable by the JACK + // // client). + // if (running) { + // const char** ports = jack_get_ports(jackClient, nullptr, nullptr, + // JackPortIsPhysical | JackPortIsOutput); + + // if (ports == nullptr) { + // running = false; + // std::cerr << "[JACK][ERROR]: No physical audio input (capture) ports are " + // "available!\n"; + // } + + // // Proceed only if the soundcard has physical audio input (capture) ports! + // if (running) { + // for (int i = 0; i < twonderConf->noSources; ++i) { + // if (!((ports[i] == nullptr) + // || (jack_port_name(jackInputs[i]) + // == nullptr))) { // Do not connect to NULL ports + // jack_connect(jackClient, ports[i], jack_port_name(jackInputs[i])); + // available_inputs++; + // } else { + // // Remove JACK client input ports that have no corresponding soundcard + // // audio input (capture) port. + // jack_port_unregister(jackClient, jackInputs[i]); + // } + // } + // } + + // jack_free(ports); // Free the memory allocated by jack_get_ports(...) + // } + + // // 10. Connect the output ports of the JACK client with the audio outputs of the + // // soundcard (JACK calls them "input ports", because they are writable by the JACK + // // client). + // if (running) { + // const char** ports = jack_get_ports(jackClient, nullptr, nullptr, + // JackPortIsPhysical | JackPortIsInput); + + // if (ports == nullptr) { + // running = false; + // std::cerr << "[JACK][ERROR]: No physical audio output (playback) ports are " + // "available!\n"; + // } + + // // Proceed only if the soundcard has physical audio output (playback) ports and + // // take care of the usable loudspeakers! + // if (running) { + // for (size_t i = 0; i < speakers->size(); ++i) { + // if (!((jack_port_name(jackOutputs[i]) == nullptr) + // || (ports[i] == nullptr))) { // Do not connect to NULL ports + // jack_connect(jackClient, jack_port_name(jackOutputs[i]), ports[i]); + // available_outputs++; + // } else { + // // Remove the JACK client output port that can not be connected to the + // // soundcard audio output (playback) port. + // jack_port_unregister(jackClient, jackOutputs[i]); + // } + // } + // } + + // jack_free(ports); // Free the memory allocated by jack_get_ports(...) + // } // 11. Everything is set up correctly, now print a final message with the parameters // of the JACK client. if (running) { std::cout << "\n" << std::endl; - - // Correct the number of available sources (inputs). - if (twonderConf->noSources != available_inputs) { - std::cout << "[JACK][WARNING]: Total number of sources changed from " - << twonderConf->noSources << " to " << available_inputs - << " due to input limitations of the soundcard!" << std::endl; - twonderConf->noSources = available_inputs; - } - - // Correct the number of available speakers (outputs). - if (static_cast(speakers->size()) != available_outputs) { - std::cout << "[JACK][WARNING]: Total number of speakers changed from " - << speakers->size() << " to " << available_outputs - << " due to output limitations of the soundcard!" << std::endl; - speakers->resize(available_outputs); - } + + /* ========================================================================== + + We will not check if we have enough inputs and outputs, because we will connect + the JACK client ports differently + + ========================================================================== */ + + // // Correct the number of available sources (inputs). + // if (twonderConf->noSources != available_inputs) { + // std::cout << "[JACK][WARNING]: Total number of sources changed from " + // << twonderConf->noSources << " to " << available_inputs + // << " due to input limitations of the soundcard!" << std::endl; + // twonderConf->noSources = available_inputs; + // } + + // // Correct the number of available speakers (outputs). + // if (static_cast(speakers->size()) != available_outputs) { + // std::cout << "[JACK][WARNING]: Total number of speakers changed from " + // << speakers->size() << " to " << available_outputs + // << " due to output limitations of the soundcard!" << std::endl; + // speakers->resize(available_outputs); + // } std::chrono::duration delay_msec( 1.0 / jack_get_sample_rate(jackClient) * jack_get_buffer_size(jackClient) @@ -574,7 +582,7 @@ int oscSrcPositionHandler(handlerArgs) { } if (twonderConf->verbose) { - std::cout << "osc-position: src=" << sourceId << " x=" << newX << " y=" << newY + std::cout << "[V-OSCServer] position: src=" << sourceId << " x=" << newX << " y=" << newY << " ts=" << time << " dur=" << duration << std::endl; } @@ -609,7 +617,7 @@ int oscSrcPositionHandler3D(handlerArgs) { } if (twonderConf->verbose) { - std::cout << "osc-position: src=" << sourceId << " x=" << newX << " y=" << newY + std::cout << "[V-OSCServer] position: src=" << sourceId << " x=" << newX << " y=" << newY << " z=" << newZ << " ts=" << time << " dur=" << duration << std::endl; } @@ -642,7 +650,7 @@ int oscSrcAngleHandler(handlerArgs) { } if (twonderConf->verbose) { - std::cout << "osc-angle: src=" << sourceId << " a=" << newAngle << " ts=" << time + std::cout << "[V-OSCServer] angle: src=" << sourceId << " a=" << newAngle << " ts=" << time << " dur=" << duration << std::endl; } @@ -677,7 +685,7 @@ int oscSrcTypeHandler(handlerArgs) { if (argc == 3) { time = argv[2]->f; } if (twonderConf->verbose) { - std::cout << "osc-type-change: src=" << sourceId << " type=" << newType + std::cout << "[V-OSCServer] type-change: src=" << sourceId << " type=" << newType << " ts=" << time << std::endl; } @@ -699,7 +707,7 @@ int oscSrcDopplerHandler(handlerArgs) { if (argc == 3) { time = argv[2]->f; } if (twonderConf->verbose) { - std::cout << "osc-doppler-change: src=" << sourceId << " doppler=" << useDoppler + std::cout << "[V-OSCServer] doppler-change: src=" << sourceId << " doppler=" << useDoppler << " ts=" << time << std::endl; } @@ -712,8 +720,8 @@ int oscSrcDopplerHandler(handlerArgs) { int oscReplyHandler(handlerArgs) { if (twonderConf->verbose) { - std::cout << "[V-OSCServer] reply to: " << &argv[0]->s << " state=" << argv[1]->i - << " msg=" << &argv[2]->s << std::endl; + std::cout << "[V-OSCServer] reply to: " << &argv[0]->s << " error number = " << argv[1]->i + << " error message = " << &argv[2]->s << std::endl; } return 0; @@ -722,7 +730,7 @@ int oscReplyHandler(handlerArgs) { int oscSrcActivateHandler(handlerArgs) { if ((argv[0]->i >= twonderConf->noSources) || (argv[0]->i < 0)) { return 0; } - if (twonderConf->verbose) { std::cout << "osc-activate " << argv[0]->i << std::endl; } + if (twonderConf->verbose) { std::cout << "[V-OSCServer] activated source: " << argv[0]->i << std::endl; } sources->at(argv[0]->i)->active = true; @@ -733,7 +741,7 @@ int oscSrcDeactivateHandler(handlerArgs) { if ((argv[0]->i >= twonderConf->noSources) || (argv[0]->i < 0)) { return 0; } if (twonderConf->verbose) { - std::cout << "osc-deactivate " << argv[0]->i << std::endl; + std::cout << "[V-OSCServer] deactivated source: " << argv[0]->i << std::endl; } sources->at(argv[0]->i)->active = false; @@ -758,6 +766,9 @@ int oscNoSourcesHandler(handlerArgs) { twonderConf->noSources = argv[0]->i; noSourcesIsSet = true; sources = new SourceArray(twonderConf->noSources, twonderConf->negDelayInit); + if (twonderConf->verbose) { + std::cout << "[V-OSCServer] no-sources: " << argv[0]->i << std::endl; + } } } @@ -774,6 +785,10 @@ int oscRenderPolygonHandler(handlerArgs) { for (int i = 1; i <= noPoints; ++i) { twonderConf->renderPolygon.push_back( Vector3D(argv[(i * 3) - 1]->f, argv[i * 3]->f, argv[(i * 3) + 1]->f)); + if (twonderConf->verbose) { + std::cout << "[V-OSCServer] render-polygon: x=" << argv[(i * 3) - 1]->f + << " y=" << argv[i * 3]->f << " z=" << argv[(i * 3) + 1]->f << std::endl; + } } // TODO: calculate elevation of speakers @@ -879,12 +894,13 @@ int main(int argc, char* argv[]) { // multiple entries for one message (e.g. type) are just for convenience and will use // a value of 0 for timestamp and/or duration + // after the address we have the message types ie. "sis" means string, int, string oscServer->addMethod("/WONDER/reply", "sis", oscReplyHandler); oscServer->addMethod("/WONDER/source/activate", "i", oscSrcActivateHandler); oscServer->addMethod("/WONDER/source/deactivate", "i", oscSrcDeactivateHandler); oscServer->addMethod("/WONDER/source/position", "iff", oscSrcPositionHandler); oscServer->addMethod("/WONDER/source/position", "ifff", oscSrcPositionHandler); - oscServer->addMethod("/WONDER/source/position", "ifff", oscSrcPositionHandler); + oscServer->addMethod("/WONDER/source/position", "iffff", oscSrcPositionHandler); oscServer->addMethod("/WONDER/source/position3D", "ifff", oscSrcPositionHandler3D); oscServer->addMethod("/WONDER/source/position3D", "iffff", oscSrcPositionHandler3D); oscServer->addMethod("/WONDER/source/position3D", "ifffff", oscSrcPositionHandler3D); @@ -908,18 +924,20 @@ int main(int argc, char* argv[]) { // wait for cwonder to send setup data // reconnect if it doesn't work + // its cwonder which activates the sources with osc commands while (twonderConf->noSources == 0) { - static int timeoutCounter = 0; + // BUGFIX: When twonder sends two connects immediately after each other, this causes sources inside the polygon to not work. WHY??! + int timeout = 0; std::this_thread::sleep_for(std::chrono::seconds(1)); - - if (timeoutCounter % 15 == 15) { - std::cerr << "Cannot connect to cwonder...\n"; - lo_send(twonderConf->cwonderAddr, "/WONDER/stream/render/connect", "s", - twonderConf->name.c_str()); + if (timeout % 3 == 2) { + std::cerr << "[twonder] Cannot connect to cwonder, retry..." << std::endl; + lo_send(twonderConf->cwonderAddr, "/WONDER/stream/render/connect", "s", twonderConf->name.c_str()); } - timeoutCounter++; + timeout++; } + // if cwonder does not respond we are not going to exit the loop above + std::cout << "Connection to cwonder established.\n"; // Initialize JACK @@ -929,7 +947,10 @@ int main(int argc, char* argv[]) { } // event loop - while (true) { std::this_thread::sleep_for(std::chrono::seconds(10)); } + // TODO: if cwonder is no more running the noSources shall be set to 0 and the we should try to reconnect + while (true) { + std::this_thread::sleep_for(std::chrono::seconds(1)); + } // cleanup before exiting exitCleanupFunction();