# ============================================================================= # GENERIC ESP32-S3 VOIP MIC-ONLY - native ESPHome audio # ============================================================================= # Standalone mic-only VoIP profile for native ESPHome audio. # # Purpose: # - No esp_audio_stack. # - No esp_aec / esp_afe software processing. # - voip_stack talks directly to a standard ESPHome microphone. # - Good starting point for microphones/codecs/front-ends that already output # the capture signal you want to send, including hardware-DSP boards. # - Also useful for simple native-I2S TX tests where echo cancellation is not # part of the firmware profile. # # Endpoint mode: mic_only. This profile publishes a microphone source and no # speaker, so it can send audio but cannot play remote audio. # # Tested hardware example: # - Generic ESP32-S3 with PSRAM. # - INMP441 microphone on one I2S controller. # This is only the tested wiring example; native ESPHome audio can also be # adapted to hardware that exposes a processed microphone through another # ESPHome microphone platform. # ESPHome native I2S does not add software AEC by itself. # # Tested wiring target: Freenove ESP32-S3-WROOM CAM / FNK0085, camera removed. # Change pins for your board. # # INMP441: # SCK/BCLK -> GPIO9 # WS/LRCLK -> GPIO10 # SD/DOUT -> GPIO11 # L/R -> 3V3, tied locally with VDD so the mic outputs right channel # VDD -> 3V3 # GND -> GND # # ============================================================================= # ============================================================================= # PROJECT SETUP # ============================================================================= substitutions: name: generic-native-int-mic friendly_name: Generic S3 Native VoIP Mic Only ext_components_source: "github://n-IA-hane/esphome-intercom@main" voip_stack_components_source: "github://n-IA-hane/esphome-voip-stack@main" audio_stack_components_source: "github://n-IA-hane/esphome-audio-stack@main" # --------------------------------------------------------------------------- # Pinout: native microphone I2S bus # --------------------------------------------------------------------------- rx_i2s_bclk_pin: GPIO9 rx_i2s_lrclk_pin: GPIO10 rx_i2s_din_pin: GPIO11 # --------------------------------------------------------------------------- # Pinout: optional status LED # --------------------------------------------------------------------------- status_led_pin: GPIO48 status_led_chipset: WS2812 status_led_rgb_order: GRB # Shared voip-only packages: SIP transport, HA phonebook sync, API actions, # basic buttons and native diagnostics. packages: ha_integration: github://n-IA-hane/esphome-intercom/packages/voip/ha_integration.yaml@main simple_led_status_mic_only: github://n-IA-hane/esphome-intercom/packages/voip/simple_led_status_mic_only.yaml@main callbacks: github://n-IA-hane/esphome-intercom/packages/voip/callbacks.yaml@main voip_transport: github://n-IA-hane/esphome-intercom/packages/voip/transport.yaml@main phonebook_subscribe: github://n-IA-hane/esphome-intercom/packages/voip/phonebook_subscribe.yaml@main ha_api: github://n-IA-hane/esphome-intercom/packages/voip/ha_api.yaml@main voip_entities_full_duplex: github://n-IA-hane/esphome-intercom/packages/voip/entities_full_duplex.yaml@main call_settings: github://n-IA-hane/esphome-intercom/packages/voip/call_settings.yaml@main s3_base: github://n-IA-hane/esphome-intercom/packages/platform/esp32s3_base.yaml@main native_diagnostics: github://n-IA-hane/esphome-intercom/packages/diagnostics/native.yaml@main status_led: github://n-IA-hane/esphome-intercom/packages/led/status_ws2812_single.yaml@main # ============================================================================= # BOARD AND MEMORY # ============================================================================= # Device identity exposed to ESPHome, HA and the shared VoIP phonebook. esphome: name: ${name} friendly_name: ${friendly_name} # ESP32-S3 native-audio target. This mic-only profile validates the VoIP TX path # against the standard ESPHome microphone interface. esp32: board: freenove_esp32_s3_wroom variant: esp32s3 flash_size: 8MB framework: type: esp-idf advanced: compiler_optimization: PERF sdkconfig_options: CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC: "y" CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG: "y" CONFIG_ESP_CONSOLE_SECONDARY_NONE: "y" # PSRAM gives VoIP tasks and buffers headroom even on the native ESPHome path. psram: mode: octal speed: 80MHz # Persist user settings without excessive flash writes. preferences: flash_write_interval: 5min # ============================================================================= # EXTERNAL COMPONENTS # ============================================================================= # Project components used by the native path: voip_stack plus the shared # internal VoIP task/ring-buffer helpers, without esp_audio_stack. external_components: - source: ${voip_stack_components_source} components: [voip_stack] # ============================================================================= # CONNECTIVITY # ============================================================================= # Normal Wi-Fi client mode. Power save is disabled for low-latency SIP/RTP and # reliable HA API updates. wifi: ssid: !secret wifi_ssid password: !secret wifi_password power_save_mode: NONE # OTA update endpoint used by ESPHome Dashboard and `esphome upload`. ota: - platform: esphome # USB Serial/JTAG logger. VoIP domains stay visible at INFO; noisy entity # domains stay WARN for normal field use. logger: hardware_uart: USB_SERIAL_JTAG level: INFO logs: voip_stack: INFO voip_stack.fsm: INFO voip_stack.tcp: INFO voip_stack.udp: INFO voip_stack.audio: INFO voip_stack.settings: INFO sensor: WARN text_sensor: WARN binary_sensor: WARN switch: WARN number: WARN button: WARN api: WARN api.connection: WARN component: WARN i2s_audio: INFO microphone: INFO # ============================================================================= # BUSES # ============================================================================= # Native ESPHome I2S RX bus for the microphone. i2s_audio: - id: rx_i2s i2s_bclk_pin: ${rx_i2s_bclk_pin} i2s_lrclk_pin: ${rx_i2s_lrclk_pin} # ============================================================================= # AUDIO PIPELINE # ============================================================================= # Native ESPHome microphone. INMP441 is strapped to the right slot. Keep the # wire as stereo and let MicrophoneSource select channel 1; this matches the # stable esp_audio_stack path and avoids mono-slot silence on some IDF/board # combinations. microphone: - platform: i2s_audio id: mic_main adc_type: external i2s_audio_id: rx_i2s i2s_din_pin: ${rx_i2s_din_pin} channel: stereo sample_rate: 48000 bits_per_sample: 32bit correct_dc_offset: true # ============================================================================= # MEDIA, ASSIST AND VOIP # ============================================================================= # Local SIP phone in mic-only mode. It can originate/send audio but has no # speaker sink, so remote audio playback is intentionally absent. voip_stack: id: phone task_stacks_in_psram: true buffers_in_psram: true audio: tx: sample_rate: 48000 pcm_format: s16le channels: 1 frame_ms: 10 # SIP/SDP still needs a packet-time-compatible opposite direction even # though endpoint mode remains mic_only and no speaker path is created. rx: sample_rate: 48000 pcm_format: s16le channels: 1 frame_ms: 10 microphone_source: microphone: mic_main bits_per_sample: 16 channels: [1] gain_factor: 1 dc_offset_removal: false ringing_timeout: 30s delete_contact_missing_from: updates_number: 1