Forum Rule: Always post complete source code & details to reproduce any issue!
Page 7 of 7 FirstFirst ... 5 6 7
Results 151 to 161 of 161

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

  1. #151
    Quote Originally Posted by WMXZ View Post
    testing it for all inputs (ADC, I2S, TDM etc) testing will most likely be lengthy, but if you have a particular input in mind, may it is possible.
    My particular interest resides with I2S. I plan to use the audio shield for data logging with .WAV files, which are then saved to the onboard (underside pinout) T4's SD card slot. The audio shield's SD card slot could work too.

    I initially had a project with the audio shield and a teensy 3.2...but the issues mentioned in this thread have haunted me.

  2. #152
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,530
    Quote Originally Posted by Circuit_Breaker View Post
    My particular interest resides with I2S. I plan to use the audio shield for data logging with .WAV files, which are then saved to the onboard (underside pinout) T4's SD card slot. The audio shield's SD card slot could work too.

    I initially had a project with the audio shield and a teensy 3.2...but the issues mentioned in this thread have haunted me.
    You may start withhttps://github.com/WMXZ-EU/record_sgtl5000 and add/merge the functionality (e.g. from microSoundRecorder)

  3. #153
    Quote Originally Posted by WMXZ View Post
    You may start withhttps://github.com/WMXZ-EU/record_sgtl5000 and add/merge the functionality (e.g. from microSoundRecorder)
    I will certainly do so. Thank you! ...not sure how I missed this guy in your repo...

  4. #154
    Junior Member
    Join Date
    Jan 2020
    Posts
    2
    Hallo,
    we are trying to Teensy Audio shield on a Teensy 3.6, somehow the "standard dafault" with analogue microphone input over I2S.
    However when we compile (reinstalled latest Arduino and Teensyduino software and the SdFs library) we get multiple definition errors.
    In the header files, we understand that these are not a problem, but when linking, we get (many) errors like this:

    /home/tim/software/arduino-1.8.10/hardware/teensy/avr/libraries/Audio/control_tlv320aic3206.cpp:170: multiple definition of `AudioControlTLV320AIC3206::disable()'
    /tmp/arduino_build_954548/sketch/src/control_tlv320aic3206.cpp.o:/tmp/arduino_build_954548/sketch/src/control_tlv320aic3206.cpp:170: first defined here
    /home/tim/software/arduino-1.8.10/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: Disabling relaxation: it will not work with multiple definitions
    /tmp/arduino_build_954548/libraries/Audio/control_tlv320aic3206.cpp.o: In function `AudioControlTLV320AIC3206::disable()':

    We see that this file is in the src directory for the MicroSoundRecorder as well as in the Arduino Teensy libraries. Should we be doing something to ensure that only the MicroSoundRecorder version is being used? Or have we overseen some other detail? It seems that the files that are causing the problem should only be in use when using the Tympan microphones; it also looks like the Teensy supplied version is newer.

    Best wishes,
    Tim and Marc

  5. #155
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,530
    As long you are not using Tympan, I would simply delete the src directory.
    BTW are you using Arduino IDE or makefile based compilation?

    Edit: sometimes forcing recompilation helps (change something in Tools)
    Edit: I will later today change the class name to eliminate this issue

  6. #156
    Junior Member
    Join Date
    Jan 2020
    Posts
    2

    Quote Originally Posted by WMXZ View Post
    As long you are not using Tympan, I would simply delete the src directory.
    BTW are you using Arduino IDE or makefile based compilation?
    That was it. Thank you!
    We are trying to keep it simple and use the Arduino IDE. It seems to work well most of the time.

    Looking forward to getting the Recorder running!
    Best,
    Tim

  7. #157
    Senior Member DD4WH's Avatar
    Join Date
    Oct 2015
    Location
    Central Europe
    Posts
    534
    I am experiencing a strange phenomenon with the current microSoundRecorder code (master branch):

    * when I try to synchronize the time and date with the micro_SRcontrol.exe program, the date seems to be one day in advance after synchronizing. All recordings have the wrong time stamp with the day+1
    * the same happens if I use the serial menu to change the date (it even happens if I only change the time)
    * I do not know whether this was present before?
    * when I add "tt-=86400" to the code in m_menu.h, the date is OK with both: serial menu or the micro_SRcontrol.exe program

    Code:
    static void setDate(uint16_t year, uint16_t month, uint16_t day)
    {
        uint32_t tt=getRTC();
        struct tm tx=seconds2tm(tt);
        tx.tm_year=year;
        tx.tm_mon=month;
        tx.tm_mday=day;
        tt=tm2seconds(&tx);
        tt-=86400;
        setRTC(tt);
    }
    
    static void setTime(uint16_t hour, uint16_t minutes, uint16_t seconds)
    {
        uint32_t tt=getRTC();
        struct tm tx=seconds2tm(tt);
        tx.tm_hour=hour;
        tx.tm_min=minutes;
        tx.tm_sec=seconds;
        tt=tm2seconds(&tx);
        tt-=86400;
        setRTC(tt);
    }
    Do you have an idea what could cause this behaviour?

  8. #158
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,530
    @DD4WH, Yes, I experienced it also. The conversion of sec to day is some sort of a mess. Maybe it is correct after 29thFeb? As it created problems everywhere, I tend to convert it back to TD-TimeLib library, or find the bug. It seems that when first setting day and then time, day gets modified.

  9. #159
    Senior Member DD4WH's Avatar
    Join Date
    Oct 2015
    Location
    Central Europe
    Posts
    534
    @WMXZ, yes, and the bug is only present in leap years. I could not make it run when first setting day and then time, it is two days in advance in that case.

    I was not able to find the bug in tm2seconds, but I think everything is fixed when that function is being replaced by the Teensy time function in Time.cpp [https://github.com/PaulStoffregen/Ti...ter/Time.cpp]:

    I simply adapted (different use of 1970 offset in years and LEAPYEAR) and exchanged the function tm2seconds in audio_logger_if.h, line 138.

    After doing that, time and date setting works fine!

    Code:
    // adapted from from Time.cpp (https://github.com/PaulStoffregen/Time/blob/master/Time.cpp)
    // works now !!! DD4WH, 20/02/2020 -> leap year ;-)
    uint32_t tm2seconds (struct tm *tx) 
    {
      uint32_t seconds;
    
      // seconds from 1970 till 1 jan 00:00:00 of the given year
      seconds= (tx->tm_year - 1970) * (86400 * 365);
      for (uint32_t i = 0; i < (tx->tm_year - 1970); i++) 
      {
        if (LEAP_YEAR(i)) {
          seconds += 86400;   // add extra days for leap years
        }
      }
      // add days for this year, months start from 1
      for (uint32_t i = 1; i < tx->tm_mon; i++) 
      {
        if ( (i == 2) && LEAP_YEAR(tx->tm_year - 1970)) 
        { 
          seconds += 86400 * 29;
        } else 
        {
          seconds += 86400 * monthDays[i-1];  //monthDay array starts from 0
        }
      }
      seconds+= (tx->tm_mday-1) * 86400;
      seconds+= tx->tm_hour * 3600;
      seconds+= tx->tm_min * 60;
      seconds+= tx->tm_sec;
      return seconds;
    }

  10. #160
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,530
    Frank,
    you are welcome to change the GitHub repository.
    Walter

  11. #161
    Senior Member DD4WH's Avatar
    Join Date
    Oct 2015
    Location
    Central Europe
    Posts
    534
    sorry, my github repo shows strange behaviour, need some more time to repair this, but I have some other work to do at the moment. If you want to include the change without a PR, go ahead.

Posting Permissions

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