I2S Output on Imx6

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2S Output on Imx6

7,583 Views
nicolaitel
Contributor II

Hi

I need to send audio from i2s solo sodimm module to an external dsp

The imx6 solo must act as master and communicate with the dsp via serial interface

My development board have an external SGTL5000 codec and my application with it works,

but our board don't have a codec but send audio via i2s so I need a dummy alsa driver that don't have a codec

Tags (1)
13 Replies

2,650 Views
daveeewang
Contributor II

HI,Nicola,

have you finished your dsp porting work? i'am doing the same thing like u, i used the imx6q to connect the external dsp via i2s,imx6q is slave mode .i changed the dts , add the machine code,etc.then i can see my device and driver through the log,but when i use the aplay shell to play something,there is no voice,and the log print some infomation ,"aplay: pcm_write:1682: write error: Input/output error",i have coast a lot of time to debug this driver,i don't understand where should i can modify and fix now ?can you give me some advices?waitting for your news:D

thanks very much!

Best regards

   ~jun

0 Kudos

2,650 Views
nicolalunghi
Contributor I

Hello Jun 

I have posted my driver code in alsa mailing list if you search my messages (I think that I use the mail nick83ola@gmail.com) you find it there

I suggest you to put printk everywhere and obsere where your driver is stuck, you need the platform driver, the codec driver (dummy but you need it) and the driver for DMA (the imx6 one) you need to configure the clock module the output port module and the ssi module lock at the datasheet for it

                              |   -  clock

(codec)->(port)->(ssi)->(dma)->(platform)

the imx-ssi module configure ssi for you but not clock

0 Kudos

2,650 Views
daveeewang
Contributor II

Hello,Nicola

   thank you for your reply.last week,i found out where the problem is .in the machine layer files,i refer to the imx-si476x.c file and modify the hw_params function,as follows,

捕获.PNG

0 Kudos

2,650 Views
nicolalunghi
Contributor I
0 Kudos

2,650 Views
ankurgohel
Contributor I

Hi Nicola,

We are working on an application very similar to yours. Instead of audio-out we have an audio-in. We have a digital microphone connected on the SAI channel 2. 

Is the patch at [alsa-devel] Simple-card without codec for testing purpose  final? I mean, would applying the patch do the trick or there is something more?

0 Kudos

2,650 Views
igorpadykov
NXP Employee
NXP Employee

ssi is the same as in i.MX6 so codes can be reused. I believe

sdma is not necessary for this case.

~igor

0 Kudos

2,650 Views
igorpadykov
NXP Employee
NXP Employee

as example one can look at  audio/imx_sgtl5000_audio

Lab and Test Software (2)

On-Board Diagnostic Suit for the i.MX53 Quick Start Board

http://www.nxp.com/products/power-management/pmics/pmics-for-i.mx-processors/i.mx53-quick-start-boar...

i.MX53 has similar SSI as i.MX6.

Best regards

igor

0 Kudos

2,650 Views
nicolaitel
Contributor II

Igor I can use that code to test ssi/dma configuration?? can I write an alsa userspace driver??

0 Kudos

2,650 Views
saurabh206
Senior Contributor III

Hi

This can be possible, You need to write dummy coded driver.

In the platform driver you need to configure SSI clocking and AUDMUX to generate correct clocking and I2S signal.

You can refer "Chapter 62 Synchronous Serial Interface (SSI)".

Thanks

Saurabh

0 Kudos

2,650 Views
nicolaitel
Contributor II

Hi

I followed another thread on alsa devel and I created a dummy codec driver using soc_utils.c

here's link to the discussion Re: Imx6 i2s master driver without i2c — ALSA Devel

I have problem with the output port that remain not configured I think that I missed something in iomux/audmux configuration

My internal device is SSI1 on port 1

my external port is port 4

also how do I check /init the clock assigned to ssi? I need to assign clock also to audmux???

0 Kudos

2,650 Views
igorpadykov
NXP Employee
NXP Employee

for ssi-audmux connections one can look at

linux/Documentation/../sound/imx-audmux.txt

Change AUDMUX src_port causes "imx_ssi_irq mxc_ssi SISR 8003a3 SIER 180100 fifo_errs=XXXX"

~igor

0 Kudos

2,650 Views
nicolaitel
Contributor II

Ok but is sufficient to write only the platform driver

and assign a dummy codec to it

(like for example in sound/soc/fsl/imx-spdif.c in probe function

.....

data->dai.name = "S/PDIF PCM";

data->dai.stream_name = "S/PDIF PCM";

data->dai.codec_dai_name = "snd-soc-dummy-dai";

data->dai.codec_name = "snd-soc-dummy";

data->dai.cpu_of_node = spdif_np;

data->dai.platform_of_node = spdif_np;

data->dai.playback_only = true;

data->dai.capture_only = true;

....

or what I need to initializate in codec driver?

on my evaluation board I have an sgtl5000 codec but the codec driver is full of function to setup regulator, volume, etc

ALl I need is a "dummy" i2s master output driver without i2c

0 Kudos

2,650 Views
nicolaitel
Contributor II

also in dts where do I need to put the dummy codec?

Now with sgtl5000 is in i2c section

sound-itel {

        compatible = "fsl,imx6q-icore-itel", "fsl,imx-audio-itel";

        model = "imx6q-icore-itel";

        cpu-dai = <&ssi1>;

        ssi-controller = <&ssi1>;

        audio-codec = <&codec>;

        mux-int-port = <1>;

        mux-ext-port = <4>;

    };

&i2c3 {

    codec: itel@0a {

        compatible = "fsl,itel";

        reg = <0x0a>;

        clocks = <&clks 201>;

        VDDA-supply = <&reg_2p5v>;

        VDDIO-supply = <&reg_3p3v>;

        VDDD-supply = <&reg_1p8v>;

    };

};

&ssi1 {

    fsl,mode = "i2s-master";

    status = "okay";

};

0 Kudos