IMX6 SSI I2S and Slave mode BCLK clock issue regarding the playback time

cancel
Showing results for 
Search instead for 
Did you mean: 

IMX6 SSI I2S and Slave mode BCLK clock issue regarding the playback time

2,111 Views
venkatesh_pvsm
Contributor II

Hi ALL,

  I have checked 8000 sample rate files not playing to PC properly.Let me know CODEC will sipport 8khz or not with master mode.

Codec as master mode and following clock settings configured in driver side

MCLk=24Mhz

SYSCLK=11.2896MhZ

ADLRC as GPIO mode.

44khz WORKING BOTH PC AND Target good:

Mono:

BCLK=705.6Khz

DACLRC=22.050Khz

Bit=16 bit

2(byte)x22050(rates)x16= 705.6Khz

This above 705.6Khz BCLK support is available in CODEC settings (sysclk/16)

Stereo:

BCLK=1.4112MHz

DACLRC=44.1khz

Bit=16 bit

2(byte)x44100(rates)x16= 1.4112MHz

This above 1.4112MHz BCLK support is available in CODEC settings (sysclk/8)

8khz target Recorded wav files its not properly playing with PC /PC Recorded wav filesits not properly playing with Target:

Present 8Khz settings in my driver settings:

BCLK=1.4112MHz ( I was tried sysclk diver by 4,6,8,12,16,32)

DACLRC=8Khz

Bit=16 bit

2(byte)x8000(rates)x16= 256Khz

This above 256Khz BCLK support is not available in CODEC settings.

  Actually this above 8000 samples i am getting so much trouble with PC and Target,Please suggewst this codec will support 8khz sample or not in Master mode .PC recorded 8khz sample file playing very fast in our Target.Target recorded 8khz sample file playing very slowly to PC.

  44.1khz sample files playing both PC and Target Normally.

HOW TO ENABLE SSI AS MASTER MODE AND bclK=256KHZ AND frame rate=8000khz.\\

Thanks by,

Venkat.

0 Kudos
3 Replies

139 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Vencat,

    We have a reference code for Master mode in ./imx_3.10/sound/soc/fsl/imx-si476x.c or ./imx_3.0.35/sound/soc/imx/imx-si4763.c, Please refer to this source code and adjust your source code accroding to your requirement!

Regards,

Weidong

0 Kudos

139 Views
venkatesh_pvsm
Contributor II

Hi Weidong,

Imx6 solo/dl based processor simultaneously is not working  with live VGA 640x480 video capture (OV5640) and  audio loop back(wm8960 codec)

    ISSUE:I have faced the issue based on video capture parallel and audio loop back/simultaneous.

Both audio and videos was working parallely  with QVGA (320x240) 15 fps QCIF (176x144) 15/30 fps .\

Working both audio and video for following resolution :

QVGA (320x240) 15 fps

QCIF (176x144) 15 fps

QCIF (176x144) 30 fps

Tested Commands:

--------------------------------

./mxc_v4l2_capture.out -iw 320 -ih 240 -ow 320 -oh 240  -m 1 -fr 15-d /dev/video0 -i 1 -c 1000 /v5640_320_240_30fps.yuv  &

arecord -D hw:0,0 -c 2 -f S16_LE -r 8000 -t raw | aplay -D hw:0,0 -c 2 -f S16_LE  -r 8000 -v

./mxc_v4l2_capture.out -iw 176 -ih 144 -ow 176 -oh 144  -m 7 -fr 15 -d /dev/video0 -i 1 -c 1000 /CAM/vv176_144_i1_15.yuv   &

arecord -D hw:0,0 -c 2 -f S16_LE -r 8000 -t raw | aplay -D hw:0,0 -c 2 -f S16_LE  -r 8000 -v

./mxc_v4l2_capture.out -iw 176 -ih 144 -ow 176 -oh 144  -m 7 -fr 30 -d /dev/video0 -i 1 -c 1000 /CAM/vv176_144_i1_30.yuv &

arecord -D hw:0,0 -c 2 -f S16_LE -r 8000 -t raw | aplay -D hw:0,0 -c 2 -f S16_LE  -r 8000 -v

--------------------------------

Both audio and video  is not working for following resolution :

QVGA (320x240) 30 fps

QVGA (640x480) 30 fps

QVGA (640x480) 15 fps

Tested Commands:

--------------------------------

./mxc_v4l2_capture.out -iw 640 -ih 480 -ow 640 -oh 480  -m 0 -fr 30 -d /dev/video0 -i 1 -c 1000 /CAM/v5640_640_480p_30fps.yuv &

arecord -D hw:0,0 -c 2 -f S16_LE -r 8000 -t raw | aplay -D hw:0,0 -c 2 -f S16_LE  -r 8000 -v

./mxc_v4l2_capture.out -iw 640 -ih 480 -ow 640 -oh 480  -m 0 -fr 10 -d /dev/video0 -i 1 -c 1000 /CAM/v5640_640_480p_10fps.yuv &

arecord -D hw:0,0 -c 2 -f S16_LE -r 8000 -t raw | aplay -D hw:0,0 -c 2 -f S16_LE  -r 8000 -v

./mxc_v4l2_capture.out -iw 320 -ih 240 -ow 320 -oh 240  -m 1 -fr 15 -d /dev/video0 -i 1 -c 1000 /v5640_320_240_15fps.yuv &

arecord -D hw:0,0 -c 2 -f S16_LE -r 8000 -t raw | aplay -D hw:0,0 -c 2 -f S16_LE  -r 8000 -v

--------------------------------

Any memory related issue happening in the driver side for both camera capture and audio working time?

How to solve this issue?

Following things are the memory allocation in kernel drive(linux-3.0.35)

Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)

Memory: 256MB = 256MB total

Memory: 248016k/248016k available, 276272k reserved, 0K highmem

Virtual kernel memory layout:

    vector  : 0xffff0000 - 0xffff1000   (   4 kB)

    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)

    DMA     : 0xf4600000 - 0xffe00000   ( 184 MB)

    vmalloc : 0xa0800000 - 0xf2000000   (1304 MB)

    lowmem  : 0x80000000 - 0xa0000000   ( 512 MB)

    pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)

    modules : 0x7f000000 - 0x7fe00000   (  14 MB)

      .init : 0x80008000 - 0x80032000   ( 168 kB)

      .text : 0x80032000 - 0x808f6bf0   (8979 kB)

      .data : 0x808f8000 - 0x80947240   ( 317 kB)

Audio and camera clock settings:

Audio clock settings:

MX6DL_PAD_GPIO_0__CCM_CLKO,--->Audio MCLK clock

static int wm8960_clk_enable(int enable)

{

        if (enable)

                clk_enable(clko);

        else

                clk_disable(clko);

        printk(" %s HELLO old wm8960\n\n\n",__func__);

        return 0;

}

static int mxc_wm8960_init(void)

{

        int rate;

    printk(" %s HELLO old wm8960\n\n\n",__func__);

        clko = clk_get(NULL, "clko_clk");

        if (IS_ERR(clko)) {

                pr_err("can't get CLKO clock.\n");

                return PTR_ERR(clko);

        }

        /* both audio codec and comera use CLKO clk*/

        rate = clk_round_rate(clko, 24000000);

    rate = clk_round_rate(clko, 12000000);

        clk_set_rate(clko, rate);

        wm8960_data.sysclk = rate;

        printk(" %s End rate=%d\n\n\n",__func__,rate);

        return 0;

}

static int __init imx6q_init_audio(void)

{

                platform_device_register(&sabresd_vwm8960_reg_devices);

                mxc_register_device(&mx6_sabresd_audio_wm8960_device,

                                    &wm8960_data);

                imx6q_add_imx_ssi(1, &mx6_sabresd_ssi_pdata);

                mxc_wm8960_init();

                printk("HELLO old wm8960\n\n\n");

        return 0;

}

static struct mxc_audio_platform_data wm8960_data = {

        .ssi_num = 1,

        .src_port = 2,

        .ext_port = 3,

        .hp_active_low = 1,

        .mic_active_low = 1,

        .init = mxc_wm8960_init,

        .clock_enable = wm8960_clk_enable,

};

Camera clock settings:

MX6DL_PAD_GPIO_6__CCM_CCM_OUT_0 -->GPIO_6 CAmera clock

static struct imx_ipuv3_platform_data ipu_data[] = {

        {

        .rev = 4,

        .csi_clk[0] = "clko2_clk",

        .bypass_reset = false,

        },

#ifndef OV9712_CAM_CONFIG

#if 1

        {

        .rev = 4,

        .csi_clk[0] = "clko2_clk",

        .bypass_reset = false,

#endif

#endif

};

static struct fsl_mxc_capture_platform_data capture_data[] = {

        {

                .csi = 0,

                .ipu = 0,

                .mclk_source = 0,

                .is_mipi = 0,

        },

#if 1

        {

                .csi = 1,

                .ipu = 0,

                .mclk_source = 0,

                .is_mipi = 1,

        },

static struct mipi_csi2_platform_data mipi_csi2_pdata = {

        .ipu_id  = 0,

        .csi_id = 0,

        .csi_id = 1,

        .lanes = 2,

        .dphy_clk = "mipi_pllref_clk",

        .pixel_clk = "emi_clk",

};

--------- 

mx6_sabresd_board_init(void)()

{

        clko2 = clk_get(NULL, "clko2_clk");

        if (IS_ERR(clko2))

        {

                pr_err("can't get CLKO2 clock.\n");

        printk(" %s clko2  error  \n\n\n",__func__);

        }

        new_parent = clk_get(NULL, "osc_clk");

        if (!IS_ERR(new_parent)) {

                clk_set_parent(clko2, new_parent);

                clk_put(new_parent);

        printk(" %s clko2 parent  error  \n\n\n",__func__);

        }

        rate = clk_round_rate(clko2, 24000000);

        clk_set_rate(clko2, rate);

        clk_enable(clko2);

        printk(" %s 2 clko2 set  rate=%d\n\n\n",__func__,rate);

}

----------

          Please let me know whats happening inside the kernel while accessing the caera capture above QVGA resolution with audio,

Without camera capture audio playback and capture working properly,if once camera capture enabled that time audio is not working .

Audio using CLKO(GPIO_0) and video using the clk CLKO2(GPIO_6).

How to solve this simultaneous memory related issue in inx6 solo/dl processor.

Thanks by,

Venkat

0 Kudos

139 Views
venkatesh_pvsm
Contributor II

Ya thanks for your update,now simultaneous /loopback working based on the following changes in my driver sideIMX6 SSI master mode and min_channel=2 and max_channel=2 .

Thanks by,

Venkat

0 Kudos