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

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

Tue May 13, 2014 8:13 am

It would be nice to have an update on the new driver here, I think I'm not the only one for whom it would be difficult to find this out from github. Thanks!

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

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

Tue May 13, 2014 9:00 am

koalo wrote:Depends on what you want to do.
Thanks for reply Florian,

I want to do 96kHz or 192kHz stereo capture, which means 3 of the 4 cards you listed are not appropriate, and from what I gather the Wolfson only works on a specially cobbled together kernel that they produced and is not being kept upto date. I'm using a currently pre-released firmware build on the PI (*) so I think it would be wise to need to stick to officially supported kernels.

There is some mis-information about as well, one supplier of an I2S ADC card told me it is not compatile with a RPI because RPI only has I2C not I2S interface !

PeterO
G0DZB

(*) It has fixes in it needed to make the gpu_fft and openGL ES work together properly.
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

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

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

Tue May 13, 2014 9:41 am

PeterO wrote:
koalo wrote:Depends on what you want to do.
I want to do 96kHz or 192kHz stereo capture, which means 3 of the 4 cards you listed are not appropriate, and from what I gather the Wolfson only works on a specially cobbled together kernel that they produced and is not being kept upto date. I'm using a currently pre-released firmware build on the PI (*) so I think it would be wise to need to stick to officially supported kernels.
You have to patch the kernel anyway since none of the included board drivers supports audio input. Wolfson provides a bunch of patches that should easily merge with the current kernel (and therefore with your kernel, too) (http://downloads.element14.com/wolfson/ ... nAudioCard).
Some other boards that are not specifically designed for the Raspberry Pi are listed in my blog post, but some kernel patching is needed for those, too.
PeterO wrote: There is some mis-information about as well, one supplier of an I2S ADC card told me it is not compatile with a RPI because RPI only has I2C not I2S interface !
That is only correct for the old revision 1 version. Since revision 2, you can find the interface on the additional P5 header.

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

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

Tue May 13, 2014 9:54 am

koalo wrote:You have to patch the kernel anyway since none of the included board drivers supports audio input.
How long before they are included in the official kernel tree ?
Wolfson provides a bunch of patches that should easily merge with the current kernel (and therefore with your kernel, too) (http://downloads.element14.com/wolfson/ ... nAudioCard).
Some other boards that are not specifically designed for the Raspberry Pi are listed in my blog post, but some kernel patching is needed for those, too.
This is very dissapointing :-( Can't these drivers be provided as loadable kernel modules ?

PeterO

PS: I though I2S was going to provide a simple solution to high bandwith capture, but that seems not to be the case. I'll go back to looking for USB based solutions.

PeterO
Last edited by PeterO on Tue May 13, 2014 10:01 am, edited 1 time in total.
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
DougieLawson
Posts: 38447
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

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

Tue May 13, 2014 9:57 am

The smallest Wolfson image I've found is 801MB (and taking ages on my slow ADSL)
http://www.element14.com/community/thre ... w-download

https://drive.google.com/file/d/0BzIaxM ... sp=sharing <== DIRECT LINK

I would much prefer a version that's kernel agnostic and shipped as a Raspbian *.DEB so I can add the support to my copy of Raspbian (which I've spent months working with, un-bloating and tailoring).
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

jephua
Posts: 21
Joined: Fri Apr 04, 2014 6:03 am

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

Mon May 19, 2014 11:46 am

Hi all, just want to check if anyone downloaded the image from http://noiseisgood.com/useful-files-for-soundcard/ and tested recording with the audio codec proto board ? This seems to be the fastest way of getting audio input to the raspberry pi from what I see.

am1337
Posts: 7
Joined: Tue Sep 03, 2013 3:46 pm

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

Mon May 19, 2014 4:45 pm

jephua wrote:Hi all, just want to check if anyone downloaded the image from http://noiseisgood.com/useful-files-for-soundcard/ and tested recording with the audio codec proto board ? This seems to be the fastest way of getting audio input to the raspberry pi from what I see.
I haven't tried the image, but recording works well with koalo's kernel.

jephua
Posts: 21
Joined: Fri Apr 04, 2014 6:03 am

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

Tue May 20, 2014 2:06 pm

I have tried the instructions http://www.noiseisgood.co.nz/?p=365 on the 2013-05-25-wheezy-raspbian.zip and did the step: sudo rpi-update. When rebooted, the linux version was at 3.10 already. I proceeded with the rest of the instructions and updated the kernel but encountered the rainbow screen when rebooting from the new kernel. Anyone experienced this before?

am1337
Posts: 7
Joined: Tue Sep 03, 2013 3:46 pm

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

Tue May 20, 2014 7:13 pm

jephua wrote:I have tried the instructions http://www.noiseisgood.co.nz/?p=365 ...
I don't know if the needed module is already available in standard kernel (installed by rpi-update). For proto board I used this one: https://github.com/koalo/linux/tree/rpi-3.10.y

jephua
Posts: 21
Joined: Fri Apr 04, 2014 6:03 am

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

Wed May 21, 2014 3:38 am

am1337 wrote:
jephua wrote:I have tried the instructions http://www.noiseisgood.co.nz/?p=365 ...
I don't know if the needed module is already available in standard kernel (installed by rpi-update). For proto board I used this one: https://github.com/koalo/linux/tree/rpi-3.10.y
Hi am1337, thanks! I finally got the playback and recording working :)

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

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

Wed May 21, 2014 9:01 pm

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

BBUK
Hello!
I have the same goal as BBUK, and I have managed to get it working, but I have run into a slightly different problem. For example, if I try to play 44.1k audio, it plays back as if it were 48k (ie higher pitch, but not twice as high, thanks to the advice in the above post). /etc/asound.conf contains only:

Code: Select all

pcm.!default {
    type hw
    card 1
}
ctl.!default {
    type hw
    card 1
}
If I try to use ALSA's 'plug' plugin, I get the following error from aplay:

Code: Select all

aplay: set_params:1297: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: 125000
PERIOD_SIZE: (5512 5513)
PERIOD_BYTES: (22048 22052)
PERIODS: (3 5)
BUFFER_TIME: 500000
BUFFER_SIZE: 22050
BUFFER_BYTES: 88200
TICK_TIME: 0
And if I use the dmix plugin, aplay just hangs and I have to issue a kill -9. I built the latest alsa-lib, alsa-utils, and alsa-plugins from source, but without any success. The snd_pcm_hw_params function is defined in /src/pcm/pcm.c (within the directory structure of the alsa-lib-1.0.27.2 tarball) and says:

Code: Select all

* \brief Install one PCM hardware configuration chosen from a configuration space and #snd_pcm_prepare it
 * \param pcm PCM handle
 * \param params Configuration space definition container
 * \return 0 on success otherwise a negative error code
 *
 * The configuration is chosen fixing single parameters in this order:
 * first access, first format, first subformat, min channels, min rate, 
 * min period time, max buffer size, min tick time. If no mutually
 * compatible set of parameters can be chosen, a negative error code
 * will be returned.
 *
 * After this call, #snd_pcm_prepare() is called automatically and
 * the stream is brought to \c #SND_PCM_STATE_PREPARED state.
 *
 * The hardware parameters cannot be changed when the stream is
 * running (active). The software parameters can be changed
 * at any time.
 *
 * The configuration space will be updated to reflect the chosen
 * parameters.
But I'm very new to this and I'm not sure I even understand exactly what that means let alone what may be causing the call to to fail. Really I'm curious to know whether it's a matter of my particular configuration or whether it is related to how the parameters are defined in rpi-proto.c or wm8731.h/c

Thanks in advance for any help with this!

jephua
Posts: 21
Joined: Fri Apr 04, 2014 6:03 am

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

Thu May 22, 2014 10:14 am

By the way, anyone using the Audio Codec Proto board and recorded a silent interval? I could hear some 'hissing' sound, do you all think it is due to software settings issue or could it be the supply voltage ripple?

am1337
Posts: 7
Joined: Tue Sep 03, 2013 3:46 pm

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

Thu May 22, 2014 5:48 pm

jephua wrote:I could hear some 'hissing' sound, do you all think it is due to software settings issue or could it be the supply voltage ripple?
Have you tried another power supply yet? I guess it comes from the supply voltage.

jephua
Posts: 21
Joined: Fri Apr 04, 2014 6:03 am

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

Fri May 23, 2014 9:42 am

am1337 wrote:
jephua wrote:I could hear some 'hissing' sound, do you all think it is due to software settings issue or could it be the supply voltage ripple?
Have you tried another power supply yet? I guess it comes from the supply voltage.
I have just tried powering the rpi from power bank; seems hissing still there. Btw, i am using Model A, don't think the model causes any issues 8-)

moparapi
Posts: 7
Joined: Sat Jun 07, 2014 4:50 am

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

Sat Jun 07, 2014 6:42 am

Inquiring minds want to know... What's the difference between koalo's 3.10.y and 3.10.y-asoc git branches?

I went through compiling 3.10.y-asoc for use with a Proto audio codec board, only to find in the end that the asoc branch doesn't yet have rpi_proto support. (My mistake for not checking more thoroughly beforehad.) No big deal, just a little wasted time, but it seemed to me the asoc branch, from the name alone, would be what one would select.

Also, does this look like a sane/correct connection for the Proto?

RPi Proto
P5-3 SCK
P5-5 MISO
P5-6 MOSI
P5-4 ADCL and DACL
P1-3 SDA
P1-5 SCL


Thanks to all, and especially koalo!

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

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

Sat Jun 07, 2014 10:56 am

I am sorry, you are totally right. The branch without -asoc is the current one (including support for the proto board). I have deleted the other one with -asoc now. The connection looks right.

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

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

Tue Jun 10, 2014 10:07 am

I enjoy the I2S sound of the raspPi.
Is there a way to connect more DACs to provide multichannel audio?

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

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

Tue Jun 10, 2014 10:54 am

AFAIK I2S is for stereo (2-channels) only.

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

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

Tue Jun 10, 2014 10:58 am

0xFF wrote:AFAIK I2S is for stereo (2-channels) only.
In the first place that is correct, but there are hacks to handle this limitation.

Some thoughts can be found here:
https://github.com/Guzunty/Pi/issues/11

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.

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

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

Tue Jun 10, 2014 12:40 pm

Would be real happy if you can share this.
I am really interested in finding a multichannel solution like volumio/ rune gives for stereo.

I am not to deep into software neither hardware but will try to follow your link.

I was also thinking if it might be an option to hook 2 or 3 raspPis with a i2s DAC each to one "masterboard" which splits the stream?
Maybe a stupid idea...but......

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

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

Tue Jun 10, 2014 1:36 pm

hummes23 wrote:Would be real happy if you can share this.
The basic idea is to let the Raspberry Pi think you are supplying 32 bit stereo, but actually you transmit 16 bit 4-channel. You can just change the header of a 4-channel wave file to achieve that. Secondly, you have to do a small driver modification to tell the codec that the bitrate claimed by the Raspberry Pi is actually wrong (http://pastebin.com/R91kCehn). Then you have four channels available at the wolfson card to switch to the desired output.
Of course, this is a hackish solution and could be done more elegant directly inside the kernel, but this would take more kernel hacking.
hummes23 wrote:I am not to deep into software neither hardware but will try to follow your link.
The link is about connecting an external CPLD that basically does the same as described above, but can also be used together with codecs that do not support 4 channels out of the box.
hummes23 wrote: I was also thinking if it might be an option to hook 2 or 3 raspPis with a i2s DAC each to one "masterboard" which splits the stream?
Maybe a stupid idea...but......
Yes, that would be an easy solution. Have a look into netjack for transmitting audio via ethernet.

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

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

Wed Jun 11, 2014 7:59 am

But do you think this is also a suitable solution soundquality wise?
Or is this just way to complicated?

Another thing... Would the rasppi a sufficient plattform for such an approach?

Or would it just be much simpler and/or better sounding to go the easy spdif way somehow.

Maybe by using a component like a minishark from minidsp could also be a good option.

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

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

Wed Jun 11, 2014 8:04 am

hummes23 wrote:But do you think this is also a suitable solution soundquality wise?
Or is this just way to complicated?
Which one do you mean?
hummes23 wrote: Or would it just be much simpler and/or better sounding to go the easy spdif way somehow.
With spdif you do not gain anything. It can only transmit stereo, too.
hummes23 wrote: Maybe by using a component like a minishark from minidsp could also be a good option.
You can use anything you like, but the question is what you want to achieve. Do you want to build the cheapest solution, the best sounding, the one with the least effort in software or in hardware.....?

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

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

Wed Jun 11, 2014 11:28 am

talking about netjack solution.


sorry about spdif...just want to refer to high quality audio in multichannel enviroments.


I want to achieve something similar than sending stereo over i2s to the dac.
I would class this high quality...and that is what I am "hunting" for .... high quality audio reproduction.

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

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

Wed Jun 11, 2014 11:46 am

hummes23 wrote:talking about netjack solution.
Should be a good solution with easy setup, but I don't know how good the drivers play together with jack (tested it once and it didn't work, but that should not prevent you from trying it again). It is just more expensive than the single-rpi solution.
hummes23 wrote: I want to achieve something similar than sending stereo over i2s to the dac.
I would class this high quality...and that is what I am "hunting" for .... high quality audio reproduction.
Buy yourself a fireface ;-)

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