hummes23
Posts: 5
Joined: Tue Jun 10, 2014 9:36 am

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

Thu Jun 12, 2014 3:38 pm

Hey,

but buying something of the shelf is boring ;-)

draco
Posts: 22
Joined: Fri Aug 15, 2014 6:42 am
Location: Melbourne, Australia

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

Fri Aug 15, 2014 7:08 am

Hi everyone,

I've got the mbed audio codec board (TLV320AIC23) connected to my pi, and loaded the appropriate drivers (from koalo's repo). I soldered a mic and front-end circuit to the MIC BIAS and MIC IN for recording purpose. Recording at 48kHz 16-bit appears to work, except roughly every 60,000 samples, I get 2 samples that are about -32700 and 32700.

Does anyone know what the issue might be?

Has anyone managed to get recording to work?

plugh
Posts: 41
Joined: Sun Dec 02, 2012 6:58 pm

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

Wed Aug 20, 2014 6:06 pm

koalo wrote:@gnozzi, @jotun: Which audio codec do you want to use?
Especially for audio input, it is not so easy to provide a generic driver since the audio codecs usually need some configuration via I2C, but it would not be difficult to provide a driver for a specific audio codec (at least when there is already an associated codec driver https://github.com/raspberrypi/linux/tr ... soc/codecs).

The only thing that stops the mbed and proto drivers from being included into the official kernel is the lack of pull requests that respect the quality standards (e.g. proper indention, separation into well formatted commits). I there is a high demand for these drivers I will see if I can find some time for doing this.
I am also trying to do some dumb / plain / simple / generic i2s audio capture.
(fyi I am very much a noob regarding linux drivers)

Here is an example (rev 2 model B):
Install a jumper between P5-04 (PCM_FS) and P5-05 (PCM_DIN)

With rpi hw as 'master', at any bit clock and word length, this "device"
should yield a stereo stream with one channel all ones, other all zeros.

Is there a driver in the current raspbian kit that will get this to work?
(perhaps a magic invocation of sound/soc/generic/simple-card.c ?)

If yes, how do I then set rpi hw word length and bit clock for it?
If no, what driver needs to be written for this "device" to work?

Thanks!

PS Is ALT2 PCM_DIN configured with internal pull-up or pull-down active?

draco
Posts: 22
Joined: Fri Aug 15, 2014 6:42 am
Location: Melbourne, Australia

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

Thu Aug 21, 2014 3:16 am

draco wrote:Hi everyone,

I've got the mbed audio codec board (TLV320AIC23) connected to my pi, and loaded the appropriate drivers (from koalo's repo). I soldered a mic and front-end circuit to the MIC BIAS and MIC IN for recording purpose. Recording at 48kHz 16-bit appears to work, except roughly every 60,000 samples, I get 2 samples that are about -32700 and 32700.

Does anyone know what the issue might be?

Has anyone managed to get recording to work?
I spent a little more time looking into the issue and found that periodically, the LEFT channel gets the wrong MSB on a few samples consecutively, then goes back to normal. The interval between each incident is too consistent to attribute this to signal noise. Is there something fundamentally wrong with the mbed audio codec board or the TI TLV320AIC23 chip?

draco
Posts: 22
Joined: Fri Aug 15, 2014 6:42 am
Location: Melbourne, Australia

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

Mon Aug 25, 2014 4:30 am

draco wrote:Hi everyone,

I've got the mbed audio codec board (TLV320AIC23) connected to my pi, and loaded the appropriate drivers (from koalo's repo). I soldered a mic and front-end circuit to the MIC BIAS and MIC IN for recording purpose. Recording at 48kHz 16-bit appears to work, except roughly every 60,000 samples, I get 2 samples that are about -32700 and 32700.

Does anyone know what the issue might be?

Has anyone managed to get recording to work?
In case anyone is still interested, I finally got my mbed audio codec to work flawlessly. The mbed board uses a 12MHz crystal as its MCLK source, but the TLV320AIC23 chip does not have a PLL built in, so it requires the I2S BCLK and MCLK to be in sync. I removed the crystal, and used the PI's GPCLK0 as MCLK source. I also modified koalo's rpi-mbed and bcm2708-i2s drivers to use GPCLK0 (see the attached file).
Attachments
rpi-mbed-gpclk-patch.tar.gz
Drivers modifications to support GPCLK0 as MCLK source.
(2.86 KiB) Downloaded 506 times

martijn
Posts: 3
Joined: Mon Aug 25, 2014 9:48 am

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

Mon Aug 25, 2014 12:04 pm

So I have a NAD C541i with a botched transport, but with a perfectly good I2S-capable PCM1732 DAC. Sounds like a fun project to hook the Pi's I2S output up to this. The DAC itself is not really a favorite but the analog part of the NAD as a whole sounds pretty good, so why not?

Hooking it up hardware-wise shouldn't be too hard since the PCM1732 accepts a 3-pin I2S signal. But is there a generic I2S driver that could make this work out of the box (at least for basic 16-bit 44.1kHz data, which the DAC accepts in it's default state)? Or would I need to build something specifically for this DAC? The DAC is capable of 24/96 but for that requires some extra configuration (either by pulling pins or by sending serial data, depending on the mode of the DAC), so in the end I'm going to need more than just the I2S pins but it would be cool if I can get it working with a generic kernel module to see if it's worthwhile.

plugh
Posts: 41
Joined: Sun Dec 02, 2012 6:58 pm

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

Mon Aug 25, 2014 8:09 pm

re: PCM1732 DAC
The currently available 'rpi-dac' module is mated with the pcm1794a codec.
You might research how compatible your 1732 is with the 1794...

re: my previous post - Woo Hoo! It works!
I have successfully mated an (almost) unmodified
sound/soc/generic/simple-card.c with an unmodified
sound/soc/codecs/dmic.c to capture audio via I2s!

The 'glue' is a bit of a hack that I need to think about some more
so I'm not going to post any how-to's until I'm satisfied with it.

Oh the 'almost unmodified' bit is that the card driver needs a
3 line patch that is sitting in the 3.13 tree. (Would be great if
it was back-ported to the current official 3.12 tree hint hint)

more later...

Dantell
Posts: 1
Joined: Tue Aug 26, 2014 7:49 am

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

Tue Aug 26, 2014 8:57 am

New to this, looking for a bit of help. I have a B+ and am trying to interface it with my MiniDSP using I2S. I've read through everything i could find. The only real pin outs with explanations i could find were for using the P5 header. I saw one diagram and pic with pin outs for the B+, to connect a different DAC but none of the pins were labelled.

I've read how someone got the two interfaced with general descriptions but it was the previous model. It looks to me like:

Pin 40: SCLK = DATA
Pin 39: Ground
Pin 35: MISO = LRCLK
Pin 14: PCM_C = BCLK

The article i read on connecting the two states:

"The output of the ADAU1701 is an I2S master. That means it can be used also as the master clock for the input. With this setup – output BCLK and LRCLK connected to input BCLK and LRCLK, there is no need for an external clock source. The ADAU1701 can create all the necessary clocks with the onboard resonator."

So my PIN 40 Data would connect to PIN 10 on the MiniDSP I2S_DATA_IN 1&2 ?
PIN 39 would connect to one of the Ground pins on the MiniDSP like 25
PIN 35 would connect to PIN 14 on the MiniDSP - I2S_IN_LRCLK
PIN 14 would connnect to PIN 15 on the MiniDSP - I2S_IN_BCLK

Or would 35 and 14 on RPi be connected to the LRCLK and BCLK outputs of the MiniDSP since it is the clock source? Am i correct in thinking the clock signals have to fed back to the RPi to synchronize the data flow?

just trying to understand, thank you for the help.

martijn
Posts: 3
Joined: Mon Aug 25, 2014 9:48 am

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

Tue Aug 26, 2014 9:29 am

Well the rpi-dac driver looks very simple and does little more than setting the BCLK, so I wouldn't be surprised if this works for my DAC as well. Time to get out the soldering iron! :mrgreen:

hank007
Posts: 34
Joined: Mon Sep 23, 2013 3:38 pm

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

Wed Aug 27, 2014 10:21 am

I'm using Koalo's updated kernel for an audio application which used audio proto board. It's working ok but there are limitations in the driver like sampling frequency can't be configured for anything other than 48KHz. It would to great have support for popular audio boards in official kernel as this will allow fixing outstanding issues.

plugh
Posts: 41
Joined: Sun Dec 02, 2012 6:58 pm

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

Wed Aug 27, 2014 3:29 pm

This may be of interest to a variety of people...

As I mentioned above I have successfully mated the simple-card driver with the dmic codec driver. I did it without having to rebuild the kernel and effectively* no source code changes. The 'glue' is a separate loadable kernel module, tweakable to allow use of other existing simple codec drivers for either capture or playback with the simple-card driver.

The attached archive contains the log of a complete terminal session (edited for readability and to embed some comments) and the source file for the 'glue' module. To quote from the log's intro
Plugh note: This is an editted putty log of the procedure to setup system to allow building
loadable kernel modules (ref https://github.com/notro/rpi-source/wiki ), then to build the
simple-card and dmic drivers, and finally to build the 'hello world' example and my_loader.
(ref https://github.com/notro/rpi-source/wik ... us-modules )
It was executed on a freshly installed NOOBS v1.3.9 Raspbian image with 1GB free space.
I am NOT holding the glue code up as some shining example of kernel mode programming, but it is simple and it seems to work. (caveat emptor) And for what it is worth, this particular driver combo is what I'm now using to play with an ADMP441 (aka INMP441) Digital MEMS Microphone IC (a really cool little device; you can get proto-pcbs from OSH Park for under $2)

I may check back here in case there are questions, but I'm going to mostly be focused on my hardware project now. Hopefully this will be useful or give people some ideas...

Enjoy!

*effectively - 3.12 simple-card.c needs a patch from 3.13 (shown in log)

8/31 edit - I'm removing my previous addendum because it occurred to me that simple-card / my_loader might be usable with a broader range of devices if a person did any hw specific gpio twiddling (eg mode pins, etc) in a separate program (perhaps my_loader for one-time inits?). In such cases a robust card driver should eventually be created, but to just play with a breakout board or whatever... well hmmm... (the admp441 digital mic doesn't need any other gpios)
Attachments
loader.tar.gz
(5.85 KiB) Downloaded 1118 times
Last edited by plugh on Mon Sep 01, 2014 1:41 am, edited 3 times in total.

martijn
Posts: 3
Joined: Mon Aug 25, 2014 9:48 am

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

Thu Aug 28, 2014 7:40 pm

Thanks plugh, that will definitely come in handy as I was kinda lost on where to start writing a kernel module.

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

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

Sat Aug 30, 2014 2:11 pm

plugh wrote:This may be of interest to a variety of people...
That looks VERY interesting. :D I have a PCM 1803 breakout board sitting on the shelf. Maybe now is the time to get it out and have a play with it :-)

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

plugh
Posts: 41
Joined: Sun Dec 02, 2012 6:58 pm

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

Sat Aug 30, 2014 9:01 pm

I just found a bug in sound/soc/bcm/bcm2708-i2s.c

Code: Select all

        /*
         * Adjust the data length according to the format.
         * We prefill the half frame length with an integer
         * divider of 2400 as explained at the clock settings.
         * Maybe it is overwritten there, if the Integer mode
         * does not apply.
         */
        switch (params_format(params)) {
        case SNDRV_PCM_FORMAT_S16_LE:
                data_length = 16;
                bclk_ratio = 40;
                break;
        case SNDRV_PCM_FORMAT_S24_LE:
                data_length = 24;
                bclk_ratio = 40;                         <<====SHOULD BE 60
                break;
        case SNDRV_PCM_FORMAT_S32_LE:
                data_length = 32;
                bclk_ratio = 80;
                break;
        default:
                return -EINVAL;
        }
It is why 24 bit playback & capture isn't working. If "you" decide to rebuild the module with the fix, you might want to also uncomment this line to reenable 24 bit audio playback

Code: Select all

				// | SNDRV_PCM_FMTBIT_S24_LE : disable for now, it causes white noise with xbmc
I am also of the opinion that this dma flag should be added

Code: Select all

        /* Setup the DMA parameters */
        regmap_update_bits(dev->i2s_regmap, BCM2708_I2S_CS_A_REG,
                        BCM2708_I2S_RXTHR(1)
                        | BCM2708_I2S_TXTHR(1)
                        | BCM2708_I2S_RXSEX              <== add flag to sign-extend rx data
                        | BCM2708_I2S_DMAEN, 0xffffffff);
For tx the flag doesn't matter, for 16 bit rx flag shouldn't matter since packed frames are used, for 32 bit rx flag doesn't matter since word is full, for 24 bit rx sign extension into the high byte seems like the right thing to do, though so far I have not seen any effect either way in downstream software (more testing to do...).

BTW, as I don't have any i2s dac hardware, I would be very interested in confirmation that the above does fix 24 bit playback.

jhansen317
Posts: 4
Joined: Mon May 19, 2014 11:28 pm

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

Tue Sep 16, 2014 10:08 pm

plugh wrote:I just found a bug in sound/soc/bcm/bcm2708-i2s.c

Code: Select all

        /*
         * Adjust the data length according to the format.
         * We prefill the half frame length with an integer
         * divider of 2400 as explained at the clock settings.
         * Maybe it is overwritten there, if the Integer mode
         * does not apply.
         */
        switch (params_format(params)) {
        case SNDRV_PCM_FORMAT_S16_LE:
                data_length = 16;
                bclk_ratio = 40;
                break;
        case SNDRV_PCM_FORMAT_S24_LE:
                data_length = 24;
                bclk_ratio = 40;                         <<====SHOULD BE 60
                break;
        case SNDRV_PCM_FORMAT_S32_LE:
                data_length = 32;
                bclk_ratio = 80;
                break;
        default:
                return -EINVAL;
        }
It is why 24 bit playback & capture isn't working. If "you" decide to rebuild the module with the fix, you might want to also uncomment this line to reenable 24 bit audio playback

Code: Select all

				// | SNDRV_PCM_FMTBIT_S24_LE : disable for now, it causes white noise with xbmc
I am also of the opinion that this dma flag should be added

Code: Select all

        /* Setup the DMA parameters */
        regmap_update_bits(dev->i2s_regmap, BCM2708_I2S_CS_A_REG,
                        BCM2708_I2S_RXTHR(1)
                        | BCM2708_I2S_TXTHR(1)
                        | BCM2708_I2S_RXSEX              <== add flag to sign-extend rx data
                        | BCM2708_I2S_DMAEN, 0xffffffff);
For tx the flag doesn't matter, for 16 bit rx flag shouldn't matter since packed frames are used, for 32 bit rx flag doesn't matter since word is full, for 24 bit rx sign extension into the high byte seems like the right thing to do, though so far I have not seen any effect either way in downstream software (more testing to do...).

BTW, as I don't have any i2s dac hardware, I would be very interested in confirmation that the above does fix 24 bit playback.
I can verify that or'ing SNDRV_PCM_FMTBIT_S24_LE does enable 24 bit playback, at least with my wolfson wm8731 dac. Playback seems to work equally well with bclk_ratio set to 40 or 50 (the recommended value from another post https://github.com/raspberrypi/linux/is ... t-55153828) but I haven't tried setting it to any other values.

jhansen317
Posts: 4
Joined: Mon May 19, 2014 11:28 pm

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

Tue Sep 16, 2014 10:47 pm

This is pretty much unrelated to above post so I thought I'd make a new one. I'm working with the mainline kernel into which I've merged (with some changes) Koalo's driver for the WM8731 proto board. For my purposes, I am using the dmix plugin which is resampling everything to 48k. I'm a bit confused, though, about how (or if?) I might get around this. The wolfson data sheet indicates that rates from 8k to 96k are supported, and the contraints set forth in rpi-proto.c seem to reinforce this, but in practice it seems that any file that's not 48k will play back at the wrong rate. Forgive my ignorance of device driver subtleties - I'm very new to all this, so my question is: do I need to change some parameter in the source to be able to play files with different sample rates (which I understand will be constrained to those rates that are divisors of 12288000)? Or is there a way to enable support for all of the rates in rpi-proto.c? Also the direction of "wrongness" in the playback rate is counterintuitive to me. For example, if I play a 96k wav file with aplay, the playback speed (and pitch!) is twice what it should be, chipmunk music. It seems, based on ONLY my intuition, that the opposite should be true...I would expect it to play at half speed, since there are twice as many samples? Another note, if I adjust the playback speed to half with sox but leave the sample rate untouched and play the resultant file with aplay, playback is at the right speed and pitch and hw_params shows the sample rate to be 96000. If anyone can help bridge the gaps in my understanding, I will read eagerly! Thank you!

plugh
Posts: 41
Joined: Sun Dec 02, 2012 6:58 pm

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

Wed Sep 17, 2014 8:30 am

re: the 24-bit fix - the default bck_ratio value only comes into play if the pi is clock master and the card driver does *not* set the value via the 'set bclk ratio' callback (my case). {fyi - it appears the i2s 24-bit bug-fix and a related enhancement have been checked into 3.12.28, as well as the simple-card driver and its bugfix - yeah!. }

Not familiar with the board or codec you are using, but if 96k data was resampled to 48k but the board was clocking at 96k, wouldn't that give you your chipmunk effect? What happens when you bypass the alsa dmix plugin / resampling and talk directly to the board via "hw:x,y"?

jhansen317
Posts: 4
Joined: Mon May 19, 2014 11:28 pm

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

Wed Sep 17, 2014 9:58 pm

plugh: excuse my omission. I was trying to include all the details but left out a big one! So yes, everything plays fine when dmix is "in the mix" but if I go the direct hw route, that's when things get chipmunky. And in the direct hw case, hw_params shows the rate to be 96000 if I give it a 96k file...but it plays back at twice speed so...something's off. Right? When everything is going through dmix, hw_params always shows 48000, which is to be expected. So for all intents and purposes I have working sound (and really quite good sound at that!) but there's the overhead of all this unnecessary resampling. I've specified the following in my alsa config file:

Code: Select all

defaults.pcm.rate_converter "samplerate"
but if I try to use one of the better algorithms supplied by ALSA the poor pi can't really handle it, or so it seems. the playback is so choppy it's like a split second of sound followed by an entire second of silence and so on. So the goal is to find out if it's possible to play 96k (or any other of the supported rates) files directly to hw without any intervening processing.

plugh
Posts: 41
Joined: Sun Dec 02, 2012 6:58 pm

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

Wed Sep 17, 2014 11:10 pm

Ah, a bit clearer. As I said, I'm not familiar with that board/codec/driver tuple... You mentioned 12MHz - the board is clock master? (i.e. Is the board twiddling bclk to fetch bits, or is the pi twiddling bclk to push bits?) You need to identify your clock source for debuggiung .Does the card driver 'talk' to the board (perhaps via I2C ) to config ITS clock divider? Also, what is the sample size dmix is sending vs your 96K source? Perhaps a source of timing error if mismatched...

Don't know what sort of test equipment you have, but here's a thought... Got an AM radio? (Or a shortwave radio?) AM radio tunes .5MHz to 1.6MHz...

So, for example, 48000*16*2 = 1.536MHz, 32000*24*2 - 1.536MHz, 16000*32*2 = 1.024MHz, 44100*16*2 = 1.4112MHz, you get the drift...

Of course there will be lots of other 'hash' being generated, but it's a cheap and easy way to check. Tune to the expected frequency, start transfer, see if signal appears. (Will work better if there is a short wire clipped to bclk line - check out Pi Radio).

tuck1s
Posts: 11
Joined: Sat Sep 22, 2012 10:24 am

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

Wed Sep 24, 2014 3:28 pm

koalo wrote: Secondly, I have used a single Wolfson Audio Card, a small driver modification and some software to get 4-channel audio input. The same thing should be possible in the other direction. If you are interested, I will share details.
I'm very interested in this. Daniel (over at http://www.hifiberry.com/forums/topic/digi-spdif-input/) said the standard drivers don't support input (and his Digi+ board has places for input components but they're not fitted).

I've got one of these: http://www.ebay.co.uk/itm/WM8804-S-PDIF ... 20d6a10f5c which is producing a good looking 192k / 24 bit signal from a Behringer P16-I analog/digital device - see here: https://www.dropbox.com/sh/k0xzfwpyyneu ... -vVLa?dl=0

The WM8804 is just running in "HW" mode at this stage - no connection to the Raspi. The ideal would be, I think for the WM8804 to act as I2S clock master.

I think my first step is to get the WM8804 to accept output from the Raspi and appear as a playback device .. but my goal is to get the Raspi to accept input from the WM8804. Any hints/tips greatly appreciated.

MPJ
Posts: 2
Joined: Tue Oct 21, 2014 7:31 pm

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

Wed Oct 22, 2014 9:17 am

Hi, I am designing a board with WM8510 I2S I2C mono audio CODEC.

I think I do not have problems with the hardware, but I am totally lost about the ALSA drivers.

I do not know what files I need to write or change.

Any help will be welcomed, thanks.

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

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

Mon Nov 03, 2014 11:25 am

I'm coming back to my project again where I want to use an I2S ADC to read raw I/Q data from a Software Defined Radio.
As previously stated earlier in the thread I've already got a PCM1803 breakout board to use.

However it is still unclear to me what the current state of the I2S drivers is in the kernel. I've just updated my B+ and I see the modules listed below are already loaded.

Is there any example code available for using the devices that I presume these modules provide ?

Thanks

PeterO

Code: Select all

[email protected] ~ $ lsmod
Module                  Size  Used by
snd_bcm2835            19576  0 
snd_soc_bcm2708_i2s     6210  0 
regmap_mmio             2818  1 snd_soc_bcm2708_i2s
snd_soc_core          127849  1 snd_soc_bcm2708_i2s
snd_compress            8259  1 snd_soc_core
regmap_i2c              1661  1 snd_soc_core
snd_pcm_dmaengine       5505  1 snd_soc_core
regmap_spi              1913  1 snd_soc_core
snd_pcm                83845  3 snd_bcm2835,snd_soc_core,snd_pcm_dmaengine
snd_page_alloc          5132  1 snd_pcm
snd_seq                55484  0 
snd_seq_device          6469  1 snd_seq
snd_timer              20998  2 snd_pcm,snd_seq
leds_gpio               2079  0 
led_class               4118  1 leds_gpio
snd                    62252  7 snd_bcm2835,snd_soc_core,snd_timer,snd_pcm,snd_seq,snd_seq_device,snd_compress
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
PeterO
Posts: 5448
Joined: Sun Jul 22, 2012 4:14 pm

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

Sat Nov 08, 2014 1:11 pm

"Use the source, Luke" :-)
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

Pander
Posts: 23
Joined: Sun Nov 09, 2014 11:35 pm

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

Fri Dec 05, 2014 11:01 pm

I am more tempted to http://www.minidsp.com/products/acousti ... ent/umik-1 by the lack of a properly working and supported ADC for B+. Experimental solutions are good but not for my application. And this device is calibrated as well.

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

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

Wed Dec 10, 2014 2:41 pm

I recently purchased a HiFiBerry for my model B and love it. I am trying to learn a bit about this as well. So, I want to experiment with a pcm5122. I have one on a breadboard which I have connected like it shows here:
http://will-123456.blogspot.tw/2014/06/ ... 2mini.html
The basic schematic is identical to what is shown in the datasheet from TI:
Fig18.jpg
figure from http://www.ti.com/lit/ds/symlink/pcm5121.pdf
Fig18.jpg (26.56 KiB) Viewed 15447 times
R1/[email protected] C1/C2 are 470Ohm and 2.2nf also in the data sheet.
I do not read Chinese, but it looks like he is specifying the iqaudio driver
I have connected it and I get nothing. Nothing shows on the i2c bus and alsa lists no audio device
raspi-blacklist.conf

Code: Select all

# blacklist spi and i2c by default (many users don't need them)

#blacklist spi-bcm2708
#blacklist i2c-bcm2708
/etc/modules

Code: Select all

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

i2c-dev
#i2c-bcm2708
#snd-bcm2835
snd_soc_bcm2708
snd_soc_bcm2708_i2s
bcm2708_dmaengine
snd_soc_pcm512x
snd_soc_iqaudio_dac
alpay lists no soundcards, lsmod lists a ton of snd modules as well as snd_soc_pcm512x. I am connected to the 3 i2s pins as well as sda/scl and have 3v3/ground from the raspberry. Any ideas? Interesting is that nothing shows up on the i2c bus, either:

Code: Select all

sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Any help getting this going?

REgards,

Gearhead

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