Sound with ESP32 - ...
 
Notifications
Clear all

Sound with ESP32 - I2S Protocol

42 Posts
4 Users
4 Likes
897 Views
Mo1977
(@mo1977)
Active Member
Joined: 5 months ago
Posts: 17
 

@zander #1. I have tried snip & sketch only to have the tools menu disappear when I hit enter. And alt print screen only to have the tools menu disappear also.

#2. If I run the sketch with the board esp32 dev module it compiles.  Any other board I get the no such file or directory error message.  I did a search of my HD and "driver/i2s.h" is not found.  Yet, it must be on the HD or it wouldn't have compiled. That's why I was looking for a link.

FYI, I do know how to do a print screen or use the snip & sketch to get a screen capture.  My Win 10 machine hates me.


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3462
 

@mo1977 Take a picture with your phone.

If it compiles with esp32dev then you are done, why try another board, these libraries only work with certain boards.

Unless you have a compelling reason, this problem is solved.

 

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3462
 

@mo1977 You search for i2s.h NOT driver/i2s.h

Am I being punked?????

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
Mo1977
(@mo1977)
Active Member
Joined: 5 months ago
Posts: 17
 

@zander I searched for both.

i2s.h564
driver i2s

No punking here.  This is frustrating.  I am going to just make an analog audio amp and forget the esp32.  Have a better day that I am having.

 


   
ReplyQuote
Mo1977
(@mo1977)
Active Member
Joined: 5 months ago
Posts: 17
 

   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3462
 

@mo1977 What sketch is that?

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3462
 

@mo1977 Why are you posting a png file of a system hdr?

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3462
 

@mo1977 I don't think you can search that way.

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3462
 

@mo1977 You said

Yet, it must be on the HD or it wouldn't have compiled. That's why I was looking for a link.

If it compiled, then your 'problem' is fixed!

AND you said earlier

#2. If I run the sketch with the board esp32 dev module it compiles. 

Again, problem solved.

Why do you continue to say it works then say it doesn't work. 

I am going to make a guess that you do not understand that these libraries are board specific. If it doesn't work for a different board then it isn't supported. I use esp32dev all the time with various esp32's connected. Most will work. If you select esp32-my-weird-board and it fails on can't find i2s.h then that board does not support the i2s protocol.

 

 

 

 

 

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3462
 

@mo1977 I do not know how many years you have been programming at 2,000 hrs per year, I also do not know how many languages you know, nor do I know if you are trained in the innards of an IDE and the build process but it appears unlikely. Here is the result of simply searching the IDE root folder/dir for I2S.h and the information it gave me.

This is the path to #include <I2S.h>
/Users/ronalexander/Library/Arduino15/packages/esp32/hardware/esp32/2.0.4/libraries/I2S/src/I2S.h
and it starts with the following followed by 156 more lines
/*
Copyright (c) 2016 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef _I2S_H_INCLUDED
#define _I2S_H_INCLUDED

#include <Arduino.h>
#include "freertos/ringbuf.h"

namespace esp_i2s {
#include "driver/i2s.h" // ESP specific i2s driver
}

// Default pins
#ifndef PIN_I2S_SCK
#define PIN_I2S_SCK 14
#endif

#ifndef PIN_I2S_FS
#if CONFIG_IDF_TARGET_ESP32S2
#define PIN_I2S_FS 27
#else
#define PIN_I2S_FS 25
#endif
#endif
===================================
This is the path to #include <driver/I2S.h>
/Users/ronalexander/Library/Arduino15/packages/esp32/hardware/esp32/2.0.4/tools/sdk/esp32/include/driver/include/driver/i2s.h
and it starts with the following followed by 467 more lines
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#include "esp_types.h"
#include "esp_err.h"
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "soc/i2s_periph.h"
#include "soc/rtc_periph.h"
#include "soc/soc_caps.h"
#include "hal/i2s_types.h"
#include "driver/periph_ctrl.h"
#include "esp_intr_alloc.h"

#if SOC_I2S_SUPPORTS_ADC
#include "driver/adc.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif

#define I2S_PIN_NO_CHANGE (-1) /*!< Use in i2s_pin_config_t for pins which should not be changed */

/**
* @brief I2S port number, the max port number is (I2S_NUM_MAX -1).
*/
typedef enum {
I2S_NUM_0 = 0, /*!< I2S port 0 */
#if SOC_I2S_NUM > 1
I2S_NUM_1 = 1, /*!< I2S port 1 */
#endif
I2S_NUM_MAX, /*!< I2S port max */
} i2s_port_t;

There are multiple I2S.h files on your HD for different boards, for use when working at the driver level and for normal API use. You found nothing on a google search I found over a million hits and over 400,000 for driver/I2S.h. Clearly your computer is broken.

You admit to getting clean compiles both in IDE2 and IDE1 when correctly specifying the board as esp32dev.

This begs the question of why did you start this thread if it compiles ok.

This topic is solved, and I will not be responding anymore. unsubscribe.

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
Mo1977
(@mo1977)
Active Member
Joined: 5 months ago
Posts: 17
 

@zander You're correct.  It is board specific.  My ignorance of this subject is causing my problems.  Thanks for your time and patience.

Mo


   
Ron reacted
ReplyQuote
Mo1977
(@mo1977)
Active Member
Joined: 5 months ago
Posts: 17
 

@zander Thanks.  Now, I know. And understand.


   
Ron reacted
ReplyQuote
Page 3 / 3