Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 12 of 12

Thread: Stereo Audio Recorder

  1. #1
    Junior Member
    Join Date
    Oct 2016
    Posts
    3

    Stereo Audio Recorder

    Hi everybody ! This is my first post on this forum.

    I work as an hardware engineer in consumer Drone industry.
    During development phase, we often have to record several analogue signals during flights. The logger hardware has to be the smallest/lightest available, since we want to limit the impact of the recorder on motors throttle and aerodynamics. Teensy boards are incredibly small, so it seems perfect for the job ! I already bought a couple of Teensy 3.2 and SD adapters (the small ones).

    What I want to achieve :
    • size of an USB key
    • less than 17 grams
    • stereo 16-bit PCM WAV,@ 44100Hz
    • USB-MSD when plugged to a PC, to copy WAV files


    If wav is a problem I can deal with recording raw data and encapsulate later, but I suppose SD latency is the real hard bit.
    Since I am not familiar with these boards, I don't know if my project is feasable. I wouldn't like to waste my time on an insuitable solution.
    Thanks

    Clovis

  2. #2
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    561
    OK th best tool for the job here is either the Teensy 3.2, or one of the newer 3.5/6 but they are longer and heavier so stick with a 3.2.

    The Audio board should be able to do this to an SD card no problem at all and it has an SD card slot on board.

    But it is a bit wider than the teensy 3.2 board to it wont quite be usb key sized.

    But straight to RAW or WAV, both should be easily achievable at 16bit 44khz PCM.

    Look here for a picture of the audio board - you can see where the teensy would sit in the middle of it.

    But yes, it's feasible if you sacrifice the USB Pen drive element, if you need to stay off-the-shelf
    Last edited by Pensive; 10-09-2016 at 03:30 PM. Reason: added link

  3. #3
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    561
    just to clarify - i just weighed them for you:
    Teensy 3.2 is 2.8g
    audio board is 5.1g

    assuming the solder pins, solder and microsd card weigh less than 9g then you're golden

  4. #4
    Junior Member
    Join Date
    Oct 2016
    Posts
    3
    Quote Originally Posted by Pensive View Post
    just to clarify - i just weighed them for you:
    Teensy 3.2 is 2.8g
    audio board is 5.1g
    Thank you Pensive ! It's good to know what is the Audio shield weight
    I was at 7.3g with Teensy 3.2, a pin header and a SD shield. So I am not worried about weight. As for the dongle, it was only for size comparison. The large USB connector would be a dead weight anyway.

    The Audio shield is too large indeed, but looking at your the pictures it seems to me that I can shrink it..
    But it is basically just a codec. It doesn't help much since the teensy already has 16-bit ADCs, and I don't need any DAC, amplification, filter nor effect. The SD slot goes directly to the Teensy, so it probably doesn't improve SD access too.

    The cool side is the graphical code generation. Maybe I will give it a try just for that because I don't think I am capable to code all from scratch.
    As far as I know there are no Teensy projects on the internet to store 2 x 44100Hz 16-bit data in a micro-SD. It is very surprising ! Is the arduino environment not suitable for this kind of project ?

    Clovis

  5. #5
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,995
    Quote Originally Posted by Clovis View Post
    Thank you Pensive ! It's good to know what is the Audio shield weight
    I was at 7.3g with Teensy 3.2, a pin header and a SD shield. So I am not worried about weight. As for the dongle, it was only for size comparison. The large USB connector would be a dead weight anyway.

    The Audio shield is too large indeed, but looking at your the pictures it seems to me that I can shrink it..
    But it is basically just a codec. It doesn't help much since the teensy already has 16-bit ADCs, and I don't need any DAC, amplification, filter nor effect. The SD slot goes directly to the Teensy, so it probably doesn't improve SD access too.

    The cool side is the graphical code generation. Maybe I will give it a try just for that because I don't think I am capable to code all from scratch.
    As far as I know there are no Teensy projects on the internet to store 2 x 44100Hz 16-bit data in a micro-SD. It is very surprising ! Is the arduino environment not suitable for this kind of project ?

    Clovis
    Have you looked at the Teensy 3.6? Right now, the SD card support is in its infancy, but it uses a native (4 bit SDIO) micro SD card port. This should be at least 4x faster than anything that uses the standard 1 bit SPI mode. In addition, the 3.6 runs at 180 Mhz normally, and it can be over clocked to 240 Mhz. I haven't used it yet, but this thread talked about it: https://forum.pjrc.com/threads/36737...l=1#post114355

  6. #6
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    561
    The reason I didn't suggest using the ADCs of the 3.2 was because I don't think it's currently supported by the audio library.

    AFAIK you need to use mic or line in from the audio board and all the electronics is already done for you.

    But adding the software side should be relatively easy, just a bit of electronics to bring it all in line perhaps?

  7. #7
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    561
    Shows what I know. Input option of ADC1 is right there in the gui. I'll shut up now.

    Never used it so hadn't noticed it!

  8. #8
    Member
    Join Date
    Jun 2016
    Location
    rural West Virginia
    Posts
    55
    You can record audio from the on chip A/D but you will not get 16 bit quality. You get more like 12 to 14 bits depending on how you interface it and how it is multiplexed. Best results come when driving the pin from a low impedance source. There are two A/D converters inside the chip which are multiplexed amongst all the analog input pins. It is not clear to me exactly how to assign one converter to a specific pin and the other to a different pin with no other analog inputs, such that no multiplexing occurs using the current version of TeensyDuino. Ideally you would want two single analog input pins assigned such that one is used for each stereo channel with no multiplexing. I believe that one converter is restricted to just a few specific pins on the T3.2 while the other converter is more flexible, but I can't remember exactly where I read that.

  9. #9
    Quote Originally Posted by tubelab.com View Post
    I believe that one converter is restricted to just a few specific pins on the T3.2 while the other converter is more flexible, but I can't remember exactly where I read that.
    Recently I had to check into that, but don't have the details at hand right now. I need 3 pins for each ADC, and afaik I need to solder 1 or 2 inputs on the lower side of the T3.2. Means if you need 1 pin per ADC it should be possible without resorting to that; best is to check the pinout diagram at the Teensy info pages + schematic (to know the actual SoC pin numbers) and the pin/alt configuration options in the reference manual. Shouldn't be too difficult to find something. Might need some additional (pin/mux) configuration outside of the ADC library.

  10. #10
    Junior Member
    Join Date
    Oct 2016
    Posts
    3
    Thank you all
    The Teensy 3.6 looks awesome ! Unfortunately it is not out yet, and we will need a recorder soon.
    I ordered an audio shield, since it seems the most straightforward solution. I don't like to do "serious code" in the Arduino environment, but hey, if it works.
    With Teensy 2.0, Arduino IDE proposes a "Disk(SD Card)" USB mode, but it is not available for Teensy 3.2. It seems that Paul Stoffregen did not implement USB MSD for Teensy 3.2, and doesn't plan to. (https://forum.pjrc.com/threads/24090...D-Mass-storage)
    I will post my code as soon as I have somethin working

    Clovis

  11. #11
    Member
    Join Date
    Jul 2013
    Location
    Colorado
    Posts
    87
    FYI, the Teensy 3.6 is available on the website, stock is listed as 'low'

    http://pjrc.com/store/teensy36.html

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,173
    Another batch went into production last week. If they do run out, plenty will be available soon.

Posting Permissions

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