Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions common/exampleInput_misuka.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"geo_path": "test_room_misuka.geo",
"msh_path": "test_room_misuka.msh",
"absorption_coefficients": {
"floor": "0.05, 0.05, 0.08, 0.1, 0.12, 0.15",
"wall1": "0.05, 0.05, 0.08, 0.1, 0.12, 0.15",
"ceiling": "0.4, 0.5, 0.6, 0.7, 0.8, 0.9",
"wall2": "0.05, 0.05, 0.08, 0.1, 0.12, 0.15",
"wall3": "0.05, 0.05, 0.08, 0.1, 0.12, 0.15",
"wall4": "0.05, 0.05, 0.08, 0.1, 0.12, 0.15"
},
"simulationSettings": {
"rays_per_frequency": 1048576,
"max_time": 0.1,
"sampling_rate": 10000,
"sound_power_W": 1,
"speed_of_sound": 343,
"dynamic_range_db": "no",
"scattering_125": 0.1,
"scattering_250": 0.1,
"scattering_500": 0.1,
"scattering_1000": 0.1,
"scattering_2000": 0.1,
"scattering_4000": 0.1,
"log_data": "no"
},
"results": [
{
"simulationMethodId": 1,
"resultType": "IR",
"simulationId": 1,
"sourceX": 1.0,
"sourceY": 2.0,
"sourceZ": 1.5,
"frequencies": [
125,
250,
500,
1000,
2000,
4000
],
"percentage": 0,
"responses": [
{
"responseId": 1,
"x": 5.0,
"y": 3.5,
"z": 1.5,
"parameters": {
"edt": [],
"t20": [],
"t30": [],
"c80": [],
"d50": [],
"ts": [],
"spl_t0_freq": []
},
"receiverResults": []
}
]
}
]
}
99 changes: 99 additions & 0 deletions example_settings/misuka_setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"type": "simulationSettings",
"options": [
{
"name": "Rays per Frequency Band",
"id": "rays_per_frequency",
"type": "integer",
"display": "text",
"min": 1000,
"max": 4194304,
"step": 524288,
"default": 1048576,
"description": "Number of rays used for every frequency band in every source-reciever simulation."
},
{
"name": "Maximum Response Length",
"id": "max_time",
"type": "float",
"display": "text",
"min": 0.01,
"max": 20,
"step": 1.0,
"default": 10,
"endAdornment": "s",
"description": "Length of the simulated IR."
},
{
"name": "Histogram sampling rate",
"id": "sampling_rate",
"type": "integer",
"display": "text",
"min": 100,
"max": 40000,
"step": 1000,
"default": 20000,
"endAdornment": "Hz",
"description": "Sampling rate of the simulated histogram."
},
{
"name": "Speed of Sound",
"id": "speed_of_sound",
"display": "text",
"type": "float",
"min": 200,
"max": 360,
"step": 5,
"default": 343,
"endAdornment": "m/s",
"description": "Speed of sound in m/s that is used in simulation."
},
{
"name": "Limit Dynamic Range",
"id": "dynamic_range_db",
"type": "integer",
"display": "text",
"min": -1,
"max": 250,
"step": 20,
"default": -1,
"endAdornment": "dB",
"description": "Using a positive integer input will limit the dynamic range (EDC_max - EDC_min) to that input."
},
{
"name": "Scattering",
"id": "scattering_coefficients",
"display": "text",
"type": "string",
"default": "0.1, 0.1, 0.1, 0.1, 0.1",
"endAdornment": "",
"description": "Used for controlling scattering on all surface materials for the different frequency bands [s(125), s(250), s(500), s(1000), s(2000)]."
}
],

"_future_options": [
{
"name": "Maximum Energy Loss",
"id": "max_energy_loss",
"type": "integer",
"display": "text",
"min": 0,
"max": 100,
"step": 1,
"default": 50,
"endAdornment": "%"
},
{
"name": "Processing Unit",
"id": "comp_backend",
"type": "string",
"display": "radio",
"options":
{
"CPU": "cpu",
"CUDA GPU": "gpu"
},
"default": "cpu"
}
]
}
10 changes: 10 additions & 0 deletions methods-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,15 @@
"entryFile": "__main__.py",
"repositoryURL": "https://github.com/LCAV/pyroomacoustics",
"documentationURL": "https://pyroomacoustics.readthedocs.io"
},
{
"simulationType": "misuka",
"containerImage": "misuka_image:latest",
"envVars": {},
"label": "misuka",
"entryFile":"misukaInterface.py",
"settings":"misuka_setting.json",
"repositoryURL":"https://github.com/misuka-renderer/misuka.git",
"documentationURL":"https://www.tu.berlin/en/ak/research/projects/differentiable-acoustic-path-tracing"
}
]
116 changes: 116 additions & 0 deletions misuka_method/Dockerfile

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not commenting on this file until finalized

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The multi-stage builds now pull one of the most recent Misuka commits, as Misuka recently received a major update. By switching to multi-stage builds, the image size was reduced from 6 GB to 2.47 GB.

One of the main factors influencing the final image size is the number of Misuka variants that are included. At the moment, three variants are being built because I have not yet found a way to build Misuka with fewer than these three. I will get in touch with @tjueterb to confirm whether this selection is already optimal or if it can be reduced further.

@tjueterb tjueterb Jul 21, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make sure the licenses of misuka and CHORAS are compatible before using the newest update. Let's talk tomorrow :)

Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# ---------- Stage 1: builder ----------
FROM ubuntu:22.04 AS builder

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
software-properties-common \
wget \
gnupg \
lsb-release \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# Add LLVM repo for Clang 17
RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" \
> /etc/apt/sources.list.d/llvm.list

RUN add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && apt-get install -y \
python3.11 \
python3.11-dev \
python3.11-distutils \
python3-pip \
clang-17 \
libc++-17-dev \
libc++abi-17-dev \
libllvm17 \
cmake \
ninja-build \
ccache \
git \
build-essential \
zlib1g-dev \
libpng-dev \
libjpeg-dev \
gmsh \
&& rm -rf /var/lib/apt/lists/*

ENV CC=clang-17
ENV CXX=clang++-17
ENV CMAKE_CXX_COMPILER_LAUNCHER=ccache
ENV CMAKE_C_COMPILER_LAUNCHER=ccache

RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
RUN python3.11 -m pip install --upgrade pip typing_extensions

# Shallow clone of misuka from the lgpl branch
RUN mkdir -p /opt/misuka && cd /opt/misuka && \
git init && \
git remote add origin https://github.com/misuka-renderer/misuka.git && \
git fetch --depth 1 origin lgpl && \
git checkout FETCH_HEAD && \
git submodule update --init --recursive --depth 1

# Build misuka from source, with ccache to speed up rebuilds
RUN --mount=type=cache,target=/root/.ccache \
cd /opt/misuka && \
mkdir build && cd build && \
cmake -GNinja .. \
-DMI_DEFAULT_VARIANTS="scalar_rgb;llvm_ad_rgb;llvm_ad_acoustic" \
-DCMAKE_BUILD_TYPE=Release \
-DPython_EXECUTABLE=/usr/bin/python3.11 \
-DPython3_EXECUTABLE=/usr/bin/python3.11 && \
ninja && \
ccache -s

WORKDIR /app
COPY misuka_method /app/misuka_method
RUN python3.11 -m pip install --target=/opt/misuka_python \
numpy \
requests \
meshio \
pyfar \
pyrato \
pandas && \
python3.11 -m pip install --no-deps --target=/opt/misuka_python /app/misuka_method

# ---------- Stage 2: runtime ----------
FROM ubuntu:22.04 AS runtime

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
software-properties-common ca-certificates gnupg wget lsb-release && \
add-apt-repository ppa:deadsnakes/ppa && \
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" > /etc/apt/sources.list.d/llvm.list && \
apt-get update && apt-get install -y \
python3.11 \
python3-pip \
libc++1-17 \
libc++abi1-17 \
libllvm17 \
libpng16-16 \
libjpeg-turbo8 \
libglu1-mesa \
gmsh \
python3-gmsh \
zlib1g \
&& rm -rf /var/lib/apt/lists/*

RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1

# Misuka's compiled build output (libmitsuba.so, libdrjit-extra.so, plugins/, etc.)
COPY --from=builder /opt/misuka/build /opt/misuka/build

# Python package and dependencies installed in the builder stage.
COPY --from=builder /opt/misuka_python /opt/misuka_python

ENV LD_LIBRARY_PATH="/opt/misuka/build"
ENV PYTHONPATH="/opt/misuka_python:/opt/misuka/build/python:/usr/lib/python3/dist-packages"
ENV DRJIT_LIBLLVM_PATH="/usr/lib/x86_64-linux-gnu/libLLVM-17.so"

WORKDIR /app/misuka_method
CMD ["python3.11", "-m", "misuka_interface"]
97 changes: 97 additions & 0 deletions misuka_method/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
----------------------------------------------------------------------
Combined Licensing Note
----------------------------------------------------------------------

This repository is based on code from **Mitsuba 3**, originally developed by
Wenzel Jakob and licensed under the terms listed at the bottom of this page.

All modifications and additions made for **misuka** by the misuka contributors
are licensed under the GNU Lesser General Public License (LGPL), version 3
or (at your option) any later version.

When using, modifying, or redistributing this software, you must comply with
both licenses as they apply to the respective portions of the code.

----------------------------------------------------------------------
File Level Licensing Rules
----------------------------------------------------------------------

1. New files created for misuka
All files authored specifically for misuka and not derived from Mitsuba
code are licensed under the GNU Lesser General Public License (LGPL),
version 3 or any later version.

2. Files originating from Mitsuba 3
Files that come from the Mitsuba 3 codebase remain under the original
Mitsuba 3 license.

3. Modified Mitsuba files
For files derived from Mitsuba code that contain modifications by misuka
contributors:
- The original Mitsuba portions remain under the original Mitsuba license.
- Any modifications licensed under the LGPL must be clearly marked in the
file header.
- If no such note is present, the entire file remains under the original
Mitsuba license.


----------------------------------------------------------------------
Code for misuka (LGPL)
----------------------------------------------------------------------

Copyright (c) 2025 The misuka contributors

All modifications and additions to this software made for Misuka are licensed
under the terms of the GNU Lesser General Public License (LGPL), version 3 or
(at your option) any later version.

You may obtain a copy of the LGPL at:
https://www.gnu.org/licenses/lgpl-3.0.html

This means:
- You may use and redistribute this code under the terms of the LGPL.
- You must make source code available for any changes to LGPL-covered parts.
- You may link this library with proprietary software under the conditions
specified in the LGPL.


----------------------------------------------------------------------
Original Code from Mitsuba 3
----------------------------------------------------------------------

Copyright (c) 2017 Wenzel Jakob <wenzel.jakob@epfl.ch>, All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

You are under no obligation whatsoever to provide any bug fixes, patches, or
upgrades to the features, functionality or performance of the source code
("Enhancements") to anyone; however, if you choose to make your Enhancements
available either publicly, or directly to the author of this software, without
imposing a separate written license agreement for such Enhancements, then you
hereby grant the following license: a non-exclusive, royalty-free perpetual
license to install, use, modify, prepare derivative works, incorporate into
other computer software, distribute, and sublicense such enhancements or
derivative works thereof, in binary and source code form.
Loading