Update docs on audio module. Still WIP, so YMMV

This commit is contained in:
Thomas Göttgens 2022-12-14 09:03:27 +01:00
parent 650b219df5
commit 0017c36ec4

View file

@ -8,9 +8,9 @@ sidebar_label: Audio
import Tabs from '@theme/Tabs'; import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem'; import TabItem from '@theme/TabItem';
The audio module config options are: Codec2 Enabled, Microphone ADC Channel, Speaker PWM GPIO, PTT GPIO, Audio Bitrate/Codec Mode. Audio Module config uses an admin message sending a `ConfigModule.Audio` protobuf. The audio module config options are: Codec2 Enabled, PTT GPIO, Audio Bitrate/Codec Mode, I2S Word Select, I2S Data IN, I2S Data OUT and I2S Clock. Audio Module config uses an admin message sending a `ConfigModule.Audio` protobuf.
With this **experimental** module, you can add a microphone and speaker to any ESP32 device that has a SX128x radio and operates on the 2.4 GHz ISM Band. The Sub-1GHz bands are not wide enough to support continuous audio packets on the mesh, even in the Short and Fast modes. Right now, the only device supported is the LilyGo TLora 2.1-1.8 board. With this **experimental** module, you can add a digital I2S microphone and speaker to any ESP32 device that has a SX128x radio and operates on the 2.4 GHz ISM Band. The Sub-1GHz bands are not wide enough to support continuous audio packets on the mesh, even in the Short and Fast modes. Right now, the only device supported is the LilyGo TLora 2.1-1.8 board.
## Audio Module Config Values ## Audio Module Config Values
@ -18,14 +18,6 @@ With this **experimental** module, you can add a microphone and speaker to any E
Enables the audio module. Enables the audio module.
### Microphone ADC Channel
The ADC channel to use for the microphone. The default is 6 which maps to GPIO 34 on the ESP32.
### Speaker PWM GPIO
The GPIO to use for the speaker. The default is GPIO 14 on the ESP32.
### PTT GPIO ### PTT GPIO
The GPIO to use for the Push-To-Talk button. The default is GPIO 39 on the ESP32. The GPIO to use for the Push-To-Talk button. The default is GPIO 39 on the ESP32.
@ -44,6 +36,26 @@ The bitrate to use for audio. The default is `CODEC2_700B`. The available option
* CODEC2_700B * CODEC2_700B
* CODEC2_700 * CODEC2_700
### I2S Word Select
The GPIO to use for the WS signal in the I2S interface.
### I2S Data IN
The GPIO to use for the SD signal in the I2S interface.
### I2S Data OUT
The GPIO to use for the DIN signal in the I2S interface.
### I2S Clock
The GPIO to use for the SCK signal in the I2S interface.
:::info What is this?
These Pins comprise an I2S digital audio interface. Meshtastic uses it in monoaural mode. The software will use the logical 'LEFT' Stereo channel for the microphone and the logical 'RIGHT' Stereo channel for the speaker, so configure your breakouts accordingly. Audio is Half-Duplex, so we can re-use part of the pins for a bi-directional configuration. There's __no__ default pin assigment, setting these is mandatory.
:::
## Audio Module Config Client Availability ## Audio Module Config Client Availability
<Tabs <Tabs
@ -82,10 +94,12 @@ All audio module config options are available in the python CLI. Example command
| Setting | Acceptable Values | Default | | Setting | Acceptable Values | Default |
| :-------------------: | :-----------------: | :-----: | | :-------------------: | :-----------------: | :-----: |
| audio.enabled | `true`, `false` | `false` | | audio.enabled | `true`, `false` | `false` |
| audio.mic_chan | ADC Number 0-7 | Default of `6` is Unset |
| audio.amp_pin | GPIO Pin Number 1-33 | Default of `14` is Unset |
| audio.ptt_pin | GPIO Pin Number 1-39 | Default of `39` is Unset | | audio.ptt_pin | GPIO Pin Number 1-39 | Default of `39` is Unset |
| audio.bitrate | `CODEC2_DEFAULT` `CODEC2_3200` `CODEC2_2400` `CODEC2_1600` `CODEC2_1400` `CODEC2_1300` `CODEC2_1200` `CODEC2_700B` `CODEC2_700` | `CODEC2_DEFAULT` | | audio.bitrate | `CODEC2_DEFAULT` `CODEC2_3200` `CODEC2_2400` `CODEC2_1600` `CODEC2_1400` `CODEC2_1300` `CODEC2_1200` `CODEC2_700B` `CODEC2_700` | `CODEC2_DEFAULT` |
| audio.i2s_ws | GPIO Pin Number 1-34 | no Default |
| audio.i2s_sd | GPIO Pin Number 1-39 | no Default |
| audio.i2s_din | GPIO Pin Number 1-34 | no Default |
| audio.i2s_sck | GPIO Pin Number 1-34 | no Default |
```shell title="Enable / Disable Module" ```shell title="Enable / Disable Module"
@ -93,12 +107,12 @@ meshtastic --set audio.enabled true
meshtastic --set audio.enabled false meshtastic --set audio.enabled false
``` ```
```shell title="Set ADC Channel number 7" ```shell title="Set WS to GPIO pin number 7"
meshtastic --set audio.mic_chan 7 meshtastic --set audio.i2s_ws 7
``` ```
```shell title="Set PWM to GPIO pin number 28" ```shell title="Set DIN to GPIO pin number 28"
meshtastic --set audio.amp_pin 28 meshtastic --set audio.i2s_din 28
``` ```
```shell title="Set PTT to GPIO pin number 37" ```shell title="Set PTT to GPIO pin number 37"