adc_dev
Posts: 4
Joined: Sun Dec 07, 2014 10:17 pm

Re: I2S sound: Anyone got it running? (answer is yes!)

Sat Dec 13, 2014 12:38 pm

I'm trying to connect to pcm1803 i2s raspberrypi model B rev 2.0. I did all the commands that are described in the log archive loader.tar.gz. All commands have been executed successfully.
Then I tried to write the output to a Wav file:
arecord -D hw:1 -c 2 -r 48000 -f s32 -d 4 -t wav -v sample.wav

When I opened the file, but instead there is data out there all zeros ...
Then I started to check your hardware, and that's what I found!

Raspberry pi i2s SDATA pin is a logic zero, even when I connected it via a resistor to 3.3 V !
Raspberry pi master i2s no signal SCLK at pin SCLK!

So I need to go back to the software problem, but I have no idea, I'm a noob in Linux.
Does anyone have any ideas?

PeterO, you have done a similar thing, and you got it. Could you tell me what's the problem? Or better yet, could you share your image microSD, with mood i2s and work together pcm1803? Please, please )))

User avatar
PeterO
Posts: 5128
Joined: Sun Jul 22, 2012 4:14 pm

Re: I2S sound: Anyone got it running? (answer is yes!)

Sat Dec 13, 2014 3:16 pm

I don't have an SD image to share. OS is on harddisk partition.

The code as it comes runs the PI as the master. In that state you should see the two I2S clocks running when you open the device for record.

I'm not sure the codec supports 32bit. I run it in 24bit mode.

Have yo read my write up http://www.peteronion.org.uk/I2S/ ?

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

adc_dev
Posts: 4
Joined: Sun Dec 07, 2014 10:17 pm

Re: I2S sound: Anyone got it running? (answer is yes!)

Sat Dec 13, 2014 7:58 pm

Yes, read.
I'll buy a new Raspberry Pi B + and continue experimenting with it.
Another small issue. Do I need to do something else other than what is described in the log archive? What would have earned i2s. I installed a fresh system and also as a command from the log, nothing more is done

gearhead
Posts: 26
Joined: Tue Sep 11, 2012 1:45 pm

Re: I2S sound: Anyone got it running? (answer is yes!)

Fri Dec 19, 2014 2:56 pm

D'oh. I figured it out. I forgot to provide a ground as shown in the schematic. It works, but now, I can no longer scan the i2c bus...
So, I'll dig into the source a bit, but what information is in the snd_SRC_iqaudio driver? Is it the i2c information, only? Because the snd_pcm512x driver looks like it has all the info needed to run the chip.

adc_ukr
Posts: 2
Joined: Sat Dec 13, 2014 11:59 am

Re: I2S sound: Anyone got it running? (answer is yes!)

Fri Dec 26, 2014 3:41 pm

Hay all. Finally I buy raspberry pi b+, and connect audio codec to raspberry:
- LRCK to 35 gpio raspberry
- SCLK to 12 gpio
- SDATA to 40 gpio
I do not have an oscilloscope :(, but there is a voltmeter.
And so ... no record:
- LRCK and SCLK - 3.27v
- SDATA - 0v.
Voltage during recording:
- LRCK and SCLK - 1.65v - means for deriving there meander or something else
- SDATA audio codec connect to raspberri pi through resistor 500 Om.
Voltage gpio in raspberry pi - 0v, voltage in sdata codec - 0.88v. The resistor drops 0.88v
GPIO 40 Raspberri pi configure in OUTPUT? WTF?
The file "sample.wav" is still zeros ... (

Gswg
Posts: 57
Joined: Wed Oct 16, 2013 10:30 am
Location: Swindon
Contact: Website

Re: I2S sound: Anyone got it running? (answer is yes!)

Sun Dec 28, 2014 12:05 pm

There are two drivers needed - one for the actual device (PCM512x) and one for the board (IQaudIO). The board file specifies the i2c address being used etc. We use the same drivers across our Pi-DAC and Pi-DAC+

Note - the PCM5122 needs to be "configured" before it will sing. This is done in the PCM512x driver at initialisation.

[email protected]

adc_dev
Posts: 4
Joined: Sun Dec 07, 2014 10:17 pm

Re: I2S sound: Anyone got it running? (answer is yes!)

Sun Jan 04, 2015 10:13 pm

Finally I got work ADC and Raspberry Pi.I successfully receive data from ADC.
But from time to time an error occurs:
"ALSA lib pcm.c:7339:(snd_pcm_recover) overrun occurred"
and receive stops.
For working with audio, I use PortAudio.

These are the pies .. :evil:

User avatar
PeterO
Posts: 5128
Joined: Sun Jul 22, 2012 4:14 pm

Re: I2S sound: Anyone got it running? (answer is yes!)

Mon Jan 05, 2015 10:57 am

adc_dev wrote:For working with audio, I use PortAudio.
Try going directly to the alsa layer and you will probably get better results.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
SannrHerr
Posts: 6
Joined: Mon Jan 05, 2015 1:35 pm
Location: Arnhem, NL

Re: I2S sound: Anyone got it running? (answer is yes!)

Mon Jan 05, 2015 2:12 pm

I'm getting dizzy from reading about RPi i2s audio, haha.

Forgive me, I'm a complete n00b with a couple of questions:

I've ordered this DAC: http://www.audio-gd.com/Pro/dac/NFB12015/NFB12015EN.htm
It supports up to 32bit / 384kHz thru i2s! It is fitted with a RJ-45 input for i2s: http://www.audio-gd.com/Pro/diy/I2Skits/I2SEN.htm

RJ-45 pin layout:
Pin 1 : SDATA
Pin 3 : LRCK
Pin 5 : SCLK
Pin 7 : MCLK
Pin 2,4,6,8 GND

Did I understand correctly that the RPi B+ is capable of 32bit / 384kHz?

What layout do I use? DAC - RPi:
Pin 1 : SDATA - pin 40 data
Pin 3 : LRCK - pin 35 LRCK
Pin 5 : SCLK - pin 12 BCK ???
Pin 7 : MCLK - ???
Pin 2,4,6,8 GND - pin 39 GND

Can I just use jumper wires and connect them to a RJ-45 plug in the right order?

I'm already in way over my head... And I haven't even got the faintest idea how to handle the software part. :oops:
They only have one God. We have many.

User avatar
0xFF
Posts: 202
Joined: Tue Nov 20, 2012 7:52 pm
Location: Poland

Re: I2S sound: Anyone got it running? (answer is yes!)

Mon Jan 05, 2015 6:51 pm

SannrHerr wrote: Did I understand correctly that the RPi B+ is capable of 32bit / 384kHz?
AFAIK Linux audio driver is limited to 192kHz.
SannrHerr wrote:I'm getting dizzy from reading about RPi i2s audio, haha.
What layout do I use? DAC - RPi:
Pin 1 : SDATA - pin 40 data
Pin 3 : LRCK - pin 35 LRCK
Pin 5 : SCLK - pin 12 BCK ???
Pin 7 : MCLK - ???
Pin 2,4,6,8 GND - pin 39 GND

Can I just use jumper wires and connect them to a RJ-45 plug in the right order?
Layout looks ok, but RPi doesn't provide Master Clock.
You have to check how to use your DAC without external Mater Clock.

Short jumpers should be ok for I2S test use.

User avatar
SannrHerr
Posts: 6
Joined: Mon Jan 05, 2015 1:35 pm
Location: Arnhem, NL

Re: I2S sound: Anyone got it running? (answer is yes!)

Mon Jan 05, 2015 9:15 pm

That was quick! Thank you!
0xFF wrote:AFAIK Linux audio driver is limited to 192kHz.
I did find a number of 32/384 DAC's for the RPi. For example: http://tekdevice.com/chapter2/index.php ... uct_id=115

Hopefully it will work beyond 24/192!
0xFF wrote:Layout looks ok, but RPi doesn't provide Master Clock.
You have to check how to use your DAC without external Mater Clock.
Great. It looks like it can function without Master Clock, if I understand correctly: http://www.audio-gd.com/Pro/diy/I2Skits/I2SEN.htm
Both RJ45 and HDMI I2S transmit models, the most ES9018 had not request the MCLK signal, you can cut the MCLK wire in the source , connect to GND or chassis if it is connect to GND.
We'll see!
0xFF wrote:Short jumpers should be ok for I2S test use.
Cool. I'm going to try a RPi B+ with 10cm jumpers to RJ45. If that works, I'm going to try and find a better (looking) solution!
They only have one God. We have many.

User avatar
0xFF
Posts: 202
Joined: Tue Nov 20, 2012 7:52 pm
Location: Poland

Re: I2S sound: Anyone got it running? (answer is yes!)

Mon Jan 05, 2015 9:58 pm

I tried successfully those DACs:

http://www.ebay.com/itm/DAC-24192-ABR-I ... 1262327691
http://www.ebay.com/itm/DAC-NOS1-Non-Ov ... 1064227245
https://www.hifiberry.com/dac

Never tried beyond 24/192.
32 bit data length should work without problem, but max frequency is limited to 192k.
This is Linux limit..

User avatar
SannrHerr
Posts: 6
Joined: Mon Jan 05, 2015 1:35 pm
Location: Arnhem, NL

Re: I2S sound: Anyone got it running? (answer is yes!)

Mon Jan 05, 2015 11:13 pm

0xFF wrote:I tried successfully those DACs:

http://www.ebay.com/itm/DAC-24192-ABR-I ... 1262327691
http://www.ebay.com/itm/DAC-NOS1-Non-Ov ... 1064227245
https://www.hifiberry.com/dac

Never tried beyond 24/192.
32 bit data length should work without problem, but max frequency is limited to 192k.
This is Linux limit..
Thanks again! 8-)
They only have one God. We have many.

User avatar
SannrHerr
Posts: 6
Joined: Mon Jan 05, 2015 1:35 pm
Location: Arnhem, NL

Re: I2S sound: Anyone got it running? (answer is yes!)

Tue Jan 06, 2015 9:35 am

Last one, before I start tinkering, promised. ;)
0xFF wrote:
SannrHerr wrote: Pin 1 : SDATA - pin 40 data
Pin 3 : LRCK - pin 35 LRCK
Pin 5 : SCLK - pin 12 BCK
Pin 7 : MCLK - none
Pin 2,4,6,8 GND - pin 39 GND
Layout looks ok, but RPi doesn't provide Master Clock.
Here is another image of the female RJ45 in my DAC: http://www.audiophonics.fr/fr/audiogd-m ... -8440.html

The GND layout on the DAC is: Pin 2,4,6,8 GND. Do I need to connect all of these to a GND on the RPi?
Internally, it looks like the DAC uses just 1 ground.

I also found these schematics online: http://3.bp.blogspot.com/-QzzWKWacbRA/V ... %83%A0.png
If/when I need to ground all four of them, can I use the layout in this picture? Grounds on the B+, according to this image, would be 39, 34, 14 and 6!?

Also, the company that makes the DAC says that I can use a GND if there's no Master Clock availble. Can I use any of the GND's?

I have to say it's great getting normal answers in stead of the flaming you often encounter on PC/gaming-forums for a change. :D
They only have one God. We have many.

User avatar
0xFF
Posts: 202
Joined: Tue Nov 20, 2012 7:52 pm
Location: Poland

Re: I2S sound: Anyone got it running? (answer is yes!)

Wed Jan 07, 2015 2:28 pm

I'm not expert, but...
The schematics looks ok - each I2S signal should be separated in coaxial cable (to prevent cross-talk and reduce EMI).

The problem is how to build such a cable.

Do not use Ethernet cable (shielded or unshielded).
This type of cable is relying on the balanced line twisted pair design and differential signaling for noise rejection while I2S is using unbalanced signal.

If you can solder, try to build your own cable.

This plug looks nice for soldering:
http://www.conrad.com/ce/en/product/603 ... g-straight

And some coaxial cable for I2S signals:
http://www.ebay.com/itm/RG178-BU-Teflon ... 1634970397

User avatar
PeterO
Posts: 5128
Joined: Sun Jul 22, 2012 4:14 pm

Re: I2S sound: Anyone got it running? (answer is yes!)

Wed Jan 07, 2015 3:24 pm

0xFF wrote:I'm not expert, but...
The schematics looks ok - each I2S signal should be separated in coaxial cable (to prevent cross-talk and reduce EMI).
If you are going to try and put digital signals down 50ohm coax you will need proper termination at both ends and proper low imedance line drivers and recievers. You can't just connect coax to a GPIO pin and expect it to work (excapt over very short distances).

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
SannrHerr
Posts: 6
Joined: Mon Jan 05, 2015 1:35 pm
Location: Arnhem, NL

Re: I2S sound: Anyone got it running? (answer is yes!)

Wed Jan 07, 2015 4:50 pm

0xFF wrote:I'm not expert, but...
The schematics looks ok - each I2S signal should be separated in coaxial cable (to prevent cross-talk and reduce EMI).

The problem is how to build such a cable.

Do not use Ethernet cable (shielded or unshielded).
This type of cable is relying on the balanced line twisted pair design and differential signaling for noise rejection while I2S is using unbalanced signal.

If you can solder, try to build your own cable.

This plug looks nice for soldering:
http://www.conrad.com/ce/en/product/603 ... g-straight

And some coaxial cable for I2S signals:
http://www.ebay.com/itm/RG178-BU-Teflon ... 1634970397
First, I want to test it using jumper cables, terminated into RJ45. Basically:

Image

+

Image

It would only be a very short distance. I don't think using that thick a coax cable would be a viable option...
They only have one God. We have many.

User avatar
SannrHerr
Posts: 6
Joined: Mon Jan 05, 2015 1:35 pm
Location: Arnhem, NL

Re: I2S sound: Anyone got it running? (answer is yes!)

Wed Jan 14, 2015 8:54 pm

Image

Meh, nothing with Volumio. It's a crude connection, but the pin-out is OK (I believe), so I guess it should have worked?

Neither the generic driver nor the other i2s drivers in Volumio made anything happen. Couldn't even select DAC as an output option...
They only have one God. We have many.

barsailer
Posts: 1
Joined: Tue Jan 27, 2015 7:27 pm

Re: I2S sound: Anyone got it running? (answer is yes!)

Tue Jan 27, 2015 7:38 pm

Hello,
I'm currenlty also trying to connect a RPI B+ to and audiogd NFB28 DAC using I2S link and Volumio version 1.5.

Hopefully I have a scope and found out that No I2S signal is getting out of the RPI B+ except for a single configuration in the Volumio system setting.

I2S must be configured to "Hifiberry", None of the others setup ouputs signals on LRCLK, SCLK, DATA
Hope this will help you.

apatel
Posts: 16
Joined: Thu Feb 05, 2015 6:56 am

Re: I2S sound: Anyone got it running? (answer is yes!)

Thu Feb 05, 2015 12:58 pm

Hi

I want to connect my adau1701 codec with raspberry pi board. I am using raspbian 3.18 kernel and able to compile and load the ASoC machine and codec driver of the codec, but none of the modules probe is getting invoked.

So, I think this is because, the device nodes are not created for machine and codec driver in the device tree.
How to update the device tree for the same? Is anything else required other than device tree update?

Thanks and Regards,
Anil

arpitjindal
Posts: 3
Joined: Sat Feb 21, 2015 12:04 pm

Re: I2S sound: Anyone got it running? (answer is yes!)

Sat Feb 21, 2015 12:29 pm

Hello all

I am also doing similar project. Problem is I am completely from software field, so I find it very difficult to understand everything. And this is my first project as bare-metal programming. Please excuse me for my dumb questions. :roll: So, now I have a RPi -B model and Cirrus Logic CS4398 DAC http://www.cirrus.com/en/pubs/proDatash ... 398_F1.pdf. Now, I have not attached the DAC with Rpi (as I don't want it to get damaged. It is provided to me by my prof.) and I am testing the i2s code. And I observed that PCM_SYNC bit is always 0 (I have configured clock at around 6.8 Mhz as given in earlier code). Anyone know why it happening? Do I have to connect DAC and RPi to get the SYNC working?

My DAC requires MCLK. And from the previous posts I got to know that RPi i2s does not provide MCLK. But in BCM2835 datasheet P130 I read, PCM_Mode register bit 23, "CLK = 0 = Master mode. The PCM CLK is an output and drives at the MCLK rate. ". So what does this means?

One last question. I want to setup RPi i2s at 44.1 Khz with 24 bit sample. What will be the clock (MCLK, BCLK) and transmission configuration? When we say 24 bit data, does it mean 12 bit on each channel or 24 bit on each channel? I am trying to understand this but I get confuse everytime. :?: :|

Thanks.

apatel
Posts: 16
Joined: Thu Feb 05, 2015 6:56 am

Re: I2S sound: Anyone got it running? (answer is yes!)

Mon Feb 23, 2015 12:05 pm

Hi,

I have connected my codec to the raspberry pi b using i2s and registered the sound card for this codec.
But when i try to play some audio file on codec it gives error saying "codec <-> bcm2708-i2s.0 No matching rates".

Any idea on how to resolve this issue?

Thanks in Advance,
Anil Patel

sibuntu
Posts: 4
Joined: Fri Apr 03, 2015 12:41 pm

Re: I2S sound: Anyone got it running? (answer is yes!)

Fri Apr 03, 2015 12:47 pm

hi guys
First, great great great work. Can someone give me an advice about my project. I am trying to record sound via I2S interface on Raspberry Pi model B+ with MP45DT02 http://www.st.com/st-web-ui/static/acti ... 025467.pdf. I compiled the kernel using kaolo,s blog and elinux.org site to enable i2S. But I have no success with recording yet.

User avatar
PeterO
Posts: 5128
Joined: Sun Jul 22, 2012 4:14 pm

Re: I2S sound: Anyone got it running? (answer is yes!)

Sun Apr 05, 2015 8:14 pm

From the data sheet that does not appear to be an I2S device.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2151
Joined: Thu Jul 11, 2013 2:37 pm

Re: I2S sound: Anyone got it running? (answer is yes!)

Sun Apr 05, 2015 8:24 pm

It's a PDM microphone.

http://users.ece.utexas.edu/~bevans/cou ... _Audio.pdf

This data input format is capable of being read by the I2S peripheral - see ARM peripherals datasheet section 8.6.
Rockets are loud.
https://astro-pi.org

Return to “Interfacing (DSI, CSI, I2C, etc.)”