From 4854435da54d14db9c283a8b17f50c107e614502 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 21 Mar 2024 14:16:47 +0100 Subject: [PATCH 01/13] use random head trajectory for BINAURAL output --- ci/create_trajectories.py | 25 ++++++++++++++++++++++++ ci/run_scheduled_sanitizer_test.py | 31 ++++++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 ci/create_trajectories.py diff --git a/ci/create_trajectories.py b/ci/create_trajectories.py new file mode 100644 index 0000000000..6b957df092 --- /dev/null +++ b/ci/create_trajectories.py @@ -0,0 +1,25 @@ +import numpy as np + + +FRAMES_PER_SEC = 50 + + +def random_trajectory(duration_sec): + n_frames = int(FRAMES_PER_SEC * duration_sec) + trj = np.random.random((n_frames, 4)) + trj[:, 0] = -3 + trj[:, 1] *= 180 + trj[:, 2] *= 90 + trj[:, 3] *= 180 + return trj + + +def constant_trajectory(duration_sec, yaw=0, pitch=0, roll=0): + n_frames = int(FRAMES_PER_SEC * duration_sec) + trj = np.empty((n_frames, 4)) + trj[:, 0] = -3 + trj[:, 1] = yaw + trj[:, 2] = pitch + trj[:, 3] = roll + return trj + diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index d8986233fb..ea52570624 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -33,6 +33,8 @@ import argparse import pathlib import subprocess import sys +import numpy as np +import json CI_SCRIPT_DIR = "./ci" sys.path.append(CI_SCRIPT_DIR) @@ -41,6 +43,8 @@ from collect_artifacts import ( find_failed_files_for_sanitizer_test, ) from combine_genpatt_and_jbm_profile import combine_error_profiles +from create_trajectories import random_trajectory, constant_trajectory + SCRIPT_DIR = pathlib.Path("./scripts").resolve() DURATION = "120" @@ -54,9 +58,9 @@ N_FRAMES_DLY_PROFILE = 7500 GENPATT_CMD = f"gen-patt -tailstat -fer -g192 -gamma 0 -rate 0.15 -tol 0.001 -reset -n {N_FRAMES_DLY_PROFILE} {EP_FILE}" MC_MODES = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] AMBISONICS_MODES = ["HOA3", "HOA2", "FOA", "PlanarHOA3", "PlanarHOA2", "PlanarFOA"] -TIMEOUT = ( - 60 * 20 -) # timeout of 15 minutes per en/decoding to safeguard against endless loops +# timeout of 15 minutes per en/decoding to safeguard against endless loops +TIMEOUT = (60 * 20) +HEAD_TRAJ_FILE = "head_traj.csv" CONSOLE_OUT_FILE = "output_san.txt" @@ -112,6 +116,17 @@ def get_modes(in_format: str) -> list: return mode_list +def assemble_oc_dict(out_formats: list): + oc_dict = {of: [] for of in out_formats} + + head_rot_args = ["-t", HEAD_TRAJ_FILE] + oc_dict["BINAURAL"].extend(head_rot_args) + oc_dict["BINAURAL_ROOM_IR"].extend(head_rot_args) + oc_dict["BINAURAL_ROOM_REVERB"].extend(head_rot_args) + + return json.dumps(oc_dict) + + def get_md_file_command(in_format: str) -> list: cmd = list() @@ -124,10 +139,18 @@ def get_md_file_command(in_format: str) -> list: return cmd +def create_trajectory_file(duration): + traj = random_trajectory(duration) + np.savetext(HEAD_TRAJ_FILE, traj, fmt="%.2f", delimiter=",") + + def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = True): modes = get_modes(in_format) md_file_command = get_md_file_command(in_format) + oc_str = assemble_oc_dict(out_formats) + + create_trajectory_file(DURATION) if len(modes) == 0: return 0 @@ -146,7 +169,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr "-m", *modes, "--oc", - *out_formats, + oc_str, *md_file_command, "--usan_supp_file", USAN_SUPP_FILE, -- GitLab From 355cbdd1aa59f508fb0accf4b3be0c04cc774d1a Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 21 Mar 2024 14:26:33 +0100 Subject: [PATCH 02/13] fix oc dict creation --- ci/run_scheduled_sanitizer_test.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index ea52570624..18a41a8da4 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -59,7 +59,7 @@ GENPATT_CMD = f"gen-patt -tailstat -fer -g192 -gamma 0 -rate 0.15 -tol 0.001 -re MC_MODES = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] AMBISONICS_MODES = ["HOA3", "HOA2", "FOA", "PlanarHOA3", "PlanarHOA2", "PlanarFOA"] # timeout of 15 minutes per en/decoding to safeguard against endless loops -TIMEOUT = (60 * 20) +TIMEOUT = 60 * 20 HEAD_TRAJ_FILE = "head_traj.csv" CONSOLE_OUT_FILE = "output_san.txt" @@ -117,12 +117,13 @@ def get_modes(in_format: str) -> list: def assemble_oc_dict(out_formats: list): - oc_dict = {of: [] for of in out_formats} + ARGS_FOR_OC = { + "BINAURAL": ["-t", HEAD_TRAJ_FILE], + "BINAURAL_ROOM_IR": ["-t", HEAD_TRAJ_FILE], + "BINAURAL_ROOM_REVERB": ["-t", HEAD_TRAJ_FILE], + } - head_rot_args = ["-t", HEAD_TRAJ_FILE] - oc_dict["BINAURAL"].extend(head_rot_args) - oc_dict["BINAURAL_ROOM_IR"].extend(head_rot_args) - oc_dict["BINAURAL_ROOM_REVERB"].extend(head_rot_args) + oc_dict = {of: ARGS_FOR_OC.get(of, list()) for of in out_formats} return json.dumps(oc_dict) -- GitLab From 9b2b63d44be7b240229c6a3a97df6fe2bab514f6 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 21 Mar 2024 14:30:13 +0100 Subject: [PATCH 03/13] convert duration to int --- ci/run_scheduled_sanitizer_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index 18a41a8da4..4bb9bab91d 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -151,7 +151,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr md_file_command = get_md_file_command(in_format) oc_str = assemble_oc_dict(out_formats) - create_trajectory_file(DURATION) + create_trajectory_file(str(DURATION)) if len(modes) == 0: return 0 -- GitLab From 8a8d29b88d8228eea5de96ad2f4cbfab58cb196c Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 21 Mar 2024 14:31:09 +0100 Subject: [PATCH 04/13] fix last commit --- ci/run_scheduled_sanitizer_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index 4bb9bab91d..ab3e9c9cc8 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -151,7 +151,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr md_file_command = get_md_file_command(in_format) oc_str = assemble_oc_dict(out_formats) - create_trajectory_file(str(DURATION)) + create_trajectory_file(int(DURATION)) if len(modes) == 0: return 0 -- GitLab From ef5e06d559262266fc0b1593f0bfde452aebcce1 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 21 Mar 2024 14:31:40 +0100 Subject: [PATCH 05/13] fix typo --- ci/run_scheduled_sanitizer_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index ab3e9c9cc8..96b0e99c91 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -142,7 +142,7 @@ def get_md_file_command(in_format: str) -> list: def create_trajectory_file(duration): traj = random_trajectory(duration) - np.savetext(HEAD_TRAJ_FILE, traj, fmt="%.2f", delimiter=",") + np.savetxt(HEAD_TRAJ_FILE, traj, fmt="%.2f", delimiter=",") def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = True): -- GitLab From 5f064e2fa2ea13ab16e0fe17336414acbb8f2bb8 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 21 Mar 2024 14:40:56 +0100 Subject: [PATCH 06/13] use abs path of ht trajectory file --- ci/run_scheduled_sanitizer_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index 96b0e99c91..bf5e051443 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -43,7 +43,7 @@ from collect_artifacts import ( find_failed_files_for_sanitizer_test, ) from combine_genpatt_and_jbm_profile import combine_error_profiles -from create_trajectories import random_trajectory, constant_trajectory +from create_trajectories import random_trajectory SCRIPT_DIR = pathlib.Path("./scripts").resolve() @@ -60,7 +60,7 @@ MC_MODES = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] AMBISONICS_MODES = ["HOA3", "HOA2", "FOA", "PlanarHOA3", "PlanarHOA2", "PlanarFOA"] # timeout of 15 minutes per en/decoding to safeguard against endless loops TIMEOUT = 60 * 20 -HEAD_TRAJ_FILE = "head_traj.csv" +HEAD_TRAJ_FILE = pathlib.Path("./head_traj.csv").resolve() CONSOLE_OUT_FILE = "output_san.txt" -- GitLab From e1db7001a4f24b95dd05d4778d18a2a1338d9afc Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 21 Mar 2024 14:42:32 +0100 Subject: [PATCH 07/13] turn into string --- ci/run_scheduled_sanitizer_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index bf5e051443..b75a29b3c0 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -60,7 +60,7 @@ MC_MODES = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] AMBISONICS_MODES = ["HOA3", "HOA2", "FOA", "PlanarHOA3", "PlanarHOA2", "PlanarFOA"] # timeout of 15 minutes per en/decoding to safeguard against endless loops TIMEOUT = 60 * 20 -HEAD_TRAJ_FILE = pathlib.Path("./head_traj.csv").resolve() +HEAD_TRAJ_FILE = str(pathlib.Path("./head_traj.csv").resolve()) CONSOLE_OUT_FILE = "output_san.txt" -- GitLab From af1816813a3e5a757a1e2c6ed7d905343162fae7 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 21 Mar 2024 16:44:24 +0100 Subject: [PATCH 08/13] add head tracking trajectory to artifacts --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f6648a5274..440c117009 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1539,6 +1539,7 @@ ltv-usan: paths: - ep_015.g192 - dly_profile.dat + - head_traj.csv - ./LOGS_PLC - ./LOGS_noPLC -- GitLab From 1b76b3131b9d11c5c545f637bd0e193c820a14b2 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 21 Mar 2024 16:44:43 +0100 Subject: [PATCH 09/13] add non-diegetic pan to ltv sanitizer testing --- ci/run_scheduled_sanitizer_test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index b75a29b3c0..85b50ba6a3 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -178,6 +178,12 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr str(TIMEOUT), ] + # to test non-diegetic panning with mono decoding: + # resue decoder part of StereDmxEVS mode (it is basically a duplicate of "normal" mono run) + if in_format == "StereoDmxEVS": + panning = np.random.randint(-90, 91) + cmd_no_fec += [f'-D="-non_diegetic_pan {panning}"'] + print( "======== Script command line WITHOUT plc: ========\n{}".format( " ".join(cmd_no_fec) -- GitLab From 4b7e2d67bc1261682601d5089104ce4b9aa51c93 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 21 Mar 2024 16:58:43 +0100 Subject: [PATCH 10/13] fix argument for non-diegetic pan --- ci/run_scheduled_sanitizer_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index 85b50ba6a3..32f7575897 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -182,7 +182,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr # resue decoder part of StereDmxEVS mode (it is basically a duplicate of "normal" mono run) if in_format == "StereoDmxEVS": panning = np.random.randint(-90, 91) - cmd_no_fec += [f'-D="-non_diegetic_pan {panning}"'] + cmd_no_fec += [f'-D=-non_diegetic_pan {panning}'] print( "======== Script command line WITHOUT plc: ========\n{}".format( -- GitLab From 115af3bbeebacac8a32100116530e3eb45ae72da Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 21 Mar 2024 17:07:22 +0100 Subject: [PATCH 11/13] add random trajectory file for exof as well --- .gitlab-ci.yml | 3 ++- ci/run_scheduled_sanitizer_test.py | 36 +++++++++++++++++------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 440c117009..6aaf34163b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1539,7 +1539,8 @@ ltv-usan: paths: - ep_015.g192 - dly_profile.dat - - head_traj.csv + - head_rot_traj.csv + - exof_traj.csv - ./LOGS_PLC - ./LOGS_noPLC diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index 32f7575897..1fa96c001e 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -60,10 +60,20 @@ MC_MODES = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] AMBISONICS_MODES = ["HOA3", "HOA2", "FOA", "PlanarHOA3", "PlanarHOA2", "PlanarFOA"] # timeout of 15 minutes per en/decoding to safeguard against endless loops TIMEOUT = 60 * 20 -HEAD_TRAJ_FILE = str(pathlib.Path("./head_traj.csv").resolve()) +HEAD_TRAJ_FILE = str(pathlib.Path("./head_rot_traj.csv").resolve()) +EXOF_TRAJ_FILE = str(pathlib.Path("./exof_traj.csv").resolve()) CONSOLE_OUT_FILE = "output_san.txt" +HEAD_ROT_ARGS = ["-t", HEAD_TRAJ_FILE] +EXOF_ARGS = ["-exof", EXOF_TRAJ_FILE] +BINAURAL_OUT_ARGS = HEAD_ROT_ARGS + EXOF_ARGS +ARGS_FOR_OC = { + "BINAURAL": BINAURAL_OUT_ARGS, + "BINAURAL_ROOM_IR": BINAURAL_OUT_ARGS, + "BINAURAL_ROOM_REVERB": BINAURAL_OUT_ARGS, +} + def main(args): in_format = args.in_format @@ -117,12 +127,6 @@ def get_modes(in_format: str) -> list: def assemble_oc_dict(out_formats: list): - ARGS_FOR_OC = { - "BINAURAL": ["-t", HEAD_TRAJ_FILE], - "BINAURAL_ROOM_IR": ["-t", HEAD_TRAJ_FILE], - "BINAURAL_ROOM_REVERB": ["-t", HEAD_TRAJ_FILE], - } - oc_dict = {of: ARGS_FOR_OC.get(of, list()) for of in out_formats} return json.dumps(oc_dict) @@ -140,21 +144,21 @@ def get_md_file_command(in_format: str) -> list: return cmd -def create_trajectory_file(duration): - traj = random_trajectory(duration) - np.savetxt(HEAD_TRAJ_FILE, traj, fmt="%.2f", delimiter=",") - - def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = True): modes = get_modes(in_format) + if len(modes) == 0: + return 0 + md_file_command = get_md_file_command(in_format) oc_str = assemble_oc_dict(out_formats) - create_trajectory_file(int(DURATION)) - - if len(modes) == 0: - return 0 + # create random trajectory files + if "BINAURAL" in oc_str: + trajectory_files = [HEAD_TRAJ_FILE, EXOF_TRAJ_FILE] + for tf in trajectory_files: + traj = random_trajectory(int(DURATION)) + np.savetxt(tf, traj, fmt="%.2f", delimiter=",") ### always run encoder and decoder with no frameloss cmd_no_fec = [ -- GitLab From 1d5393d0df2178b930d6a0847cfd3927c1af9e57 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 21 Mar 2024 17:22:27 +0100 Subject: [PATCH 12/13] add -otr avg --- ci/run_scheduled_sanitizer_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index 1fa96c001e..5176a440d1 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -67,6 +67,7 @@ CONSOLE_OUT_FILE = "output_san.txt" HEAD_ROT_ARGS = ["-t", HEAD_TRAJ_FILE] EXOF_ARGS = ["-exof", EXOF_TRAJ_FILE] +OTR_ARGS = ["-otr", "avg"] BINAURAL_OUT_ARGS = HEAD_ROT_ARGS + EXOF_ARGS ARGS_FOR_OC = { "BINAURAL": BINAURAL_OUT_ARGS, -- GitLab From 6ded9da26ac91ef0cf105bbcea0754a75b3625fb Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 21 Mar 2024 17:23:29 +0100 Subject: [PATCH 13/13] actually use OTR --- ci/run_scheduled_sanitizer_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index 5176a440d1..65c88ee0c0 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -68,7 +68,7 @@ CONSOLE_OUT_FILE = "output_san.txt" HEAD_ROT_ARGS = ["-t", HEAD_TRAJ_FILE] EXOF_ARGS = ["-exof", EXOF_TRAJ_FILE] OTR_ARGS = ["-otr", "avg"] -BINAURAL_OUT_ARGS = HEAD_ROT_ARGS + EXOF_ARGS +BINAURAL_OUT_ARGS = HEAD_ROT_ARGS + EXOF_ARGS + OTR_ARGS ARGS_FOR_OC = { "BINAURAL": BINAURAL_OUT_ARGS, "BINAURAL_ROOM_IR": BINAURAL_OUT_ARGS, -- GitLab