Audio System + Drivers#562
Conversation
plus bluetooth fix for P4
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (40)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (27)
📝 WalkthroughWalkthroughThis 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)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (3)
Devices/m5stack-tab5/Source/Configuration.cpp (2)
147-157: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider setting pin direction flags in
enableSpeakerAmplifierfor self-containment.The function acquires
speaker_enable_pinand callsgpio_descriptor_set_levelwithout first callinggpio_descriptor_set_flagsto set the direction to output. This works becauseinitExpander0(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 toinitExpander0's prior execution. Adding theset_flagscall 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 valueRedundant error log —
enableSpeakerAmplifieralready logs with more detail.
enableSpeakerAmplifierlogsLOG_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 insideenableSpeakerAmplifierand enriching this one witherror_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
enableSpeakerAmplifieris 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 enableSpeakerAmplifierDrivers/es8388-module/include/drivers/es8388.h (1)
9-9: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUnused
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
📒 Files selected for processing (139)
Devices/guition-jc3248w535c/CMakeLists.txtDevices/guition-jc3248w535c/device.propertiesDevices/guition-jc3248w535c/devicetree.yamlDevices/guition-jc3248w535c/guition,jc3248w535c.dtsDevices/guition-jc8048w550c/CMakeLists.txtDevices/guition-jc8048w550c/device.propertiesDevices/guition-jc8048w550c/devicetree.yamlDevices/guition-jc8048w550c/guition,jc8048w550c.dtsDevices/lilygo-tdeck-plus/CMakeLists.txtDevices/lilygo-tdeck-plus/device.propertiesDevices/lilygo-tdeck-plus/devicetree.yamlDevices/lilygo-tdeck-plus/lilygo,tdeck-plus.dtsDevices/m5stack-cardputer/CMakeLists.txtDevices/m5stack-cardputer/device.propertiesDevices/m5stack-cardputer/devicetree.yamlDevices/m5stack-cardputer/m5stack,cardputer.dtsDevices/m5stack-stackchan/CMakeLists.txtDevices/m5stack-stackchan/Source/Configuration.cppDevices/m5stack-stackchan/devicetree.yamlDevices/m5stack-stackchan/m5stack,stackchan.dtsDevices/m5stack-sticks3/CMakeLists.txtDevices/m5stack-sticks3/Source/Configuration.cppDevices/m5stack-sticks3/devicetree.yamlDevices/m5stack-sticks3/m5stack,sticks3.dtsDevices/m5stack-tab5/CMakeLists.txtDevices/m5stack-tab5/Source/Configuration.cppDevices/m5stack-tab5/devicetree.yamlDevices/m5stack-tab5/m5stack,tab5.dtsDrivers/audio-codec-module/CMakeLists.txtDrivers/audio-codec-module/LICENSE-Apache-2.0.mdDrivers/audio-codec-module/README.mdDrivers/audio-codec-module/include/tactility/drivers/audio_codec_adapters.hDrivers/audio-codec-module/source/audio_codec_ctrl_if_i2c.cDrivers/audio-codec-module/source/audio_codec_data_if_i2s.cDrivers/audio-codec-module/source/audio_codec_gpio_if.cDrivers/audio-stream-module/CMakeLists.txtDrivers/audio-stream-module/LICENSE-Apache-2.0.mdDrivers/audio-stream-module/README.mdDrivers/audio-stream-module/devicetree.yamlDrivers/audio-stream-module/include/audio_stream_module.hDrivers/audio-stream-module/source/audio_stream.cppDrivers/audio-stream-module/source/module.cppDrivers/audio-stream-module/source/symbols.cDrivers/aw88298-module/CMakeLists.txtDrivers/aw88298-module/LICENSE-Apache-2.0.mdDrivers/aw88298-module/README.mdDrivers/aw88298-module/bindings/awinic,aw88298.yamlDrivers/aw88298-module/devicetree.yamlDrivers/aw88298-module/include/bindings/aw88298.hDrivers/aw88298-module/include/drivers/aw88298.hDrivers/aw88298-module/source/aw88298.cppDrivers/aw88298-module/source/module.cppDrivers/aw88298-module/source/symbols.cDrivers/aw9523b-module/CMakeLists.txtDrivers/aw9523b-module/LICENSE-Apache-2.0.mdDrivers/aw9523b-module/README.mdDrivers/aw9523b-module/bindings/awinic,aw9523b.yamlDrivers/aw9523b-module/devicetree.yamlDrivers/aw9523b-module/include/aw9523b_module.hDrivers/aw9523b-module/include/bindings/aw9523b.hDrivers/aw9523b-module/include/drivers/aw9523b.hDrivers/aw9523b-module/source/aw9523b.cppDrivers/aw9523b-module/source/module.cppDrivers/dummy-i2s-amp-module/CMakeLists.txtDrivers/dummy-i2s-amp-module/LICENSE-Apache-2.0.mdDrivers/dummy-i2s-amp-module/README.mdDrivers/dummy-i2s-amp-module/bindings/maxim,max98357a.yamlDrivers/dummy-i2s-amp-module/bindings/nsiway,ns4168.yamlDrivers/dummy-i2s-amp-module/devicetree.yamlDrivers/dummy-i2s-amp-module/include/bindings/dummy_i2s_amp.hDrivers/dummy-i2s-amp-module/include/drivers/dummy_i2s_amp.hDrivers/dummy-i2s-amp-module/include/dummy_i2s_amp_module.hDrivers/dummy-i2s-amp-module/source/dummy_i2s_amp.cppDrivers/dummy-i2s-amp-module/source/module.cppDrivers/dummy-i2s-amp-module/source/symbols.cDrivers/es7210-module/CMakeLists.txtDrivers/es7210-module/LICENSE-Apache-2.0.mdDrivers/es7210-module/README.mdDrivers/es7210-module/bindings/everest,es7210.yamlDrivers/es7210-module/devicetree.yamlDrivers/es7210-module/include/bindings/es7210.hDrivers/es7210-module/include/drivers/es7210.hDrivers/es7210-module/include/es7210_module.hDrivers/es7210-module/source/es7210.cppDrivers/es7210-module/source/module.cppDrivers/es7210-module/source/symbols.cDrivers/es8311-module/CMakeLists.txtDrivers/es8311-module/LICENSE-Apache-2.0.mdDrivers/es8311-module/README.mdDrivers/es8311-module/bindings/everest,es8311.yamlDrivers/es8311-module/devicetree.yamlDrivers/es8311-module/include/bindings/es8311.hDrivers/es8311-module/include/drivers/es8311.hDrivers/es8311-module/source/es8311.cppDrivers/es8311-module/source/module.cppDrivers/es8311-module/source/symbols.cDrivers/es8388-module/CMakeLists.txtDrivers/es8388-module/LICENSE-Apache-2.0.mdDrivers/es8388-module/README.mdDrivers/es8388-module/bindings/everest,es8388.yamlDrivers/es8388-module/devicetree.yamlDrivers/es8388-module/include/bindings/es8388.hDrivers/es8388-module/include/drivers/es8388.hDrivers/es8388-module/include/es8388_module.hDrivers/es8388-module/source/es8388.cppDrivers/es8388-module/source/module.cppDrivers/es8388-module/source/symbols.cDrivers/pdm-mic-module/CMakeLists.txtDrivers/pdm-mic-module/LICENSE-Apache-2.0.mdDrivers/pdm-mic-module/README.mdDrivers/pdm-mic-module/bindings/generic,spm1423.yamlDrivers/pdm-mic-module/devicetree.yamlDrivers/pdm-mic-module/include/bindings/pdm_mic.hDrivers/pdm-mic-module/include/drivers/pdm_mic.hDrivers/pdm-mic-module/include/pdm_mic_module.hDrivers/pdm-mic-module/source/module.cppDrivers/pdm-mic-module/source/pdm_mic.cppDrivers/pdm-mic-module/source/symbols.cFirmware/idf_component.ymlPlatforms/platform-esp32/CMakeLists.txtPlatforms/platform-esp32/bindings/espressif,esp32-i2s.yamlPlatforms/platform-esp32/private/bluetooth/esp32_ble_internal.hPlatforms/platform-esp32/source/drivers/bluetooth/esp32_ble.cppPlatforms/platform-esp32/source/drivers/esp32_i2s.cppTactility/Include/Tactility/service/audio/Audio.hTactility/Include/Tactility/service/audio/AudioService.hTactility/Include/Tactility/settings/AudioSettings.hTactility/Source/Tactility.cppTactility/Source/app/audiosettings/AudioSettings.cppTactility/Source/service/audio/Audio.cppTactility/Source/service/audio/AudioService.cppTactility/Source/settings/AudioSettings.cppTactilityKernel/include/tactility/drivers/audio_codec.hTactilityKernel/include/tactility/drivers/audio_stream.hTactilityKernel/include/tactility/drivers/i2s_controller.hTactilityKernel/source/drivers/audio_codec.cppTactilityKernel/source/drivers/audio_stream.cppTactilityKernel/source/drivers/i2s_controller.cppTactilityKernel/source/kernel_symbols.c
|
Wow, that was a big one! Thanks a lot! |
Audio subsystem + settings
IO Expander for Stackchan (and whatever else uses it, i forget)
Implemented the new system and drivers on the following devices:
plus bluetooth fix for P4
Summary by CodeRabbit
New Features
Bug Fixes
Documentation