vadim
Posts: 129
Joined: Wed Sep 18, 2013 1:47 pm
Location: Nottingham

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

Fri Nov 22, 2013 12:01 pm

Bugs are known and reported. Should be corrected someday.

koalo
Posts: 121
Joined: Mon Feb 04, 2013 4:02 pm

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

Fri Nov 22, 2013 7:01 pm

I have finally managed to update the driver to 3.10 and to integrate a lot of style enhancements.
Furthermore, it is now possible to set up the bit clock ratio via machine driver.

https://github.com/koalo/linux/tree/rpi-3.10.y

What still does not work is 24 bit support - has anyone a 24 bit file that uses 4 bytes per sample for testing?
I have only 24 bit files with 3 bytes and aplay does not want to switch to 4 bytes per sample format.

The only board that is currently supported is the HifiBerry Mini:
http://www.crazy-audio.com/projects/hifiberry-mini/

The other boards (mbed, proto, tda1541a, cirrus board by Wojciech M. Zabolotn) should be easily supported by copying the old files from 3.8, but I currently have no chance to test them.

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

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

Fri Nov 22, 2013 7:17 pm

How to check bytes count per sample for file?
If mplayer says: AO: [alsa] 48000Hz 2ch s32le (4 bytes per sample), thats ok ?

koalo
Posts: 121
Joined: Mon Feb 04, 2013 4:02 pm

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

Fri Nov 22, 2013 7:18 pm

0xFF wrote:How to check bytes count per sample for file?
If mplayer says: AO: [alsa] 48000Hz 2ch s32le (4 bytes per sample), thats ok ?
That should be fine.

vadim
Posts: 129
Joined: Wed Sep 18, 2013 1:47 pm
Location: Nottingham

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

Fri Nov 22, 2013 7:25 pm

Yay! Will test it this weekend.

Why 4 bytes and not SNDRV_PCM_FMTBIT_S24_3LE?

koalo
Posts: 121
Joined: Mon Feb 04, 2013 4:02 pm

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

Fri Nov 22, 2013 7:28 pm

vadim wrote:Yay! Will test it this weekend.

Why 4 bytes and not SNDRV_PCM_FMTBIT_S24_3LE?
Because packed transmission is apparently not supported by the DMA controller.

koalo
Posts: 121
Joined: Mon Feb 04, 2013 4:02 pm

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

Mon Nov 25, 2013 7:08 pm

I finally managed to implement 24 bit transfer even with S24_3LE files :-D
I don't need the test file anymore and will upload the required patch soon, but before I would like to know if anyone has tested the 3.10 branch so far or if there are stupid bugs induced by the update so that I can fix them at one go.

Greetings,
Florian

vadim
Posts: 129
Joined: Wed Sep 18, 2013 1:47 pm
Location: Nottingham

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

Mon Nov 25, 2013 7:55 pm

I believed in you! :D
Sorry, I haven't tested yet and will have to postpone testing to next week. I'm still struggling to see the point of forcing different frame lengths for different sampling rates. I don't think that there are many DAC/ADC that would accommodate that (NOS in slave mode, perhaps), so people will just override it more often then not. And if they don't they won't get working 8,16,32,48KHz. The driver still does some assumptions and calculations and only then checks if they were necessary.

Morfeus
Posts: 19
Joined: Thu Nov 07, 2013 10:47 am

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

Thu Nov 28, 2013 6:03 pm

Question, probably to florian:

I do have a Curryman miniDSP dac for i2s. Is this dac supported (or can be made supported ;-) )? It uses the Sabre 9023 chip.

http://www.minidsp.com/products/minidsp ... an-i2s-dac

The dac was developed by Daniel, one of the best developers for digital stuff. Joachim Gerhard (Audio Physics) developed the output buffer. As this is a very good dac and inexpensive, it would be really nice if it would be supported by the i2s Raspberry driver.

Thanks!

vadim
Posts: 129
Joined: Wed Sep 18, 2013 1:47 pm
Location: Nottingham

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

Thu Nov 28, 2013 11:56 pm

Morpheus, you should understand that Florian doesn't write drivers for DACs he doesn't have. Simply because they can't be tested.
Having said that, most simple connections (not involving i2c or SPI) should work with a driver that already exists. A change of slave-master configuration and the set of allowed sample rates is all that should be done. In rare cases frame length setting might require some adjustment.

User avatar
kfigiela
Posts: 3
Joined: Sun Dec 01, 2013 6:36 pm
Location: Kraków, Poland

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

Sun Dec 01, 2013 6:49 pm

Florian, thank you for the upgrading the sources!

I managed to merge mbed audio board from 3.8 – here's the pull request https://github.com/koalo/linux/pull/27

Small hint for anyone who will be porting other drivers: in `snd_soc_dai_link` structure of the driver `platform_name` changed from "bcm2708-pcm-audio.0" to "bcm2708-i2s.0". As I'm not linux kernel dev it took me a while to find the problem ;)

ceteras
Posts: 239
Joined: Fri Jan 27, 2012 1:42 pm
Location: Romania

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

Mon Dec 16, 2013 10:19 am

I've installed the I2S drivers using pasdesignal's blog instructions.
The driver seems to work quite well, but I have a side issue with my raspberry.
After installing the driver, I can no longer halt the system. With "sudo shutdown -h now", or "sudo halt", or "sudo init 0", the system reboots. It used shut down everything, then blink ACT led 10 times, then halt, and stay there. Now it just reboots after stopping all the services, no ACT blinking either.
First time when I've noticed this behaviour, I've tried an "rpi-update" and then the system would halt properly, but of course, the I2S drivers were lost in the process.
Then I've followed the instructions from the blog again (to the letter) and install I2S kernel again, and the reboot behaviour is back.
What information should I provide for a proper troubleshooting?


ceteras
Posts: 239
Joined: Fri Jan 27, 2012 1:42 pm
Location: Romania

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

Mon Dec 16, 2013 10:38 am

Thanks, but that doesn't help. It's about Gertduino there.
My issue is only related to the kernel, as far as I understand.

vadim
Posts: 129
Joined: Wed Sep 18, 2013 1:47 pm
Location: Nottingham

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

Mon Dec 16, 2013 11:53 am

build kernel version 3.10. you might have some issues after upgrading Pi to 3.10 and then running experimental 3.8 kernel.
just use rpi-3.10.y-asoc branch in git

ceteras
Posts: 239
Joined: Fri Jan 27, 2012 1:42 pm
Location: Romania

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

Mon Dec 16, 2013 12:01 pm

I will try that.
Koalo says "The other boards (mbed, proto, tda1541a, cirrus board by Wojciech M. Zabolotn) should be easily supported by copying the old files from 3.8, but I currently have no chance to test them."
I use tda1541 driver, so I hope I don't screw up by copying the wrong files, wish me luck!

vadim
Posts: 129
Joined: Wed Sep 18, 2013 1:47 pm
Location: Nottingham

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

Mon Dec 16, 2013 2:10 pm

not really a copy-paste as the name of platform device was changed. you will need to change it in card dai definition in card driver. don't forget to add platform devices for card and codec in bcm2708.c (same as for hifiberry that is already defined there)

tjaekel
Posts: 7
Joined: Mon Aug 26, 2013 4:22 am
Location: Irvine, CA, USA
Contact: Website

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

Sat Dec 21, 2013 7:11 am

Rpi DAC works now without a kernel hack.
an updated Raspbian or new Volumio http://volumio.org/ can play audio now with Rpi DAC.
If you like high quality audio - here it is:
http://www.tjaekel.com/T-DAC/raspi.html

silopolis wrote:
tjaekel wrote:Yes, I have created audiophile DAC PCB, with PCM1794, works nice on Raspberry Pi:
http://www.tjaekel.com/T-DAC
WOW :-O
This is so nice, well done man !!!
My plan was to use TPA's DAC but this is an interesting alternative...

Keep it on, hope it will be available prebuilt sometime.

Bests

ceteras
Posts: 239
Joined: Fri Jan 27, 2012 1:42 pm
Location: Romania

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

Sun Dec 22, 2013 1:13 pm

With the following settings in /etc/modules, I have the pcm1794a driver working:

Code: Select all

snd-bcm2835
snd_soc_bcm2708
snd_soc_bcm2708_i2s
bcm2708_dmaengine
snd-soc-pcm1794a
snd_soc_rpi_dac
Now, the interesting part is, the same TDA1387 DAC (16bit 44.1k) works with this driver.
Mplayer:

Code: Select all

AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
So, TDA1541 DACs should work too.
Thanks for the update, tjaekel, without your post I wouldn't have noticed the great news!

vadim
Posts: 129
Joined: Wed Sep 18, 2013 1:47 pm
Location: Nottingham

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

Sun Dec 22, 2013 1:29 pm

rpi-dac is a generic driver that will provide output with many non-configurable NOS DACs in slave mode. i think we also need a generic in/out driver and one for RPi as slave. that should cover about 80% of use cases.

BBUK
Posts: 142
Joined: Tue Dec 18, 2012 10:34 am

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

Mon Dec 23, 2013 4:08 pm

Hi Koalo/all.

I previously had 3.8 working but the 3.10.y version (although it seems to compile correctly) plays what seems to be double speed sound using the WM8731 (proto board) driver. I have not undertaken much investigation but will report back with what I find. Just a heads up at the moment.

BBUK

vadim
Posts: 129
Joined: Wed Sep 18, 2013 1:47 pm
Location: Nottingham

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

Mon Dec 23, 2013 5:12 pm

BBUK, I think you need to set bitclock (frame length) in the card driver. There's a new function in 3.10.

BBUK
Posts: 142
Joined: Tue Dec 18, 2012 10:34 am

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

Thu Dec 26, 2013 8:51 am

BBUK, I think you need to set bitclock (frame length) in the card driver. There's a new function in 3.10.
Bingo! Thanks vadim. Adding

Code: Select all

        struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
        int retcode = snd_soc_dai_set_bclk_ratio(cpu_dai,32*2);
        if (retcode < 0){
                dev_err(substream->pcm->dev, "Failed to set BCLK ratio \n");
                return retcode;
        }
to the snd_rpi_proto_hw_params function in rpi-proto.c did the trick for me (note for convenience, I put the changes together in one block of code, this will probably trigger a compile warning if just cut and pasted).

So I can now confirm that the proto board driver is working in the new 3.10 asocdev kernel.

BBUK

fgatin
Posts: 2
Joined: Mon Jan 13, 2014 3:22 pm

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

Mon Jan 13, 2014 3:27 pm

Hi guys,

Would it be possible to connect the Pi to this Rohm digital amplifier via I2S ?

This IC has one input systems of digital audio interface. (No needs of Master Clock)
- I2S / LJ / RJ format
- LRCLK: 32k/44.1k/48KHz
- BCLK: 32fs / 48fs / 64fs
- SDATA: 16 / 20 / 24bit

Thanks in advance.

Cheers.

koalo
Posts: 121
Joined: Mon Feb 04, 2013 4:02 pm

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

Mon Jan 13, 2014 4:59 pm

Should be possible, but you have to write a i2c driver for controlling the IC.

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