Initial commit
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.16.0)
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(Better_WiFi_throughput)
|
||||
@@ -0,0 +1,47 @@
|
||||
# ESP32-audioI2S, better WiFi speed
|
||||
with a high bit rate or low compression rate, the data throughput via WiFi may not be sufficient to fill the audio buffer sufficiently. In this case, the message 'slow stream, dropouts are possible' appears periodically. Better TCP settings can help. This can be achieved via menuconfig followed by Arduino compilation.
|
||||
Here is a complete example that can be easily copy that into PlatformIO.
|
||||
|
||||
|
||||
````c++
|
||||
#include <Arduino.h>
|
||||
#include "WiFiMulti.h"
|
||||
#include "Audio.h"
|
||||
|
||||
Audio audio;
|
||||
WiFiMulti wifiMulti;
|
||||
|
||||
String ssid = "xxxx";
|
||||
String password = "xxxx";
|
||||
|
||||
#define I2S_LRC 26
|
||||
#define I2S_DOUT 25
|
||||
#define I2S_BCLK 27
|
||||
#define I2S_MCLK 0
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
wifiMulti.addAP(ssid.c_str(), password.c_str());
|
||||
wifiMulti.run();
|
||||
audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT, -1, -1);
|
||||
audio.setVolume(20); // 0...21
|
||||
audio.connecttohost("http://us3.internet-radio.com:8342/stream");
|
||||
}
|
||||
|
||||
void loop(){
|
||||
audio.loop();
|
||||
}
|
||||
|
||||
// optional
|
||||
void audio_info(const char *info){
|
||||
Serial.print("info "); Serial.println(info);
|
||||
}
|
||||
|
||||
|
||||
````
|
||||
|
||||
|
||||
|
||||
These are the main settings:
|
||||

|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "esp32s3_out.ld",
|
||||
"memory_type": "qio_qspi"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": [
|
||||
"-DARDUINO_ESP32S3_12K",
|
||||
"-DBOARD_HAS_PSRAM",
|
||||
"-DARDUINO_USB_CDC_ON_BOOT=0",
|
||||
"-DARDUINO_RUNNING_CORE=1",
|
||||
"-DARDUINO_EVENT_RUNNING_CORE=1"
|
||||
],
|
||||
"f_cpu": "240000000L",
|
||||
"f_flash": "80000000L",
|
||||
"flash_mode": "qio",
|
||||
"boot_freq": "120000000L",
|
||||
"mcu": "esp32s3",
|
||||
"variant": "esp32s3"
|
||||
},
|
||||
"connectivity": [
|
||||
"wifi"
|
||||
],
|
||||
"debug": {
|
||||
"default_tool": "esp-builtin",
|
||||
"onboard_tools": [
|
||||
"esp-builtin"
|
||||
],
|
||||
"openocd_target": "esp32s3.cfg"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"espidf"
|
||||
],
|
||||
"name": "AI Thinker",
|
||||
"upload": {
|
||||
"flash_size": "8MB",
|
||||
"maximum_ram_size": 327680,
|
||||
"maximum_size": 8388608,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true,
|
||||
"require_upload_port": true,
|
||||
"speed": 460800
|
||||
},
|
||||
"url": "https://docs.ai-thinker.com/_media/esp32/docs/esp-s3-12k_v1.0.0.pdf",
|
||||
"vendor": "AI Thinker"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
dependencies:
|
||||
idf:
|
||||
component_hash: null
|
||||
source:
|
||||
type: idf
|
||||
version: 4.4.4
|
||||
manifest_hash: 42970b56113a87cad113a232ae5a1819df2189a399da7d82d7a91f5a62d9e1a1
|
||||
target: esp32
|
||||
version: 1.0.0
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
This directory is intended for project header files.
|
||||
|
||||
A header file is a file containing C declarations and macro definitions
|
||||
to be shared between several project source files. You request the use of a
|
||||
header file in your project source file (C, C++, etc) located in `src` folder
|
||||
by including it, with the C preprocessing directive `#include'.
|
||||
|
||||
```src/main.c
|
||||
|
||||
#include "header.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
Including a header file produces the same results as copying the header file
|
||||
into each source file that needs it. Such copying would be time-consuming
|
||||
and error-prone. With a header file, the related declarations appear
|
||||
in only one place. If they need to be changed, they can be changed in one
|
||||
place, and programs that include the header file will automatically use the
|
||||
new version when next recompiled. The header file eliminates the labor of
|
||||
finding and changing all the copies as well as the risk that a failure to
|
||||
find one copy will result in inconsistencies within a program.
|
||||
|
||||
In C, the usual convention is to give header files names that end with `.h'.
|
||||
It is most portable to use only letters, digits, dashes, and underscores in
|
||||
header file names, and at most one dot.
|
||||
|
||||
Read more about using header files in official GCC documentation:
|
||||
|
||||
* Include Syntax
|
||||
* Include Operation
|
||||
* Once-Only Headers
|
||||
* Computed Includes
|
||||
|
||||
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
This directory is intended for project specific (private) libraries.
|
||||
PlatformIO will compile them to static libraries and link into executable file.
|
||||
|
||||
The source code of each library should be placed in a an own separate directory
|
||||
("lib/your_library_name/[here are source files]").
|
||||
|
||||
For example, see a structure of the following two libraries `Foo` and `Bar`:
|
||||
|
||||
|--lib
|
||||
| |
|
||||
| |--Bar
|
||||
| | |--docs
|
||||
| | |--examples
|
||||
| | |--src
|
||||
| | |- Bar.c
|
||||
| | |- Bar.h
|
||||
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
|
||||
| |
|
||||
| |--Foo
|
||||
| | |- Foo.c
|
||||
| | |- Foo.h
|
||||
| |
|
||||
| |- README --> THIS FILE
|
||||
|
|
||||
|- platformio.ini
|
||||
|--src
|
||||
|- main.c
|
||||
|
||||
and a contents of `src/main.c`:
|
||||
```
|
||||
#include <Foo.h>
|
||||
#include <Bar.h>
|
||||
|
||||
int main (void)
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
PlatformIO Library Dependency Finder will find automatically dependent
|
||||
libraries scanning project source files.
|
||||
|
||||
More information about PlatformIO Library Dependency Finder
|
||||
- https://docs.platformio.org/page/librarymanager/ldf.html
|
||||
@@ -0,0 +1,4 @@
|
||||
# Name, Type, SubType, Offset, Size
|
||||
nvs, data, nvs, 0x9000, 0x4000
|
||||
phy_init, data, phy, 0xd000, 0x1000
|
||||
factory, app, factory, 0x10000, 3M,
|
||||
|
@@ -0,0 +1,62 @@
|
||||
; PlatformIO Project Configuration File
|
||||
;
|
||||
; Build options: build flags, source filter
|
||||
; Upload options: custom upload port, speed and extra flags
|
||||
; Library options: dependencies, extra library storages
|
||||
; Advanced options: extra scripting
|
||||
;
|
||||
; Please visit documentation for the other options and examples
|
||||
; https://docs.platformio.org/en/latest/platforms/espressif32.html
|
||||
|
||||
[env:esp32dev]
|
||||
platform = https://github.com/platformio/platform-espressif32.git#v6.2.0 ; ESP-IDF v4.4.4
|
||||
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.8
|
||||
|
||||
;framework = arduino
|
||||
framework = arduino, espidf
|
||||
|
||||
|
||||
board = esp32dev ;chipmodel ESP32, 4M FLASH, USBtoTTL
|
||||
;board = um_tinys3 ;chipmodel ESP32S3, 8M FLASH, HAS_PSRAM, SerialUSB
|
||||
;board = esp32-12k ;chipmodel ESP32S3, 8M FLASH, HAS_PSRAM, USBtoTTL
|
||||
|
||||
board_build.f_cpu = 240000000L
|
||||
board_build.flash_size=4MB
|
||||
board_build.flash_freq=80M
|
||||
board_build.spiram_mode=2
|
||||
monitor_speed = 115200
|
||||
monitor_filters = esp32_exception_decoder
|
||||
board_build.partitions = partitions.csv
|
||||
upload_speed = 460800 ; 921600, 512000, 460800, 256000, 115200
|
||||
|
||||
|
||||
lib_deps =
|
||||
https://github.com/schreibfaul1/ESP32-audioI2S.git
|
||||
|
||||
|
||||
board_upload.maximum_size = 3145728
|
||||
board_upload.flash_size = 4MB
|
||||
board_build.flash_mode = qio
|
||||
board_build.bootloader = dio
|
||||
board_build.arduino.upstream_packages = no
|
||||
|
||||
;build_flags = -DCORE_DEBUG_LEVEL=0 ; None
|
||||
;build_flags = -DCORE_DEBUG_LEVEL=1 ; Error
|
||||
;build_flags = -DCORE_DEBUG_LEVEL=2 ; Warn
|
||||
;build_flags = -DCORE_DEBUG_LEVEL=3 ; Info
|
||||
;build_flags = -DCORE_DEBUG_LEVEL=4 ; Debug
|
||||
;build_flags = -DCORE_DEBUG_LEVEL=5 ; Verbose
|
||||
|
||||
build_flags =
|
||||
-Wall
|
||||
-Wextra
|
||||
-DCORE_DEBUG_LEVEL=3
|
||||
-DCONFIG_ARDUHAL_LOG_COLORS
|
||||
-DBOARD_HAS_PSRAM
|
||||
; -DAUDIO_LOG
|
||||
-DARDUINO_RUNNING_CORE=1 ; Arduino Runs On Core (setup, loop)
|
||||
-DARDUINO_EVENT_RUNNING_CORE=1 ; Events Run On Core
|
||||
|
||||
build_unflags =
|
||||
; -DARDUINO_USB_CDC_ON_BOOT=0 ; traditional log
|
||||
; -DBOARD_HAS_PSRAM
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
# This file was automatically generated for projects
|
||||
# without default 'CMakeLists.txt' file.
|
||||
|
||||
FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/src/*.*)
|
||||
|
||||
idf_component_register(SRCS ${app_sources})
|
||||
@@ -0,0 +1,33 @@
|
||||
#include <Arduino.h>
|
||||
#include "WiFiMulti.h"
|
||||
#include "Audio.h"
|
||||
|
||||
Audio audio;
|
||||
WiFiMulti wifiMulti;
|
||||
|
||||
String ssid = "xxxx";
|
||||
String password = "xxxx";
|
||||
|
||||
#define I2S_LRC 26
|
||||
#define I2S_DOUT 25
|
||||
#define I2S_BCLK 27
|
||||
#define I2S_MCLK 0
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
wifiMulti.addAP(ssid.c_str(), password.c_str());
|
||||
wifiMulti.run();
|
||||
audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT, -1, -1);
|
||||
audio.setVolume(20); // 0...21
|
||||
audio.setConnectionTimeout(500, 2700);
|
||||
audio.connecttohost("http://us3.internet-radio.com:8342/stream");
|
||||
}
|
||||
|
||||
void loop(){
|
||||
audio.loop();
|
||||
}
|
||||
|
||||
// optional
|
||||
void audio_info(const char *info){
|
||||
Serial.print("info "); Serial.println(info);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
This directory is intended for PlatformIO Test Runner and project tests.
|
||||
|
||||
Unit Testing is a software testing method by which individual units of
|
||||
source code, sets of one or more MCU program modules together with associated
|
||||
control data, usage procedures, and operating procedures, are tested to
|
||||
determine whether they are fit for use. Unit testing finds problems early
|
||||
in the development cycle.
|
||||
|
||||
More information about PlatformIO Unit Testing:
|
||||
- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html
|
||||
Reference in New Issue
Block a user