From fb69afd9ac83894297965bd0cb950afc3d5d7395 Mon Sep 17 00:00:00 2001 From: DischordDynne Date: Tue, 12 Aug 2025 14:20:05 -0400 Subject: [PATCH 1/9] create Dockerfile --- Dockerfile.arm64 | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Dockerfile.arm64 diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 new file mode 100644 index 000000000..78909ba6d --- /dev/null +++ b/Dockerfile.arm64 @@ -0,0 +1,13 @@ +FROM rust:latest + +# Install required dependencies +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + libasound2-dev \ + libjack-jackd2-dev \ + libjack-jackd2-0 \ + pkg-config \ + +# Set /cpal/ to working directory +WORKDIR /cpal +COPY . . \ No newline at end of file From 970ea991307535f204f766205e349e5e4bb2dc05 Mon Sep 17 00:00:00 2001 From: DischordDynne Date: Tue, 12 Aug 2025 14:20:24 -0400 Subject: [PATCH 2/9] include dbus-1 support --- Dockerfile.arm64 | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 78909ba6d..0b1c3ba40 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -7,6 +7,7 @@ RUN apt-get update && \ libjack-jackd2-dev \ libjack-jackd2-0 \ pkg-config \ + libdbus-1-dev \ # Set /cpal/ to working directory WORKDIR /cpal From 71c982a0443c6445d0520ea0c44142ac427805dc Mon Sep 17 00:00:00 2001 From: DischordDynne Date: Tue, 12 Aug 2025 19:25:19 -0400 Subject: [PATCH 3/9] finish creating dockerfile --- Dockerfile | 4 ++-- Dockerfile.arm64 | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3fa3b24ab..8e56a2efd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ ARG CROSS_BASE_IMAGE FROM $CROSS_BASE_IMAGE -ENV PKG_CONFIG_ALLOW_CROSS 1 -ENV PKG_CONFIG_PATH /usr/lib/arm-linux-gnueabihf/pkgconfig/ +ENV PKG_CONFIG_ALLOW_CROSS=1 +ENV PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/ RUN dpkg --add-architecture armhf && \ apt-get update && \ diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 0b1c3ba40..641985b7c 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -11,4 +11,7 @@ RUN apt-get update && \ # Set /cpal/ to working directory WORKDIR /cpal -COPY . . \ No newline at end of file +COPY . . + +# When running this Docker container, ensure ALSA devices are exposed +# using `--device /dev/snd` and `--group-add audio` \ No newline at end of file From f4b3293c2ff542df1bfcb536867ac2287b33fedc Mon Sep 17 00:00:00 2001 From: DischordDynne Date: Tue, 12 Aug 2025 19:33:24 -0400 Subject: [PATCH 4/9] minor fix --- Dockerfile.arm64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 641985b7c..62b886fbd 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -7,7 +7,7 @@ RUN apt-get update && \ libjack-jackd2-dev \ libjack-jackd2-0 \ pkg-config \ - libdbus-1-dev \ + libdbus-1-dev # Set /cpal/ to working directory WORKDIR /cpal From 75aeeef21252e40213d606d767a933fafd851345 Mon Sep 17 00:00:00 2001 From: DischordDynne Date: Tue, 12 Aug 2025 19:34:47 -0400 Subject: [PATCH 5/9] update `CHANGELOG.md` --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3f6277db..16db195fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - CoreAudio: Detect default audio device lazily when building a stream, instead of during device enumeration. - iOS: Fix example by properly activating audio session. - WASAPI: Expose IMMDevice from WASAPI host Device. +- ALSA: Added support for arm64 Linux development, introducing a new Dockerfile. # Version 0.16.0 (2025-06-07) From 10830fd315d213d706345049c33dd3194b438453 Mon Sep 17 00:00:00 2001 From: DischordDynne Date: Tue, 12 Aug 2025 19:46:58 -0400 Subject: [PATCH 6/9] added runner to test arm64 linux --- .github/workflows/cpal.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/cpal.yml b/.github/workflows/cpal.yml index 765e6f09d..5091a23b5 100644 --- a/.github/workflows/cpal.yml +++ b/.github/workflows/cpal.yml @@ -104,6 +104,18 @@ jobs: - name: Test all features for armv7 run: cross test --target armv7-unknown-linux-gnueabihf --workspace --all-features --verbose + linux-check-and-test-arm64: + runs-on: ubuntu-22.04-arm64 + steps: + - name: Build Docker container for arm64 + run: docker build -f Dockerfile.arm64 -t cpal-arm64 . + + - name: Run without features + run: docker run --rm cpal-arm64 cargo test --all --no-default-features --verbose + + - name: Run all features + run: docker run --rm cpal-arm64 cargo test --all --all-features --verbose + asmjs-wasm32-test: strategy: matrix: From fa47575c7447ef24efa49eac8c2014ef7d4972bf Mon Sep 17 00:00:00 2001 From: DischordDynne Date: Thu, 14 Aug 2025 18:10:31 -0400 Subject: [PATCH 7/9] attempt to fix workflow file --- .github/workflows/cpal.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpal.yml b/.github/workflows/cpal.yml index 5091a23b5..58720fffb 100644 --- a/.github/workflows/cpal.yml +++ b/.github/workflows/cpal.yml @@ -105,7 +105,7 @@ jobs: run: cross test --target armv7-unknown-linux-gnueabihf --workspace --all-features --verbose linux-check-and-test-arm64: - runs-on: ubuntu-22.04-arm64 + runs-on: ubuntu-24.04-arm steps: - name: Build Docker container for arm64 run: docker build -f Dockerfile.arm64 -t cpal-arm64 . From 2cdd4ddb4a62fb6b1699468a3253e8c45ac95729 Mon Sep 17 00:00:00 2001 From: DischordDynne Date: Thu, 14 Aug 2025 18:16:08 -0400 Subject: [PATCH 8/9] debug --- .github/workflows/cpal.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/cpal.yml b/.github/workflows/cpal.yml index 58720fffb..7e9f4734b 100644 --- a/.github/workflows/cpal.yml +++ b/.github/workflows/cpal.yml @@ -107,6 +107,12 @@ jobs: linux-check-and-test-arm64: runs-on: ubuntu-24.04-arm steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Debug testing... + run: ls -la + - name: Build Docker container for arm64 run: docker build -f Dockerfile.arm64 -t cpal-arm64 . From d499a8c98d1ed2ead024e88eedfb687043d7a111 Mon Sep 17 00:00:00 2001 From: DischordDynne Date: Thu, 14 Aug 2025 18:17:39 -0400 Subject: [PATCH 9/9] remove debug --- .github/workflows/cpal.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/cpal.yml b/.github/workflows/cpal.yml index 7e9f4734b..b5c2de1be 100644 --- a/.github/workflows/cpal.yml +++ b/.github/workflows/cpal.yml @@ -110,9 +110,6 @@ jobs: - name: Checkout sources uses: actions/checkout@v4 - - name: Debug testing... - run: ls -la - - name: Build Docker container for arm64 run: docker build -f Dockerfile.arm64 -t cpal-arm64 .