Skip to content

Audio System + Drivers#562

Merged
KenVanHoeylandt merged 4 commits into
TactilityProject:mainfrom
Shadowtrance:audio-system
Jul 14, 2026
Merged

Audio System + Drivers#562
KenVanHoeylandt merged 4 commits into
TactilityProject:mainfrom
Shadowtrance:audio-system

Conversation

@Shadowtrance

@Shadowtrance Shadowtrance commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Audio subsystem + settings

  • audio-codec-module
  • audio-stream-module
  • aw88298-module
  • dummy-i2s-amp-module
  • es7210-module
  • es8311-module
  • es8388-module
  • pdm-mic-module

IO Expander for Stackchan (and whatever else uses it, i forget)

  • aw9523b-module

Implemented the new system and drivers on the following devices:

  • guition-jc3248w535c
  • guition-jc8048w550c
  • lilygo-tdeck-plus
  • m5stack-cardputer
  • m5stack-stackchan
  • m5stack-sticks3
  • m5stack-tab5

plus bluetooth fix for P4

Summary by CodeRabbit

  • New Features

    • Added audio support with speaker, microphone, codec, amplifier, and full-duplex audio streaming capabilities across multiple supported devices.
    • Added an Audio settings app for controlling input/output enablement, volume, and mute state.
    • Added persistent audio preferences and automatic availability detection.
    • Added support for PDM microphones, I2S audio, resampling, channel conversion, and software volume control.
  • Bug Fixes

    • Improved audio device lifecycle handling and safer Bluetooth shutdown behavior.
  • Documentation

    • Expanded audio driver documentation and clarified Windows simulator setup requirements.

plus bluetooth fix for P4
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f8b9b9df-9657-4be1-8147-caeb7842e1ff

📥 Commits

Reviewing files that changed from the base of the PR and between 9c81573 and afdaed5.

📒 Files selected for processing (40)
  • Devices/guition-jc3248w535c/guition,jc3248w535c.dts
  • Devices/guition-jc8048w550c/guition,jc8048w550c.dts
  • Devices/lilygo-tdeck-plus/lilygo,tdeck-plus.dts
  • Devices/m5stack-cardputer/m5stack,cardputer.dts
  • Devices/m5stack-stackchan/CMakeLists.txt
  • Devices/m5stack-stackchan/m5stack,stackchan.dts
  • Devices/m5stack-sticks3/CMakeLists.txt
  • Devices/m5stack-sticks3/m5stack,sticks3.dts
  • Devices/m5stack-tab5/CMakeLists.txt
  • Devices/m5stack-tab5/m5stack,tab5.dts
  • Documentation/README.md
  • Drivers/audio-codec-module/source/audio_codec_gpio_if.c
  • Drivers/audio-stream-module/source/audio_stream.cpp
  • Drivers/aw88298-module/README.md
  • Drivers/aw88298-module/bindings/awinic,aw88298.yaml
  • Drivers/aw88298-module/include/drivers/aw88298.h
  • Drivers/aw88298-module/source/aw88298.cpp
  • Drivers/aw9523b-module/include/drivers/aw9523b.h
  • Drivers/dummy-i2s-amp-module/bindings/maxim,max98357a.yaml
  • Drivers/dummy-i2s-amp-module/bindings/nsiway,ns4168.yaml
  • Drivers/dummy-i2s-amp-module/include/drivers/dummy_i2s_amp.h
  • Drivers/dummy-i2s-amp-module/source/dummy_i2s_amp.cpp
  • Drivers/es7210-module/bindings/everest,es7210.yaml
  • Drivers/es7210-module/include/drivers/es7210.h
  • Drivers/es7210-module/source/es7210.cpp
  • Drivers/es8311-module/README.md
  • Drivers/es8311-module/bindings/everest,es8311.yaml
  • Drivers/es8311-module/include/drivers/es8311.h
  • Drivers/es8311-module/source/es8311.cpp
  • Drivers/es8388-module/README.md
  • Drivers/es8388-module/bindings/everest,es8388.yaml
  • Drivers/es8388-module/include/drivers/es8388.h
  • Drivers/es8388-module/source/es8388.cpp
  • Drivers/pdm-mic-module/README.md
  • Drivers/pdm-mic-module/bindings/generic,spm1423.yaml
  • Drivers/pdm-mic-module/include/drivers/pdm_mic.h
  • Drivers/pdm-mic-module/source/pdm_mic.cpp
  • TactilityKernel/include/tactility/drivers/audio_stream.h
  • TactilityKernel/source/drivers/audio_codec.cpp
  • TactilityKernel/source/drivers/audio_stream.cpp
💤 Files with no reviewable changes (1)
  • Drivers/audio-codec-module/source/audio_codec_gpio_if.c
🚧 Files skipped from review as they are similar to previous changes (27)
  • Drivers/es8311-module/README.md
  • Drivers/dummy-i2s-amp-module/bindings/nsiway,ns4168.yaml
  • Drivers/aw9523b-module/include/drivers/aw9523b.h
  • Drivers/es8388-module/README.md
  • Drivers/aw88298-module/README.md
  • Drivers/es8388-module/include/drivers/es8388.h
  • Drivers/pdm-mic-module/README.md
  • Drivers/es8388-module/bindings/everest,es8388.yaml
  • Drivers/es8311-module/bindings/everest,es8311.yaml
  • Drivers/aw88298-module/bindings/awinic,aw88298.yaml
  • Drivers/dummy-i2s-amp-module/bindings/maxim,max98357a.yaml
  • Drivers/pdm-mic-module/bindings/generic,spm1423.yaml
  • Devices/m5stack-sticks3/m5stack,sticks3.dts
  • Drivers/es7210-module/bindings/everest,es7210.yaml
  • TactilityKernel/source/drivers/audio_stream.cpp
  • Devices/m5stack-cardputer/m5stack,cardputer.dts
  • Devices/guition-jc8048w550c/guition,jc8048w550c.dts
  • Devices/m5stack-stackchan/m5stack,stackchan.dts
  • TactilityKernel/source/drivers/audio_codec.cpp
  • Devices/guition-jc3248w535c/guition,jc3248w535c.dts
  • Drivers/pdm-mic-module/source/pdm_mic.cpp
  • Drivers/dummy-i2s-amp-module/source/dummy_i2s_amp.cpp
  • TactilityKernel/include/tactility/drivers/audio_stream.h
  • Drivers/audio-stream-module/source/audio_stream.cpp
  • Devices/lilygo-tdeck-plus/lilygo,tdeck-plus.dts
  • Drivers/es7210-module/source/es7210.cpp
  • Drivers/es8388-module/source/es8388.cpp

📝 Walkthrough

Walkthrough

This change introduces a complete audio subsystem with codec and stream APIs, I2S/PDM support, codec adapters, amplifier and microphone drivers, audio settings persistence, an audio service, and an audio settings application. Multiple boards receive updated device-tree audio wiring and module dependencies. ESP32 Bluetooth teardown and I2S handling are strengthened, optional hosted Bluetooth integration is added, and build/documentation configuration is updated.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is related to the changes, but it is too generic to describe the main update clearly. Rename it to name the core change, such as adding the audio subsystem and new codec/stream drivers.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (3)
Devices/m5stack-tab5/Source/Configuration.cpp (2)

147-157: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider setting pin direction flags in enableSpeakerAmplifier for self-containment.

The function acquires speaker_enable_pin and calls gpio_descriptor_set_level without first calling gpio_descriptor_set_flags to set the direction to output. This works because initExpander0 (line 80) already configured the pin as output, and I/O expander direction registers persist across acquire/release cycles. However, the function is implicitly coupled to initExpander0's prior execution. Adding the set_flags call would make it robust against future reordering.

♻️ Proposed refactor
 static error_t enableSpeakerAmplifier(::Device* io_expander0) {
     auto* speaker_enable_pin = gpio_descriptor_acquire(io_expander0, GPIO_EXP0_PIN_SPEAKER_ENABLE, GPIO_OWNER_GPIO);
     check(speaker_enable_pin, "Failed to acquire speaker enable pin");
+    gpio_descriptor_set_flags(speaker_enable_pin, GPIO_FLAG_DIRECTION_OUTPUT);
     error_t error = gpio_descriptor_set_level(speaker_enable_pin, true);
     gpio_descriptor_release(speaker_enable_pin);

194-197: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Redundant error log — enableSpeakerAmplifier already logs with more detail.

enableSpeakerAmplifier logs LOG_E(TAG, "Failed to enable amplifier: %s", error_to_string(error)) on line 153, which includes the specific error code. The log on line 196 repeats the failure without the error detail. Consider removing the redundant log here, or removing the one inside enableSpeakerAmplifier and enriching this one with error_to_string(error).

♻️ Proposed refactor — remove redundant log in initBoot
     error_t error = enableSpeakerAmplifier(io_expander0);
-    if (error != ERROR_NONE) {
-        LOG_E(TAG, "Failed to enable speaker amplifier");
-    }
+    if (error != ERROR_NONE) {
+        LOG_E(TAG, "Failed to enable speaker amplifier: %s", error_to_string(error));
+    }

Alternatively, if the detailed log inside enableSpeakerAmplifier is sufficient, simplify to:

     error_t error = enableSpeakerAmplifier(io_expander0);
-    if (error != ERROR_NONE) {
-        LOG_E(TAG, "Failed to enable speaker amplifier");
-    }
+    // Error already logged by enableSpeakerAmplifier
Drivers/es8388-module/include/drivers/es8388.h (1)

9-9: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Unused struct Device; forward declaration.

The forward declaration on line 9 is not referenced by any declaration in this header. If it's intended for consumers, consider moving it to a more appropriate common header, or remove it if unnecessary.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9159fd25-7f83-4271-b6fd-7e6b59e94192

📥 Commits

Reviewing files that changed from the base of the PR and between fa4a6e2 and c5931d0.

📒 Files selected for processing (139)
  • Devices/guition-jc3248w535c/CMakeLists.txt
  • Devices/guition-jc3248w535c/device.properties
  • Devices/guition-jc3248w535c/devicetree.yaml
  • Devices/guition-jc3248w535c/guition,jc3248w535c.dts
  • Devices/guition-jc8048w550c/CMakeLists.txt
  • Devices/guition-jc8048w550c/device.properties
  • Devices/guition-jc8048w550c/devicetree.yaml
  • Devices/guition-jc8048w550c/guition,jc8048w550c.dts
  • Devices/lilygo-tdeck-plus/CMakeLists.txt
  • Devices/lilygo-tdeck-plus/device.properties
  • Devices/lilygo-tdeck-plus/devicetree.yaml
  • Devices/lilygo-tdeck-plus/lilygo,tdeck-plus.dts
  • Devices/m5stack-cardputer/CMakeLists.txt
  • Devices/m5stack-cardputer/device.properties
  • Devices/m5stack-cardputer/devicetree.yaml
  • Devices/m5stack-cardputer/m5stack,cardputer.dts
  • Devices/m5stack-stackchan/CMakeLists.txt
  • Devices/m5stack-stackchan/Source/Configuration.cpp
  • Devices/m5stack-stackchan/devicetree.yaml
  • Devices/m5stack-stackchan/m5stack,stackchan.dts
  • Devices/m5stack-sticks3/CMakeLists.txt
  • Devices/m5stack-sticks3/Source/Configuration.cpp
  • Devices/m5stack-sticks3/devicetree.yaml
  • Devices/m5stack-sticks3/m5stack,sticks3.dts
  • Devices/m5stack-tab5/CMakeLists.txt
  • Devices/m5stack-tab5/Source/Configuration.cpp
  • Devices/m5stack-tab5/devicetree.yaml
  • Devices/m5stack-tab5/m5stack,tab5.dts
  • Drivers/audio-codec-module/CMakeLists.txt
  • Drivers/audio-codec-module/LICENSE-Apache-2.0.md
  • Drivers/audio-codec-module/README.md
  • Drivers/audio-codec-module/include/tactility/drivers/audio_codec_adapters.h
  • Drivers/audio-codec-module/source/audio_codec_ctrl_if_i2c.c
  • Drivers/audio-codec-module/source/audio_codec_data_if_i2s.c
  • Drivers/audio-codec-module/source/audio_codec_gpio_if.c
  • Drivers/audio-stream-module/CMakeLists.txt
  • Drivers/audio-stream-module/LICENSE-Apache-2.0.md
  • Drivers/audio-stream-module/README.md
  • Drivers/audio-stream-module/devicetree.yaml
  • Drivers/audio-stream-module/include/audio_stream_module.h
  • Drivers/audio-stream-module/source/audio_stream.cpp
  • Drivers/audio-stream-module/source/module.cpp
  • Drivers/audio-stream-module/source/symbols.c
  • Drivers/aw88298-module/CMakeLists.txt
  • Drivers/aw88298-module/LICENSE-Apache-2.0.md
  • Drivers/aw88298-module/README.md
  • Drivers/aw88298-module/bindings/awinic,aw88298.yaml
  • Drivers/aw88298-module/devicetree.yaml
  • Drivers/aw88298-module/include/bindings/aw88298.h
  • Drivers/aw88298-module/include/drivers/aw88298.h
  • Drivers/aw88298-module/source/aw88298.cpp
  • Drivers/aw88298-module/source/module.cpp
  • Drivers/aw88298-module/source/symbols.c
  • Drivers/aw9523b-module/CMakeLists.txt
  • Drivers/aw9523b-module/LICENSE-Apache-2.0.md
  • Drivers/aw9523b-module/README.md
  • Drivers/aw9523b-module/bindings/awinic,aw9523b.yaml
  • Drivers/aw9523b-module/devicetree.yaml
  • Drivers/aw9523b-module/include/aw9523b_module.h
  • Drivers/aw9523b-module/include/bindings/aw9523b.h
  • Drivers/aw9523b-module/include/drivers/aw9523b.h
  • Drivers/aw9523b-module/source/aw9523b.cpp
  • Drivers/aw9523b-module/source/module.cpp
  • Drivers/dummy-i2s-amp-module/CMakeLists.txt
  • Drivers/dummy-i2s-amp-module/LICENSE-Apache-2.0.md
  • Drivers/dummy-i2s-amp-module/README.md
  • Drivers/dummy-i2s-amp-module/bindings/maxim,max98357a.yaml
  • Drivers/dummy-i2s-amp-module/bindings/nsiway,ns4168.yaml
  • Drivers/dummy-i2s-amp-module/devicetree.yaml
  • Drivers/dummy-i2s-amp-module/include/bindings/dummy_i2s_amp.h
  • Drivers/dummy-i2s-amp-module/include/drivers/dummy_i2s_amp.h
  • Drivers/dummy-i2s-amp-module/include/dummy_i2s_amp_module.h
  • Drivers/dummy-i2s-amp-module/source/dummy_i2s_amp.cpp
  • Drivers/dummy-i2s-amp-module/source/module.cpp
  • Drivers/dummy-i2s-amp-module/source/symbols.c
  • Drivers/es7210-module/CMakeLists.txt
  • Drivers/es7210-module/LICENSE-Apache-2.0.md
  • Drivers/es7210-module/README.md
  • Drivers/es7210-module/bindings/everest,es7210.yaml
  • Drivers/es7210-module/devicetree.yaml
  • Drivers/es7210-module/include/bindings/es7210.h
  • Drivers/es7210-module/include/drivers/es7210.h
  • Drivers/es7210-module/include/es7210_module.h
  • Drivers/es7210-module/source/es7210.cpp
  • Drivers/es7210-module/source/module.cpp
  • Drivers/es7210-module/source/symbols.c
  • Drivers/es8311-module/CMakeLists.txt
  • Drivers/es8311-module/LICENSE-Apache-2.0.md
  • Drivers/es8311-module/README.md
  • Drivers/es8311-module/bindings/everest,es8311.yaml
  • Drivers/es8311-module/devicetree.yaml
  • Drivers/es8311-module/include/bindings/es8311.h
  • Drivers/es8311-module/include/drivers/es8311.h
  • Drivers/es8311-module/source/es8311.cpp
  • Drivers/es8311-module/source/module.cpp
  • Drivers/es8311-module/source/symbols.c
  • Drivers/es8388-module/CMakeLists.txt
  • Drivers/es8388-module/LICENSE-Apache-2.0.md
  • Drivers/es8388-module/README.md
  • Drivers/es8388-module/bindings/everest,es8388.yaml
  • Drivers/es8388-module/devicetree.yaml
  • Drivers/es8388-module/include/bindings/es8388.h
  • Drivers/es8388-module/include/drivers/es8388.h
  • Drivers/es8388-module/include/es8388_module.h
  • Drivers/es8388-module/source/es8388.cpp
  • Drivers/es8388-module/source/module.cpp
  • Drivers/es8388-module/source/symbols.c
  • Drivers/pdm-mic-module/CMakeLists.txt
  • Drivers/pdm-mic-module/LICENSE-Apache-2.0.md
  • Drivers/pdm-mic-module/README.md
  • Drivers/pdm-mic-module/bindings/generic,spm1423.yaml
  • Drivers/pdm-mic-module/devicetree.yaml
  • Drivers/pdm-mic-module/include/bindings/pdm_mic.h
  • Drivers/pdm-mic-module/include/drivers/pdm_mic.h
  • Drivers/pdm-mic-module/include/pdm_mic_module.h
  • Drivers/pdm-mic-module/source/module.cpp
  • Drivers/pdm-mic-module/source/pdm_mic.cpp
  • Drivers/pdm-mic-module/source/symbols.c
  • Firmware/idf_component.yml
  • Platforms/platform-esp32/CMakeLists.txt
  • Platforms/platform-esp32/bindings/espressif,esp32-i2s.yaml
  • Platforms/platform-esp32/private/bluetooth/esp32_ble_internal.h
  • Platforms/platform-esp32/source/drivers/bluetooth/esp32_ble.cpp
  • Platforms/platform-esp32/source/drivers/esp32_i2s.cpp
  • Tactility/Include/Tactility/service/audio/Audio.h
  • Tactility/Include/Tactility/service/audio/AudioService.h
  • Tactility/Include/Tactility/settings/AudioSettings.h
  • Tactility/Source/Tactility.cpp
  • Tactility/Source/app/audiosettings/AudioSettings.cpp
  • Tactility/Source/service/audio/Audio.cpp
  • Tactility/Source/service/audio/AudioService.cpp
  • Tactility/Source/settings/AudioSettings.cpp
  • TactilityKernel/include/tactility/drivers/audio_codec.h
  • TactilityKernel/include/tactility/drivers/audio_stream.h
  • TactilityKernel/include/tactility/drivers/i2s_controller.h
  • TactilityKernel/source/drivers/audio_codec.cpp
  • TactilityKernel/source/drivers/audio_stream.cpp
  • TactilityKernel/source/drivers/i2s_controller.cpp
  • TactilityKernel/source/kernel_symbols.c

Comment thread Drivers/aw9523b-module/source/aw9523b.cpp
Comment thread Drivers/es8388-module/source/es8388.cpp Outdated
Comment thread Drivers/pdm-mic-module/README.md Outdated
Comment thread Platforms/platform-esp32/CMakeLists.txt
@KenVanHoeylandt KenVanHoeylandt merged commit 955416d into TactilityProject:main Jul 14, 2026
60 checks passed
@KenVanHoeylandt

Copy link
Copy Markdown
Contributor

Wow, that was a big one! Thanks a lot!

@Shadowtrance Shadowtrance deleted the audio-system branch July 14, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants