I2S to S/PDIF - diyAudio
Go Back   Home > Forums > Source & Line > Digital Source

Digital Source Digital Players and Recorders: CD , SACD , Tape, Memory Card, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 17th September 2012, 06:58 AM   #1
diyAudio Member
 
Join Date: Aug 2010
Default I2S to S/PDIF

I have a satellite radio that is uses a CS4349 to do volume control and digital to analog conversion. I'm trying to use a twisted pear audio WM8804 board add digital output by converting I2S to S/PDIF.

I believe I need to configure the WM8804 for slave mode (AIF/MS L) and the receive source to the audio interface (TXSRC H). Since the CS4349 is configured for I2S with up to 24 bit data (DIF0 H, DIF1 L and DIF2 L) I configured the WM8804 for 24 bit I2S (AIFCONF1 L, AIFCONF0 H). The dip switches are right, left, right
and left.

Convenient test points on the tuner give access to SCLK (2.3 MHz):

Click the image to open in full size.

LRCLK (44.1 KHz):

Click the image to open in full size.

and SDIN:

Click the image to open in full size.

I'm not having luck getting the WM8804 to sync up and haven't found any examples of folks using a W8804 to do I2S to S/PDIF conversion. What am I doing wrong? The CS3449 does not have a master clock input but do I need to supply this to the W8804? Is what I'm attempting even possible in hardware mode? Would I be better off using a CS8406 to do this?
  Reply With Quote
Old 22nd November 2012, 05:18 PM   #2
diyAudio Member
 
harrylime6's Avatar
 
Join Date: Jun 2007
Location: vancouver, canada
All good questions, leres. I too have been attempting I2S>S/PDIF conversion using the TPA S/PDIF Transceiver module without success. And when you search on the net for info there is not much available that I can find. USB>I2S? Yep, lots on that. USB>S/PDIF? Yep, some on that too. But virtually nothing on what you and I are attempting. Odd. Some time ago I read the WM8804 manual over a few times and decided that what we want to accomplish is only do-able in software mode. But never got around to an implementation of same. In any event, leres, let's hope one or both of us will eventually succeed. -harry
  Reply With Quote
Old 22nd November 2012, 06:39 PM   #3
diyAudio Member
 
Avro Arrow's Avatar
 
Join Date: Sep 2010
Location: Toronto, eh
What pins are you using for your I2S input?

I think that for the WM8804 to do what you want, you need to use
13, 14, 15 and 16 for your I2S input.

According to the Twisted Pear manual, configure as follows:
AIF/MS high (left)
TXSRC low (right)
AIFCONF1 high (left)
AIRCONF0 high (left)

DIN, BCLK, LRCLK and MCLK as inputs.
  Reply With Quote
Old 22nd November 2012, 07:08 PM   #4
diyAudio Member
 
s3tup's Avatar
 
Join Date: Dec 2004
Location: Israel
I did it for a bit different task, but i've confirmed this setup worked for transferring of I2S into SPDIF too:

SPDIF Back Sync

Configuration:
SDIN (3, HW/SW) = 0 (Hardware mode configuration)
SCLK (1, AIF_MS) = 0 (Slave mode, MCLK is INPUT)
CSB (5, TXSRC) = 1 (Transmit from Data_IN)

AIF_CONF[0..1] is up to you. I have used "00" mode for I2S@16BIT, but it ate the I2S@24BIT from DIR9001. I haven't noticed the DIR9001 output format, as everything worked flawlessly from the first touch.





Oh, i know what's the problem. Your SCLK (MCLK) is only 64Fs.
AFAIK Wolfson wants 128/256Fs.
You've gotta pump it up with some *2 frequency multiplier and then try again...
__________________
The missing link between lead and gold in alchemist's world was BS and commerce.

Last edited by s3tup; 22nd November 2012 at 07:19 PM.
  Reply With Quote
Old 22nd November 2012, 07:59 PM   #5
JensH is offline JensH  Denmark
diyAudio Member
 
Join Date: Jul 2009
I realize that the original question is relatively old, but I have some suggestions on what to do.

I think that the WM8804 and the CS8406 both require a MCLK (called OMCK for the CS8406). I don't have experience with the WM8804, but I have worked with the CS8406. So I will take this as an example.

The OMCK can be either 128, 256 or 512 x the sample rate. These clocks can of course be generated from the SCLK by using a PLL with x2, x4 or x8 operation. A simpler design may also work OK. If 128x is chosen it can be generated from the SCLK by doubling the clock with an XOR gate plus an RC circuit with a suitable delay. If the duty cycle of the SCLK is 50% this will generate a nice x128 clock. Only one of the edges will be well defined though, since the one defined by the RC time constant may have more jitter.

Another potential issue is the serial format. The CS4349 can operate in different modes. If I2S is used the SPDIF transmitter should of course also be set up for I2S format. If it is a different format the SPDIF transmitter must of course also be set up for this other format, e.g. left justified. It is probably I2S though. If not, it will be very easy to hear once you get a signal through.
  Reply With Quote
Old 22nd November 2012, 08:18 PM   #6
diyAudio Member
 
Join Date: Aug 2010
I spent more time reading the WM8804 data sheet and can to the conclusion that you can't feed the WM8804 44.1 KHz in hardware mode. Maybe one day I'll try hooking a atmega328p up to it.

I was able to get a CS8406 working but I needed to find OMCK and feed that to the CS8406 in addition to SCLK, LRCLK and SDIN. I had a lot of dropouts but I think it was because I had wires everywhere and nothing was shielded. I'm going to wire up a permanent version this weekend and see if I can make it work better.
  Reply With Quote
Old 22nd November 2012, 08:46 PM   #7
JensH is offline JensH  Denmark
diyAudio Member
 
Join Date: Jul 2009
Good to hear you found a suitable clock for the OMCK and got it working.
It is important to wire it properly, since you can otherwise get a lot of ringing and noise on the clock and data signals. If you use a flat cable (IDC type) and use every 2nd wire as a ground wire, you should be able to get a stable operation. If you don't have this kind of cable, or don't want to use it, you can twist two wires for each signal and use one of the wires for ground, connected to ground at both ends.
  Reply With Quote
Old 22nd November 2012, 09:09 PM   #8
diyAudio Member
 
s3tup's Avatar
 
Join Date: Dec 2004
Location: Israel
I did WM8804 44.1 KHz in hardware mode, with 256Fs MCLK.

Where have you hooked-up the CS8406? If you use PC for SPDIF input then you have to configure your's soundard to sync to the SPDIF IN... Otherwise you'll get these dropouts.
__________________
The missing link between lead and gold in alchemist's world was BS and commerce.
  Reply With Quote
Old 25th November 2012, 12:48 AM   #9
diyAudio Member
 
linuxworks's Avatar
 
Join Date: Jul 2008
Location: santa clara, CA
the wm8804/5 DOES support 44.1. it would have to, right? yes, in hw mode, not needing sw mode.

I use the usb audio widget to feed my wolfson i2s to spdif converter. has been working fine for months and months, now.
__________________
My Photostream:http://www.flickr.com/photos/linux-works/
  Reply With Quote
Old 25th November 2012, 04:09 AM   #10
diyAudio Member
 
Join Date: Aug 2010
Quote:
Originally Posted by linuxworks View Post
the wm8804/5 DOES support 44.1. it would have to, right? ;) yes, in hw mode, not needing sw mode.
I don't think you can handle 44.1 with the twisted pair audio WM8804 board in hardware mode if you're going to use its on-board 12 MHz oscillator. But you can if you're going to clock it with a different source (which is what I later figured out I needed to do).
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I2S to S/PDIF converter krassyg Digital Line Level 2 13th October 2011 02:31 PM
Multichannel I2S to S/PDIF converter lacipeti Parts 0 5th October 2011 01:15 PM
I2S-S/PDIF 2:1 Mux Receiver merlin el mago Twisted Pear 7 2nd April 2011 07:04 PM
Capture 3x (6 ch) I2S or S/PDIF macboy Digital Line Level 10 28th April 2010 07:34 PM
distribute S/PDIF or I2S, passive? tschrama Digital Source 14 23rd May 2003 01:22 AM


New To Site? Need Help?

All times are GMT. The time now is 07:01 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2