meshtastic/docs/configuration/module/audio.mdx

170 lines
5.8 KiB
Plaintext
Raw Normal View History

2022-11-09 03:17:06 -08:00
---
id: audio
title: Audio Module Configuration
sidebar_label: Audio
description: Configuration details for the Audio Module of your Meshtastic device.
2022-11-09 03:17:06 -08:00
---
2023-01-19 05:01:57 -08:00
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
2022-11-09 03:17:06 -08:00
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.
2022-11-09 03:17:06 -08:00
2024-03-19 21:34:13 -07:00
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 devices supported are the LilyGo TLora 2.1-1.8 and TLora T3S3 boards. The module has been designed for channels with 2kbit / sec of bandwidth or greater.
Required additional hardware:
* Max98357 - I2S 3W Class D Amplifier
* MSM261S4030H0 - I2S MEMS Low Noise Single Microphone
2022-11-09 03:17:06 -08:00
## Audio Module Config Values
### Codec2 Enabled
Enables the audio module.
### PTT GPIO
The GPIO to use for the Push-To-Talk button. The default is GPIO 39 on the ESP32.
### Audio Bitrate/Codec Mode
The bitrate to use for audio. The default is `CODEC2_700B`. The available options are:
2023-01-19 05:01:57 -08:00
- CODEC2_DEFAULT
- CODEC2_3200
- CODEC2_2400
- CODEC2_1600
- CODEC2_1400
- CODEC2_1300
- CODEC2_1200
- CODEC2_700B
- CODEC2_700
2022-11-09 03:17:06 -08:00
### 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?
2023-06-09 17:16:03 -07:00
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 assignment, setting these is mandatory.
:::
2022-11-09 03:17:06 -08:00
## Audio Module Config Client Availability
<Tabs
groupId="settings"
defaultValue="apple"
values={[
{label: 'Android', value: 'android'},
{label: 'Apple', value: 'apple'},
{label: 'CLI', value: 'cli'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="android">
2024-02-22 13:09:26 -08:00
#### Android
2022-11-09 03:17:06 -08:00
:::info
2022-12-04 13:23:40 -08:00
Audio Config options are available for Android.
1. Open the Meshtastic App
2023-06-17 22:06:11 -07:00
2. Navigate to: **Vertical Ellipsis (3 dots top right) > Radio Configuration > Audio**
2022-12-04 13:23:40 -08:00
2022-11-09 03:17:06 -08:00
:::
</TabItem>
<TabItem value="apple">
2024-02-22 13:09:26 -08:00
#### Apple
2022-11-09 03:17:06 -08:00
:::info
Audio module config is not available on iOS, iPadOS and macOS.
:::
</TabItem>
<TabItem value="cli">
2024-02-22 13:09:26 -08:00
#### CLI
2023-01-19 05:01:57 -08:00
:::info
2022-11-09 03:17:06 -08:00
All audio module config options are available in the python CLI. Example commands are below:
:::
2023-07-06 11:54:07 -07:00
| Setting | Acceptable Values | Default |
| :----------------: | :-----------------------------------------------------------------------------------------------------------------------------: | :----------------------: |
|audio.codec2_enabled| `true`, `false` | `false` |
| 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.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 |
2022-11-09 03:17:06 -08:00
:::tip
Because the device will reboot after each command is sent via CLI, it is recommended when setting multiple values in a config section that commands be chained together as one.
```shell title="Example:"
2023-07-06 11:57:01 -07:00
meshtastic --set audio.codec2_enabled true --set audio.bitrate CODEC2_1400
```
:::
2022-11-09 03:17:06 -08:00
```shell title="Enable / Disable Module"
2023-07-06 11:57:01 -07:00
meshtastic --set audio.codec2_enabled true
meshtastic --set audio.codec2_enabled false
2022-11-09 03:17:06 -08:00
```
```shell title="Set WS to GPIO pin number 7"
meshtastic --set audio.i2s_ws 7
2022-11-09 03:17:06 -08:00
```
```shell title="Set DIN to GPIO pin number 28"
meshtastic --set audio.i2s_din 28
2022-11-09 03:17:06 -08:00
```
```shell title="Set PTT to GPIO pin number 37"
meshtastic --set audio.ptt_pin 37
```
```shell title="Set Codec Bitrate"
meshtastic --set audio.bitrate CODEC2_DEFAULT
meshtastic --set audio.bitrate CODEC2_1400
```
</TabItem>
<TabItem value="web">
2022-11-09 03:17:06 -08:00
2024-02-22 13:09:26 -08:00
#### Web
2022-11-09 03:17:06 -08:00
:::info
All audio module config options are available in the Web UI.
:::
2023-01-19 05:01:57 -08:00
2024-02-22 13:09:26 -08:00
</TabItem>
2022-11-09 03:17:06 -08:00
</Tabs>
:::warning
2022-11-09 03:17:06 -08:00
GPIO access is fundamentally dangerous because invalid options can physically damage or destroy your hardware. Ensure that you fully understand the schematic for your particular device before trying this as we do not offer a warranty. Use at your own risk.
This module requires attaching a peripheral accessory to your device. It will not work without one.
2022-11-09 03:17:06 -08:00
:::