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

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

Tue Oct 29, 2013 1:45 pm

Make sure the module does not modulate the level of output signal by the last 3 bits. That could be the source of noise as well. (I think it shouldn't but you should better check).

Mefodey
Posts: 14
Joined: Sat Oct 19, 2013 7:07 pm

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

Wed Oct 30, 2013 12:12 pm

Hello!
I found out that in GSM module PCM working in Left Justified mode
and in RPI it's Right Justified mode

Is there any possibility to adjust RPI I2S to Left Justified?

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

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

Wed Oct 30, 2013 3:55 pm

The correct answer to your question is yes, but it's not RJ, actually, and LJ is not explicitly implemented in bcm2708-i2s.
Still, it should work:
In frame sync slave mode (FSM=1), the PCM_FS is treated as a data input and is sampled on
the negative edge of PCM_CLK. The first clock of a frame is taken as the first clock period
where PCM_FS is sampled as a 1 following a period or periods where it was previously a 0.
The PCM audio interface locks onto the incoming frame sync and uses this to indicate where
the data channels are positioned.
You just need to precisely specify data position and clock polarity.

Mefodey
Posts: 14
Joined: Sat Oct 19, 2013 7:07 pm

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

Wed Oct 30, 2013 4:47 pm

Well, thanks for your knowledge
As far i understand, i should change in bcm2708-i2s.c half_frame value in order the frame=65
Am i right?
Sorry for stupid question, i haven't worked with i2s and RPI never before....

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

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

Wed Oct 30, 2013 5:04 pm

yes, try it yourself. If you don't succeed I'll post my code sometime when I get access to it.

Mefodey
Posts: 14
Joined: Sat Oct 19, 2013 7:07 pm

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

Wed Oct 30, 2013 6:19 pm

vadim wrote:yes, try it yourself. If you don't succeed I'll post my code sometime when I get access to it.
Well, i made some experiments...

With snd_rpi_mbed i.e. TLV320AIC23.c in all cases i made it to work as CBM_CFM
and in interface format i've made it always be SND_SOC_DAIFMT_LEFT_J

In bcm2708-i2s.c i've tried to change half_frame from 20 to 32.5
recompile and download to RPI

but in fact the I2s sound behavior seems to doesn't change a bit :( unfortunately

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

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

Wed Oct 30, 2013 10:44 pm

left justified mode doesn't change what i2s driver does, i told you so. it's still to be rewritten but so far there was not much demand for alternative formats.
i wonder how you set integer variable to 32.5 :) change the code where it sets half frame from 20 to 32 because at that point driver thinks to use xtal as clocksource. then change formula for frame length to 2*half_frame+1.double check that 8KHz is not disabled in rpi-mbed and codec allows that sample rate. make sure you keep playing 8KHz mono samples. i would also add some printk() withversion information and settings that drivers set. just to make sure you do run what you think you run (made that silly mistake myself). i'm writing this on my phone from memory so i use this as guidance only.
let's move this discussion to private messaging until the solution is ready. and put a feature request on github if you haven't done so yet ;)

bezel
Posts: 2
Joined: Thu Oct 31, 2013 10:50 am

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

Thu Oct 31, 2013 10:53 am

Anyone got this to work with PCM5102A?
I can't get any sound to come out of the board, and I get this error:

Code: Select all

BUG: scheduling while atomic: aplay/169/0x00000003
Full dmesg is here http://pastebin.com/WdR1vkvY

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

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

Thu Oct 31, 2013 3:59 pm

@bezel

Contact Francesco, the author of the drivers you're using. There is no config switching in the drivers so the user is supposed to know how everything should be connected (and that is not documented either). He should be able to advise how to connect configuration pins and supply master clock for these drivers to work.

And for the record, I was against inclusion of these drivers. :evil:

//edit: the bug message shouldn't cause problems unless ntp updates system time during playback.

bezel
Posts: 2
Joined: Thu Oct 31, 2013 10:50 am

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

Thu Oct 31, 2013 5:50 pm

This RPi is not connected to net, so ntp update can't happen :)

I'll contact Francesco (hope that is his mail in pcm5102a.c)

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

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

Thu Oct 31, 2013 11:07 pm

should be. I requested that he put his name and email.

mhelin
Posts: 129
Joined: Wed Oct 17, 2012 7:18 pm

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

Fri Nov 15, 2013 10:58 am

Now as there is the Wolfson Pi Audio Card available (soon) which doesn't require any extra configuration then maybe the driver inclusion should be considered again:

http://www.element14.com/community/comm ... wolfson_pi

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

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

Fri Nov 15, 2013 11:12 am

Does anyone want to volunteer and make the driver universal and push it to 3.10 kernel? ;)

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

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

Fri Nov 15, 2013 11:18 am

What exactly is your definition of universal?
Is it the fact that the frame length can not be set up fine-grained or is it something else?

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

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

Fri Nov 15, 2013 11:36 am

For instance, ability to play 48KHz 24bit ;)

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

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

Fri Nov 15, 2013 11:43 am

vadim wrote:For instance, ability to play 48KHz 24bit ;)
That is of course a main drawback, but I don't know if this is really possible. As far as I know, the DMA controller itself doesn't support transmission of 24 bits. Only 32 bit. I have no idea if this could be hacked to support 24 bit transmission.

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

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

Fri Nov 15, 2013 12:02 pm

koalo wrote:
vadim wrote:For instance, ability to play 48KHz 24bit ;)
That is of course a main drawback, but I don't know if this is really possible. As far as I know, the DMA controller itself doesn't support transmission of 24 bits. Only 32 bit. I have no idea if this could be hacked to support 24 bit transmission.
I had a short discussion with the ASoC developers - That shouldn't be a problem. I will test it again (last time it failed and I thought that would be the cause).

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

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

Fri Nov 15, 2013 12:24 pm

If I understand correctly that would require disabling frame-packed mode in I2S mode and doing some bit shifting in PCM module. And deleting that not universal attempt to force integer clock divisor with wrong frame length. ;)

I am so eager to see Wolfson Pi's driver :D

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

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

Sun Nov 17, 2013 6:46 pm

vadim wrote:If I understand correctly that would require disabling frame-packed mode in I2S mode and doing some bit shifting in PCM module. And deleting that not universal attempt to force integer clock divisor with wrong frame length. ;)
Which frame length does your codec need for 24 bit mode? 48 bit or 64 bit?

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

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

Sun Nov 17, 2013 7:54 pm

Oh, you know me :) I want to set it in the machine driver ;) because some codecs support packed mode, some don't... 64, probably, is more universal.

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

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

Sun Nov 17, 2013 8:07 pm

vadim wrote:Oh, you know me :) I want to set it in the machine driver ;) because some codecs support packed mode, some don't... 64, probably, is more universal.
With the current (yet unpublished) version of my driver you CAN set it via the machine driver. Although, I would like to know the appropriate value for your codec to show HOW to set it via machine driver :-)

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

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

Sun Nov 17, 2013 8:09 pm

koalo wrote:
vadim wrote:Oh, you know me :) I want to set it in the machine driver ;) because some codecs support packed mode, some don't... 64, probably, is more universal.
With the current (yet unpublished) version of my driver you CAN set it via the machine driver. Although, I would like to know the appropriate value for your codec to show HOW to set it via machine driver :-)
64 then.

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

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

Sun Nov 17, 2013 8:13 pm

And what is the name of it?

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

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

Sun Nov 17, 2013 8:22 pm

WM8727 on the output and WM8783 on the input.

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

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

Fri Nov 22, 2013 7:51 am

vadim wrote:most probably some control commands are not implemented in the card driver. try muting/unmuting in alsa mixer.
Hi vadim,
sorry for the late response. I couldn't manage to record with tlv320, so I switched to wm8731. It works fine. There are still some bugs like recording and blayback with less than 32kHz don't work what I couldn't fix yet (https://github.com/koalo/linux/issues/16). But I am confident that I can solve this with resampling or someone who is better in kernel programming than I am will find the bug soon. :-)

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