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

Thread: reading S/PDIF data with Teensy 3.6 (or 4) for a beginner

  1. #1

    reading S/PDIF data with Teensy 3.6 (or 4) for a beginner

    Hello everyone,
    I'm a bit new to the Teensy world, much more used to the Arduino Uno.
    Is it possible to connect an S/PDIF or optical audio input to Teensy 3.6, so that it can be read by the Teensy and recorded to an audio file?
    I suppose this could be done via the I2S protocol, with the Teensy in slave mode.
    There are many discussions on the forum about S/PDIF and Teensy 4.
    As a novice, I am looking for a simple and not too expensive solution.

    Thank you in advance for your help

  2. #2
    Senior Member
    Join Date
    Feb 2017
    Posts
    413
    I've successfully used this board with Teensy 3.2 / 3.6 and the Teensy Audio Library: https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1
    It does both S/PDIF -> I2S and I2s -> S/PDIF conversion.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,110
    Teensy 4.0 & 4.1 have S/PDIF input. Details here (right side documentation column)

    https://www.pjrc.com/teensy/gui/?info=AudioInputSPDIF3

    https://www.pjrc.com/teensy/gui/?inf...dioInputSPDIF3

  4. #4
    Junior Member
    Join Date
    Apr 2020
    Location
    Colorado
    Posts
    17
    I can confirm that the AudioInputSPDIF3 works well with the Queue for recording (or in my case, wireless transmission), but I have yet to get the AsyncAudioInputSPDIF3 to work with the Queue without crashing the T4.0 and requiring a physical press of the program button to reprogram. I am actually very interested in this feed, as well.
    Last edited by barley; 06-02-2020 at 02:40 AM. Reason: updated audio class names

  5. #5
    Junior Member
    Join Date
    Jun 2020
    Location
    Hereford, UK
    Posts
    7
    Quote Originally Posted by barley View Post
    I have yet to get the AsyncAudioInputSPDIF3 to work with the Queue without crashing the T4.0 and requiring a physical press of the program button to reprogram.
    Same here; thought I'd bricked the Teensy (4.1), until I learned of the long button-press reset (being new to Teensy). I'm also very interested in SPDIF on the Teensy, so will be keeping an eye out here.

  6. #6
    Hi, regarding the AsyncAudioInputSPDIF3: If you post a minimalistic example that crashes here: https://forum.pjrc.com/threads/58539...DIF-input-ASRC, I will try to reproduce it. Maybe I am able to find out what causes the problem.

  7. #7
    Hi everyone,
    Thank you for the answers.
    @gfvalvo: did you use the teensy 3.6 alone or with the audio shield?

  8. #8
    Senior Member
    Join Date
    Feb 2017
    Posts
    413
    Quote Originally Posted by LaurentNorbert View Post
    @gfvalvo: did you use the teensy 3.6 alone or with the audio shield?
    Only one device at a time can be connected to an I2S input or output. So you can use the DAC part of the Audio Shield at the same time, but not the ADC.

    You can also use the chip's second I2S I/O channel. That allows S/PDIF input and output as well as Audio Shield input and output.

    Obviously, for proper synchronization, all sampling must be done at the rate set by the S/PDIF input.

    Here's an example of what I did: https://forum.pjrc.com/threads/45394...light=s%2Fpdif
    Last edited by gfvalvo; 06-05-2020 at 05:50 PM.

  9. #9
    Senior Member
    Join Date
    Feb 2017
    Posts
    413
    Quote Originally Posted by gfvalvo View Post
    Only one device at a time can be connected to an I2S input or output.
    CORRECTION:
    In theory, you can have multiple devices connected to the same I2S output, assuming there's only one master and that the electrical parasitics of the connections don't degrade signal integrity too much.

  10. #10
    I have just ordered the WM8804 module, I'll let you know when I receive it.

  11. #11
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,744
    Quote Originally Posted by gfvalvo View Post
    Only one device at a time can be connected to an I2S input or output. So you can use the DAC part of the Audio Shield at the same time, but not the ADC.

    You can also use the chip's second I2S I/O channel. That allows S/PDIF input and output as well as Audio Shield input and output.

    Obviously, for proper synchronization, all sampling must be done at the rate set by the S/PDIF input.

    Here's an example of what I did: https://forum.pjrc.com/threads/45394...light=s%2Fpdif
    Ummm, it depends on which Teensy you have:
    • The Teensy 3.6 only has 1 I2S bus. You can use I2S for S/PDIF;
    • The Teensy 4.0 and 4.1 have 2 separate I2S buses. In addition it has a separate S/PDIF control using pins 14/15.

  12. #12
    Senior Member
    Join Date
    Feb 2017
    Posts
    413
    I was answering this question:

    Quote Originally Posted by LaurentNorbert View Post
    @gfvalvo: did you use the teensy 3.6 alone or with the audio shield?

Posting Permissions

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