Sound with ESP32 - ...
 
Notifications
Clear all

Sound with ESP32 - I2S Protocol

57 Posts
5 Users
4 Likes
5,050 Views
(@mo1977)
Member
Joined: 2 years ago
Posts: 16
 

@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)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

@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.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

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

Am I being punked?????

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@mo1977)
Member
Joined: 2 years ago
Posts: 16
 

@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)
Member
Joined: 2 years ago
Posts: 16
 

   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

@mo1977 What sketch is that?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

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

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

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

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

@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.

 

 

 

 

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

@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.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@mo1977)
Member
Joined: 2 years ago
Posts: 16
 

@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)
Member
Joined: 2 years ago
Posts: 16
 

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


   
Ron reacted
ReplyQuote
 Ppez
(@ppez)
Member
Joined: 2 years ago
Posts: 7
 

I am a rank amateur at this sort of thing so please, if you are kind enough to reply, keep it simple.

I am trying to compile the MP3 Player sketch.

 

// Digital I/O used

#define SD_CS     5

#define SPI_MOSI   23

#define SPI_MISO   19

#define SPI_SCK    18

#define I2S_DOUT   25

#define I2S_BCLK   27

#define I2S_LRC    26

 

Audio audio;

 

It stops at that last line with the error message "'Audio' does not name a type"

Would very much appreciate guidance on how to fix this.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

@ppez Give us the link to the sketch you are using.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

@ppez Ok, let's try it this way. What you meant to say is.

I watched the video, like what I saw. Clicked the ..more under the video, clicked the link to the blog, scrolled down to resources and downloaded Bills zip file and the Github library file. I then unzipped Bill's zip fie and opened it. In the Sketch menu I picked Install Library from zip (words similar to that) and selected the I2S library just downloaded from github.

Now I compile the sketch (after picking the DOIT ESP32 board) (search on doit)and ?????? But first , quit the IDE, re open the IDE, the sketch you had open should re-open, now compile again and ......????

I just did all that and it compiled clean first time.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Page 3 / 4