AnsweredAssumed Answered

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

Question asked by Venkatesh P on Jul 31, 2014
Latest reply on Aug 6, 2014 by igorpadykov

Hi ,

    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



Outcomes