Forum Rule: Always post complete source code & details to reproduce any issue!
Page 4 of 4 FirstFirst ... 2 3 4
Results 76 to 96 of 96

Thread: S/pdif

  1. #76
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438
    Wow..

    Let me say, everything was already on the Internet - i've only put the pieces together :-)
    KPC code was really very helpful (and it helped me to get a better understanding), and without your existing code for the I2S output I would not make it.
    I found other Ideas on the internet, esp. some tricks (i.e. the constant parity) came from a forum. The whole thing was done for other MCUs before (KPC posted a picture with the LED).
    Last edited by Frank B; 06-08-2015 at 09:51 PM.

  2. #77
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438
    Your toslink-board is super; i'm going to order some.

  3. #78
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,624
    Quote Originally Posted by Frank B View Post
    Your toslink-board is super; i'm going to order some.
    I could send you one today. OSH Park made 9 of them,and I got 10 of the connector from Digikeu, so I have plenty of spares.

  4. #79
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438
    Let's swap, I send you one of my memoryboards (well, after i have done more tests, perhaps end of the week)

  5. #80
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,624
    Sounds good. Can you email Robin directly (robin at pjrc dot com) with your current mailing address. She'll get it shipped out today! (or tomorrow if your message arrives after the postal lady picks up today's mail)

  6. #81
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438
    I don't know if it's worth implementing and a few more processorcycles:
    Today i had the idea to use another lookup-table (would be 192 Bytes) for the Channelstatus (all VUCP-Bits to be correct). This would allow to disable the copyright-flag.

    What do you think ?

  7. #82
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438
    I 'd be curious what is the jitter . Can you measure , Paul (or someone else) ? I believe it is sufficient to measure the BitClock.
    I do not have the necessary instruments.

    Then, i don't understand that some people say that the jitter with the TOSLINK is higer than RCA ?
    I would expect the opposite (No transformer and other circuitry, no cable where the signal gets influenced by other electric fields).
    Last edited by Frank B; 06-13-2015 at 03:04 PM.

  8. #83
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438

    Too much components ? Want less ? :-)

    It works even without external components. A single wire is sufficient:

    Click image for larger version. 

Name:	LED_TOSLINK3.jpg 
Views:	183 
Size:	46.1 KB 
ID:	4501

    Click image for larger version. 

Name:	LED_TOSLINK4.jpg 
Views:	162 
Size:	142.8 KB 
ID:	4502

  9. #84
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438
    Quote Originally Posted by PaulStoffregen View Post
    Sounds good. Can you email Robin directly (robin at pjrc dot com) with your current mailing address. She'll get it shipped out today! (or tomorrow if your message arrives after the postal lady picks up today's mail)
    Hm, something must gone wrong.
    I think it's lost somewhere between US and Europe...

  10. #85
    Junior Member
    Join Date
    Nov 2015
    Posts
    1
    I had to implement software SPDIF encoding and looked at this code. It seems to me a bit hard to understand and somewhat more convoluted than necessary. A three uint32_t[256] table approach would be faster (at the expense of 6x table storage), not need byte displacement and generate parity in the right place. My proof of concept uses ~7% CPU encoding 48KHz stereo on a STM32F072 running at 49.152MHz. Let me know if you're interested in the details.

  11. #86
    Junior Member
    Join Date
    Jul 2016
    Posts
    3
    Just found the teensy audio projects and I've already started ordering bits for my DIY audio system

    Question though, there is a lot of info about digital output but is there any way of taking a digital input and decoding it with the teensy? I'd love to use S/PDIF input with two audio boards for output

  12. #87
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438
    No, the existing S/PDIF is for output only.

  13. #88
    Junior Member
    Join Date
    Aug 2015
    Posts
    8
    Anyone interested in adat? I have a dream of low latency piezo/other sensors to adat plugged to an expert sleepers es-3 to control a modular... 8 D.C. Coupled outputs at 10vpp.

    Seems like the protocol has been reverse engineered, https://ackspace.nl/wiki/ADAT_project

    Wondering if anyone has coded or thought about it.

  14. #89
    Junior Member
    Join Date
    Aug 2015
    Posts
    8
    Found some c code for xcore that may help this endeavour: https://github.com/xcore/sc_adat

  15. #90
    Junior Member
    Join Date
    Nov 2017
    Location
    the Netherlands
    Posts
    5
    Quote Originally Posted by bafonso View Post
    Anyone interested in adat? I have a dream of low latency piezo/other sensors to adat plugged to an expert sleepers es-3 to control a modular... 8 D.C. Coupled outputs at 10vpp.

    Seems like the protocol has been reverse engineered, https://ackspace.nl/wiki/ADAT_project

    Wondering if anyone has coded or thought about it.
    Yep, I am quite new to Teensy and this kept me busy the whole weekend. But so far without success. I don't know whether this is doable, because of the usage of NRZI of the whole frame, which costs a bit more processing power than the Biphase mark encoding used in the SPDIF implementation. Also the bitrate is twice as high... Have you tried to get it working?

  16. #91
    Junior Member
    Join Date
    Nov 2017
    Location
    the Netherlands
    Posts
    5
    Quote Originally Posted by bafonso View Post
    Anyone interested in adat?
    I am very excited to let you know I've created a 8ch TOSLINK ADAT Optical output plugin for Teensy, based on the SPDIF example by Frank Boesing.

    Code, Information & demonstration video : https://github.com/EjaYF/teensy-adat-toslink.

  17. #92
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,624
    Awesome! Would it be ok to merge this back into the audio library?

  18. #93
    Junior Member
    Join Date
    Nov 2017
    Location
    the Netherlands
    Posts
    5
    Quote Originally Posted by PaulStoffregen View Post
    Awesome! Would it be ok to merge this back into the audio library?
    Sure! I would be honored!

    Perhaps some clock settings changes are necessary to make it compatible with the rest of the audio library. I've tested with the internal 44117Hz of the Teensy audio library and my 01V96 understands the signal, but I don't know if it violates the ADAT specs or if other devices have problems with such a signal... I could test other devices though (I also have some ADAT-compatible MOTU devices)...

  19. #94
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,624
    I've added your ADAT code and example to the audio library on github.

    https://github.com/PaulStoffregen/Au...83907e46b6a1bf

    I also tried to add basic documentation to the design tool. Hopefully this is ok?

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

  20. #95
    Junior Member
    Join Date
    Nov 2017
    Location
    the Netherlands
    Posts
    5
    Looks good! I've tested the beta 1.41 teensyduino version and it worked I would be interested in some CPU load information though...

  21. #96
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,624
    Quote Originally Posted by Ej@Y View Post
    I would be interested in some CPU load information though...
    For the portion that runs from the low priority audio interrupt, you can query the CPU usage.

    https://www.pjrc.com/teensy/td_libs_...ssorUsage.html

    For the hardware interrupt that runs at higher priority, the best way to measure involves adding digitalWriteFast at the start and end of the interrupt. Then you can use a DC voltmeter or oscilloscope to measure how much of the time it's high vs low. Almost all DC multimeters will properly show the average of a pulsing signal, but if you're really concerned and don't have a scope, you can RC lowpass filter the signal to get a nice DC signal.

Posting Permissions

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