Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 6 1 2 3 ... LastLast
Results 1 to 25 of 138

Thread: Audio Recording / Logging to SD card --> microSoundRecorder

  1. #1
    Senior Member DD4WH's Avatar
    Join Date
    Oct 2015
    Location
    Central Europe
    Posts
    450

    Audio Recording / Logging to SD card --> microSoundRecorder

    You can find many threads dealing with this topic in the PJRC forum. I have gone through many of them and tried a lot of the given code, but unfortunately I could not find easy-to-use code which reliably records audio onto an SD card without glitches and/or missing samples. Not only me, but obviously many forum users are looking for a reliable way to record audio to an SD card.

    THEREFORE IN THIS THREAD I WOULD LIKE TO SUMMARIZE MY EXPERIENCES WITH AUDIO RECORDING TO SD CARD, GIVE LINKS TO DIFFERENT CODE EXAMPLES BY OTHER FORUM USERS AND FINALLY GIVE A LINK TO A VERY NICE SOLUTION PROGRAMMED BY WALTER, WMXZ, WHICH WORKS VERY WELL AND HAS BEEN EXTENSIVELY TESTED IN THE FIELD FOR UNATTENDED AUDIO RECORDINGS OF BIRDS AND OTHER ANIMALS.

    At first sight, recording audio to the SD card is very easy to achieve (Teensy plus audio board) with the example given in the Audio lib using the mic input of the Teensy audio board or the line input.

    https://github.com/PaulStoffregen/Audio/blob/master/examples/Recorder/Recorder.ino


    Other Teensy friends have programmed their own recording sketches using other inputs or other goals. These sketches differ largely in their reliability and the ease of use by unexperienced users.

    However, it is often pointed out that the recordings have glitches or missing samples:

    https://forum.pjrc.com/threads/47259-Save-file-to-SD-in-a-different-thread-(or-use-interrupts-for-sampling-)?highlight=audio+recording

    https://forum.pjrc.com/threads/46873...ing-Quad-Audio
    https://forum.pjrc.com/threads/43834...-5-3-6-SDIO-SD
    https://forum.pjrc.com/threads/47075...udio+recording
    https://forum.pjrc.com/threads/46150...udio+recording
    https://forum.pjrc.com/threads/42562...l=1#post160848
    https://forum.pjrc.com/threads/52127...rom-recordings

    Also for me, when I tested several of these sketches, I realized that it is very hard to achieve reliable recordings without glitches and lost samples for several reasons:


    • SD cards sometimes need a considerable amount of time to react to the Teensy write command. This can take up to half a second or even more. This means that the audio library has to buffer all the samples coming into the audio queue and subsequently write them to the SD card while simultaneously buffering all the recent audio samples coming in
    • The audio lib has a restriction of a maximum number of audio blocks it can buffer. This maximum number is often too low to cover the latency of an SD card, which leads to buffer overrun and lost samples


    The consequence is that I looked for a more reliable way and discovered that Walter, WMXZ had already programmed such a sketch (for the Teensy 3.6 only, because a very large RAM is needed for the audio buffer). When I contacted Walter with a further wish list of features, he was so kind to add a lot of other useful features and I carried out a lot of testing on the bench and in the field.

    https://forum.pjrc.com/threads/46136-Yet-another-SimpleAudioLogger


    The sketch can be found here:

    https://github.com/WMXZ-EU/microSoundRecorder

    It has many useful features built-in:


    • Time scheduled recordings
    • Audio-triggered recordings
    • Application to program recording settings without having to reprogram the Teensy
    • Automatic time & date stamps
    • WAV-file header
    • Hibernation function to save power
    • Function to regularly wake up in order to wake up a USB power bank that could be used to power the Teensy


    In several field test sessions we tested the reliability and the usability for an unexperienced user like me. It works very well and has the potential of expansion for different input sources. At the moment it has been tested in the following configurations:


    • Teensy 3.6. & two ICS43434 digital microphones (STEREO)
    • Teensy 3.6. & one ICS43434 digital microphone (MONO)


    Other configurations (untested) include:

    • Built-in ADC MONO
    • Built-in ADC STEREO
    • Audio board I2S Stereo input
    • Audio board I2S Quad input


    See the WIKI on github for further information and documentation.

    https://github.com/WMXZ-EU/microSoundRecorder/wiki

    Thanks a lot to Walter WMXZ for the excellent solution and thanks to Paul for all the work with the Teensy audio library!

    Have fun with the Teensy!

    Frank DD4WH

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    One could try to add a SPI-RAM as buffer for the SD-Card to the audio-shield. It has the same pinout as FLASH, so the existing pads will work.

  3. #3
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,344
    Quote Originally Posted by Frank B View Post
    One could try to add a SPI-RAM as buffer for the SD-Card to the audio-shield. It has the same pinout as FLASH, so the existing pads will work.
    I have thought about it and have done it on another project (using T3.2), but this limits the overall bit rate to half the SPI-RAM clock rate (write to RAM and read from RAM).
    The T3.6 allows already for about 200 kB buffer, so for the 23LC1024 to be useful one needs data rates > 2 MB/s while covering 0.1 s uSD delays. As the 23LC1024 access is limited to 20 MHz, this supports up to 10 MBit/s or 1.25 MB/s data rate (write and read)
    In the absence of quad SPI (SQI) on Teensy, this results to an interesting design. I may think about it, as I have an application where 200 kB buffer is not large enough (high speed multichannel acquisition totalling a datarate of 30 MBit/s), but I still have some 23LC1024 available, so I even may try it.

  4. #4
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    227
    Quote Originally Posted by Frank B View Post
    One could try to add a SPI-RAM as buffer for the SD-Card to the audio-shield. It has the same pinout as FLASH, so the existing pads will work.
    This is the approach I had been planning for an upcoming project on my TGA Pro board. I've already modified crteensy's DmaSpi library to support DMA transfers to/from the SPI RAM. As you guys already suggested, use the SPI RAM as a big FIFO buffer for writing to the SD card.

    As a very rough calculation, Each channel of audio is 44100 * 16 bits = 705.6 KHz. I figured the 20 MHz SPI rate should provide enough total throughput for several channels of read and write.

    Of course I haven't tried any of this yet!

  5. #5
    HI all - great information, thank you. This is exactly what I need to do too. Would it be possible to port this to run on the Tympan board on a Teensy3.6? https://tympan.org

  6. #6
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,344
    Quote Originally Posted by garthpaine View Post
    HI all - great information, thank you. This is exactly what I need to do too. Would it be possible to port this to run on the Tympan board on a Teensy3.6? https://tympan.org
    It should be possible.
    It requires only to consider the Codec Chip is using.

  7. #7

    AudioControlTLV320AIC3206

    Thanks for the response - I thought I posted this the other day, but can not see it now. The codes says
    #include <Tympan_Library.h> //AudioControlTLV320AIC3206 lives here
    I have tested this code and it seems to sometimes work and sometimes just produce silent files so I assume it works with this audio chip but that the pins may not be correct for audio I/O

    Thanks, Garth

  8. #8
    hi @WMXZ - I just wanted to follow up and see if you might be able to assist me with this translation of your wonderful code to the Tympan? I think it would be a great addition but realize that it is beyond my skills as your code is complex to my eyes. Cheers, Garth

  9. #9
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,344
    Quote Originally Posted by garthpaine View Post
    hi @WMXZ - I just wanted to follow up and see if you might be able to assist me with this translation of your wonderful code to the Tympan? I think it would be a great addition but realize that it is beyond my skills as your code is complex to my eyes. Cheers, Garth
    OK, I will look into it.
    However, I'm at the moment in the field with little time in the upcoming 5 to 6 weeks.

  10. #10
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,344
    Quote Originally Posted by garthpaine View Post
    hi @WMXZ - I just wanted to follow up and see if you might be able to assist me with this translation of your wonderful code to the Tympan? I think it would be a great addition but realize that it is beyond my skills as your code is complex to my eyes. Cheers, Garth
    Checking Tympan's SW on github, I found a uSD logger. So, question is why do you want to port the SW, this thread is about, to Tympan? What is the application that Chip's software does not handle. Chip uses also an earlier version of Bill Greimans uSD library. I also ask as the TLB320AIC3206 has a lot of features a simple I2S Mic does not provide.

  11. #11
    HI @WMXZ - I find the quality of the sound recorded through the Tympan board to be of superior quality which is of interest to me. Also the logger code they (unless I missed something) have allows you to start recording turning the potentiometer on the board, but does not allow timed on/off, timestamped events and does not record in .wav (uses RAW) or allow long file names - meaning the files can not be time/date/location stamped. In addition there is no init file to allow machine/file naming and time/date setup etc to be done without compiling for each deployed machine. All of these features and more are implemented within your code - hence my interest - cheers, Garth

  12. #12
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,344
    Quote Originally Posted by garthpaine View Post
    HI @WMXZ - I find the quality of the sound recorded through the Tympan board to be of superior quality which is of interest to me. Also the logger code they (unless I missed something) have allows you to start recording turning the potentiometer on the board, but does not allow timed on/off, timestamped events and does not record in .wav (uses RAW) or allow long file names - meaning the files can not be time/date/location stamped. In addition there is no init file to allow machine/file naming and time/date setup etc to be done without compiling for each deployed machine. All of these features and more are implemented within your code - hence my interest - cheers, Garth
    fair enough.
    Caveat, I have no Tympan at hand and even if I order one I will not be able to test before end of July.

  13. #13
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,344
    Quote Originally Posted by WMXZ View Post
    fair enough.
    Caveat, I have no Tympan at hand and even if I order one I will not be able to test before end of July.
    OK, I pushed a version that compiles also for Tympan.
    I removed all user changeable definitions from myApp.cpp to config.h

    To configure the SW fir Tympan edit config.h and define ACQ to be _I2S_TYMPAN
    (should be easy)

    I put the input gain to 10.5, you can change that too.

    The code assumes that the codec is configured for 16 bit (96 dB)

    As said, I cannot test it, so if you have a Tympan Version C you can try it

  14. #14

    Awesomeness.

    Quote Originally Posted by WMXZ View Post
    OK, I pushed a version that compiles also for Tympan.
    I removed all user changeable definitions from myApp.cpp to config.h

    To configure the SW fir Tympan edit config.h and define ACQ to be _I2S_TYMPAN
    (should be easy)

    I put the input gain to 10.5, you can change that too.

    The code assumes that the codec is configured for 16 bit (96 dB)

    As said, I cannot test it, so if you have a Tympan Version C you can try it
    Thank you so much. Impressively fast. I may have time to test tomorrow otherwise I am in the field for a couple of weeks and then will tested at the beginning of July. I am hugely appreciative that you have so quickly made the changes and excited about the potentials it makes available. I will keep you updated about my tests. Cheers, Garth

  15. #15
    I am getting a compilation error which I don't know how to fix re 'delay1' was not declared in this scope



    Arduino: 1.8.5 (Mac OS X), TD: 1.41, Board: "Teensy 3.6, Audio, 180 MHz, Faster, US English"

    In file included from /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/myAPP.cpp:58:0:
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/config.h:125:0: warning: "USE_ENVIRONMENTAL_SENSORS" redefined
    #define USE_ENVIRONMENTAL_SENSORS 0 // for tympan switch off environmental sensors
    ^
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/config.h:122:0: note: this is the location of the previous definition
    #define USE_ENVIRONMENTAL_SENSORS 1 // to use environmental sensors set tom 1 otherwise set to 0 //<<<======>>>
    ^
    In file included from /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/myAPP.cpp:222:0:
    audio_logger_if.h: In function 'uint32_t tm2seconds(tm*)':
    audio_logger_if.h:145: warning: comparison between signed and unsigned integer expressions
    for (mm=0; mm<(tx->tm_mon-1); mm++) days+=monthDays[mm];
    ^
    audio_logger_if.h:149: warning: comparison between signed and unsigned integer expressions
    while(years++ < (tx->tm_year-1970)) days += (LEAP_YEAR(years) ? 366 : 365);
    ^
    audio_logger_if.h:144: warning: unused variable 'monthLength'
    uint32_t monthLength=0;
    ^
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/audio_logger_if.h: In member function 'int16_t c_uSD::write(int16_t*, int32_t)':
    audio_logger_if.h:263: warning: comparison between signed and unsigned integer expressions
    if (2*ndat != file.write((char *) data, 2*ndat)) sd.errorHalt("file.write data failed");
    ^
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/audio_logger_if.h: In member function 'void c_uSD::storeConfig(uint32_t*, int, int32_t*, int)':
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/audio_logger_if.h:294:39: warning: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t {aka long unsigned int}' [-Wformat=]
    { sprintf(text,"%10d\r\n",param1[ii]); file.write((uint8_t*)text,strlen(text));
    ^
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/audio_logger_if.h:294:39: warning: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t {aka long unsigned int}' [-Wformat=]
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/audio_logger_if.h:298:39: warning: format '%d' expects argument of type 'int', but argument 3 has type 'int32_t {aka long int}' [-Wformat=]
    { sprintf(text,"%10d\r\n",param2[ii]); file.write((uint8_t*)text,strlen(text));
    ^
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/audio_logger_if.h:298:39: warning: format '%d' expects argument of type 'int', but argument 3 has type 'int32_t {aka long int}' [-Wformat=]
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/audio_logger_if.h: In member function 'void c_uSD::loadConfig(uint32_t*, int, int32_t*, int)':
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/audio_logger_if.h:313:67: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'uint32_t* {aka long unsigned int*}' [-Wformat=]
    { if(file.read((uint8_t*)text,12)); sscanf(text,"%d",&param1[ii]);
    ^
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/audio_logger_if.h:313:67: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'uint32_t* {aka long unsigned int*}' [-Wformat=]
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/audio_logger_if.h:316:67: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'int32_t* {aka long int*}' [-Wformat=]
    { if(file.read((uint8_t*)text,12)); sscanf(text,"%d",&param2[ii]);
    ^
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/audio_logger_if.h:316:67: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'int32_t* {aka long int*}' [-Wformat=]
    In file included from /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_398109/sketch/myAPP.cpp:224:0:
    m_menu.h: In function 'void doMenu2()':
    m_menu.h:254: warning: unused variable 'T4'
    int T4=acqParameters.T4;
    ^
    myAPP.cpp: In function 'void setup()':
    myAPP.cpp:383: error: 'delay1' was not declared in this scope
    if(mustClose<0) delay1.setDelay(0); else delay1.setDelay(MDEL);
    ^
    myAPP.cpp:383: error: 'delay1' was not declared in this scope
    if(mustClose<0) delay1.setDelay(0); else delay1.setDelay(MDEL);
    ^
    myAPP.cpp:390: error: 'process1' was not declared in this scope
    process1.begin(&snipParameters);
    ^
    myAPP.cpp: In function 'void loop()':
    myAPP.cpp:443: error: 'process1' was not declared in this scope
    if((state>=0) && ((snipParameters.thresh<0) || (process1.getSigCount()>0)))
    ^
    myAPP.cpp:463: error: 'process1' was not declared in this scope
    if(((mustClose>0)&& (process1.getSigCount()< -MDEL))
    ^
    myAPP.cpp:498: error: 'process1' was not declared in this scope
    process1.getSigCount(),process1.getDetCount(),proc ess1.getNoiseCount());
    ^
    Multiple libraries were found for "SD.h"
    Used: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD
    Not used: /Applications/Arduino.app/Contents/Java/libraries/SD
    'delay1' was not declared in this scope

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

  16. #16
    Senior Member DD4WH's Avatar
    Join Date
    Oct 2015
    Location
    Central Europe
    Posts
    450
    Hi!

    use it this way (comment out!), if you do not use environmental sensors:

    //#define USE_ENVIRONMENTAL_SENSORS

    How is your ACQ defined?

  17. #17
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,344
    Quote Originally Posted by DD4WH View Post
    Hi!

    use it this way (comment out!), if you do not use environmental sensors:

    //#define USE_ENVIRONMENTAL_SENSORS

    How is your ACQ defined?
    Frank, I changed the definition of USE_ENVIRONMENT_SENSORS to carry a value
    I will look into these errors.

  18. #18
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,344
    Quote Originally Posted by garthpaine View Post
    I am getting a compilation error which I don't know how to fix re 'delay1' was not declared in this scope
    The latest GitHub (setting in config.h ACQ== _I2S_TYMPAN) should now compile and hopefully also run on Tympan.

  19. #19
    Thanks

    I had found the _IS2_32Tympan and adjusted it as you suggested, and I just refreshed the Git so I have the latest, but the same issue persists

    myAPP.cpp: In function 'void setup()':
    myAPP.cpp:383: error: 'delay1' was not declared in this scope
    if(mustClose<0) delay1.setDelay(0); else delay1.setDelay(MDEL);


    ---- here is the console readout -------

    Arduino: 1.8.5 (Mac OS X), TD: 1.41, Board: "Teensy 3.6, Audio, 180 MHz, Faster, US English"

    Build options changed, rebuilding all
    In file included from /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/myAPP.cpp:58:0:
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/config.h:125:0: warning: "USE_ENVIRONMENTAL_SENSORS" redefined
    #define USE_ENVIRONMENTAL_SENSORS 0 // for tympan switch off environmental sensors
    ^
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/config.h:122:0: note: this is the location of the previous definition
    #define USE_ENVIRONMENTAL_SENSORS 1 // to use environmental sensors set tom 1 otherwise set to 0 //<<<======>>>
    ^
    In file included from /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/myAPP.cpp:222:0:
    audio_logger_if.h: In function 'uint32_t tm2seconds(tm*)':
    audio_logger_if.h:145: warning: comparison between signed and unsigned integer expressions
    for (mm=0; mm<(tx->tm_mon-1); mm++) days+=monthDays[mm];
    ^
    audio_logger_if.h:149: warning: comparison between signed and unsigned integer expressions
    while(years++ < (tx->tm_year-1970)) days += (LEAP_YEAR(years) ? 366 : 365);
    ^
    audio_logger_if.h:144: warning: unused variable 'monthLength'
    uint32_t monthLength=0;
    ^
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/audio_logger_if.h: In member function 'int16_t c_uSD::write(int16_t*, int32_t)':
    audio_logger_if.h:263: warning: comparison between signed and unsigned integer expressions
    if (2*ndat != file.write((char *) data, 2*ndat)) sd.errorHalt("file.write data failed");
    ^
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/audio_logger_if.h: In member function 'void c_uSD::storeConfig(uint32_t*, int, int32_t*, int)':
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/audio_logger_if.h:294:39: warning: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t {aka long unsigned int}' [-Wformat=]
    { sprintf(text,"%10d\r\n",param1[ii]); file.write((uint8_t*)text,strlen(text));
    ^
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/audio_logger_if.h:294:39: warning: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t {aka long unsigned int}' [-Wformat=]
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/audio_logger_if.h:298:39: warning: format '%d' expects argument of type 'int', but argument 3 has type 'int32_t {aka long int}' [-Wformat=]
    { sprintf(text,"%10d\r\n",param2[ii]); file.write((uint8_t*)text,strlen(text));
    ^
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/audio_logger_if.h:298:39: warning: format '%d' expects argument of type 'int', but argument 3 has type 'int32_t {aka long int}' [-Wformat=]
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/audio_logger_if.h: In member function 'void c_uSD::loadConfig(uint32_t*, int, int32_t*, int)':
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/audio_logger_if.h:313:67: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'uint32_t* {aka long unsigned int*}' [-Wformat=]
    { if(file.read((uint8_t*)text,12)); sscanf(text,"%d",&param1[ii]);
    ^
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/audio_logger_if.h:313:67: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'uint32_t* {aka long unsigned int*}' [-Wformat=]
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/audio_logger_if.h:316:67: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'int32_t* {aka long int*}' [-Wformat=]
    { if(file.read((uint8_t*)text,12)); sscanf(text,"%d",&param2[ii]);
    ^
    /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/audio_logger_if.h:316:67: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'int32_t* {aka long int*}' [-Wformat=]
    In file included from /var/folders/gb/238lfr_552jdld6tkg61v6rc0000gp/T/arduino_build_835840/sketch/myAPP.cpp:224:0:
    m_menu.h: In function 'void doMenu2()':
    m_menu.h:254: warning: unused variable 'T4'
    int T4=acqParameters.T4;
    ^
    myAPP.cpp: In function 'void setup()':
    myAPP.cpp:383: error: 'delay1' was not declared in this scope
    if(mustClose<0) delay1.setDelay(0); else delay1.setDelay(MDEL);
    ^
    myAPP.cpp:383: error: 'delay1' was not declared in this scope
    if(mustClose<0) delay1.setDelay(0); else delay1.setDelay(MDEL);
    ^
    myAPP.cpp:390: error: 'process1' was not declared in this scope
    process1.begin(&snipParameters);
    ^
    myAPP.cpp: In function 'void loop()':
    myAPP.cpp:443: error: 'process1' was not declared in this scope
    if((state>=0) && ((snipParameters.thresh<0) || (process1.getSigCount()>0)))
    ^
    myAPP.cpp:463: error: 'process1' was not declared in this scope
    if(((mustClose>0)&& (process1.getSigCount()< -MDEL))
    ^
    myAPP.cpp:498: error: 'process1' was not declared in this scope
    process1.getSigCount(),process1.getDetCount(),proc ess1.getNoiseCount());
    ^
    Multiple libraries were found for "SD.h"
    Used: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD
    Not used: /Applications/Arduino.app/Contents/Java/libraries/SD
    'delay1' was not declared in this scope

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

  20. #20
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,344
    Make sure you really set
    Code:
    #define ACQ     _I2S_TYMPAN

  21. #21
    HI WMXZ - yes I must admit I am a bit confused as to why this is not compiling for me - it clearly does for you :-)
    I have made triple sure that _I2S_TYMPAN is defined as interface 7 in the config and that it is set as the as per #define ACQ _I2S_TYMPAN
    then I have made sure in myApp that we have an if statement #if(ACQ == _I2S_TYMPAN)

    They all look the same - in fact I copied and pasted them. I did wonder if the delay needs to be defined in the #if statement and tried

    #include "m_delay.h";
    mDelay<1,(MDEL+2)> delay1(0); // have ten buffers more in queue only to be safe

    but this then causes other issues....

    I have Arduino environment setup for

    Teensy 3.6, Audio, 180MHz, Faster, /dev/cu.SOC

    this compiles other Tympan code ok

  22. #22
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,344
    Quote Originally Posted by garthpaine View Post
    HI WMXZ - yes I must admit I am a bit confused as to why this is not compiling for me - it clearly does for you :-)
    I have made triple sure that _I2S_TYMPAN is defined as interface 7 in the config and that it is set as the as per #define ACQ _I2S_TYMPAN
    then I have made sure in myApp that we have an if statement #if(ACQ == _I2S_TYMPAN)

    They all look the same - in fact I copied and pasted them. I did wonder if the delay needs to be defined in the #if statement and tried

    #include "m_delay.h";
    mDelay<1,(MDEL+2)> delay1(0); // have ten buffers more in queue only to be safe

    but this then causes other issues....

    I have Arduino environment setup for

    Teensy 3.6, Audio, 180MHz, Faster, /dev/cu.SOC

    this compiles other Tympan code ok
    Please note that there are other changes in the code, best is to re-download the whole code from GitHub.
    Try to compile it as is
    then compile with ACQ set to _I2S_TYMPAN in config.h (Line 45)
    Also compile with Serial, there is no USB_Audio (as with TYMPAN)

    My configuration on A1.8.5, TD1.42b3 Win10 is Teensy 3.6, Serial, 180 MHz, Faster

    If you wanted to know what I have changed, go to GitHub, open the file, click on History (open right over the code), then you click on text to the left and you see all changes I did during this particular commit

  23. #23
    Ok cool thanks so much - I am in an airport without the Tympan, but did compile it fine with the ACQ set to _I2S_TYMPAN in config.h
    I will be back with a Tympan in a week or so and will try compiling it to the board - thats an exciting prospect - I greatly appreciate your assistance - thank you
    Cheers, Garth

  24. #24
    Member
    Join Date
    Mar 2017
    Location
    Utah
    Posts
    55
    Is there any chance of adding the TDM protocol for using the ICS-52000 mics from invensense? What would the limit be for the amount of data that can be recorded? If I have 5 mics sampling at 48000Hz would the memory run out? I want to try microphone beamforming.

  25. #25
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,344
    Quote Originally Posted by dreggory View Post
    Is there any chance of adding the TDM protocol for using the ICS-52000 mics from invensense? What would the limit be for the amount of data that can be recorded? If I have 5 mics sampling at 48000Hz would the memory run out? I want to try microphone beamforming.
    I can add TDM, no problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •