This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to get keypad's value on dvsdk3.1' demos from kernel?

Other Parts Discussed in Thread: TVP5146

HI all

   I add the key scan in kernel. And after loaded, it will display through debug port.
mice: PS/2 mouse device common for all mice
input: davinci_keyscan as /devices/platform/davinci_keyscan.0/input/input0
input: DM365 EVM Controls as /devices/platform/i2c_davinci.1/i2c-1/1-0025/input/input1
i2c /dev entries driver.

  I want to add the keypad function on dvsdk3.1 demos's GUI.

  How can I to do, can anybody help me?

BR
    Terry K.G

  • Hello,

    I think some folks have modified demo to add these functionality and its kind of hard to tell in post on which line of demo you need to change to get everything going . Instead i would recommend you start working on standalone app which can be used to verify the key scan events and once everything works as per expectation then merge those changes in DVSDK demo. Look at ctrl.c file in demo - this file is used for receiving IR events and you can modify it according to your need.

    Thanks

    Brijesh

  • HI Brijesh ,

      I found that when enable "TI DaVinci Key Scan" in kernel. And I can use "cat /proc/kmsg" to check.Here was its log message when I press "play" and "stop" key.
    root@dm365-evm:/opt/dvsdk/dm365# cat /proc/kmsg
    <7>evbug.c: Event. Dev: input0, Type: 1, Code: 164, Value: 1
    <7>evbug.c: Event. Dev: input0, Type: 0, Code: 0, Value: 0
    <7>evbug.c: Event. Dev: input0, Type: 1, Code: 128, Value: 1
    <7>evbug.c: Event. Dev: input0, Type: 0, Code: 0, Value: 0

    By the way You can use my modify file to test the keypad too.
    7065.interface.rar

      But it will display "Failed to detect video standard" when execute "./encodedecode -y2". Here was its log message. I had run "./loadmodules.sh " and success.
    root@dm365-evm:/opt/dvsdk/dm365# ./encodedecode -y2
    Encodedecode demo started.
    davinci_v4l2 davinci_v4l2.1: Before finishing with S_FMT:
    layer.pix_fmt.bytesperline = 736,
     layer.pix_fmt.width = 720,
     layer.pix_fmt.height = 576,
     layer.pix_fmt.sizeimage =635904
    davinci_v4l2 davinci_v4l2.1: pixfmt->width = 720,
     layer->layer_info.config.line_length= 736
    EVM: switch to tvp5146 SD video input
    tvp514x 1-005d: Write: retry ... 0
    tvp514x 1-005d: Write: retry ... 1
    tvp514x 1-005d: Write: retry ... 2
    tvp514x 1-005d: Write: retry ... 3
    tvp514x 1-005d: Write: retry ... 4
    tvp514x 1-005d: Write: retry ... 5
    tvp514x 1-005d: Write failed. Err[-121]
    tvp514x 1-005d: Unable to turn on decoder
    tvp514x 1-005d: Write: retry ... 0
    tvp514x 1-005d: Write: retry ... 1
    tvp514x 1-005d: Write: retry ... 2
    tvp514x 1-005d: Write: retry ... 3
    tvp514x 1-005d: Write: retry ... 4
    tvp514x 1-005d: Write: retry ... 5
    Error: Failed to detect video standard, video input connected?
    Error: Failed to create video decoder: mpeg4dec

    And only when I disable "TI DaVinci Key Scan" in kernel, rebuild the kernel, and all hardware was the same as before.
    After running "./loadmodules.sh "  and OK. Then run "./encodedecode -y2".  It will display the view on TV. Here was its log message.
    root@dm365-evm:/opt/dvsdk/dm365# ./encodedecode -y2
    Encodedecode demo started.
    davinci_v4l2 davinci_v4l2.1: Before finishing with S_FMT:
    layer.pix_fmt.bytesperline = 736,
     layer.pix_fmt.width = 720,
     layer.pix_fmt.height = 576,
     layer.pix_fmt.sizeimage =635904
    davinci_v4l2 davinci_v4l2.1: pixfmt->width = 720,
     layer->layer_info.config.line_length= 736
    EVM: switch to tvp5146 SD video input
    tvp514x 1-005d: tvp5146 (Version - 0x03) found at 0xba (DaVinci I2C adapter)
    davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124
    davinci_previewer davinci_previewer.2: ipipe_set_preview_config
    vpfe-capture vpfe-capture: IPIPE Chained
    vpfe-capture vpfe-capture: Resizer present
    EVM: switch to tvp5146 SD video input
    vpfe-capture vpfe-capture: width = 720, height = 576, bpp = 1
    vpfe-capture vpfe-capture: adjusted width = 720, height = 576, bpp = 1, bytesperline = 736, sizeimage = 635904
    vpfe-capture vpfe-capture: width = 720, height = 576, bpp = 1
    vpfe-capture vpfe-capture: adjusted width = 720, height = 576, bpp = 1, bytesperline = 736, sizeimage = 635904
    Process one buffer to figure out buffer requirements
    Prime the display thread
    ARM Load: 20% Video fps: 20 fps Video bit rate: 833 kbps Time: 00:00:01 Demo: Encode Decode Display: D1 PAL Video Codec: MPEG4 SP Video Resolution: 720x576

    ARM Load: 19% Video fps: 25 fps Video bit rate: 871 kbps Time: 00:00:02 Demo: Encode Decode Display: D1 PAL Video Codec: MPEG4 SP Video Resolution: 720x576

    ARM Load: 7% Video fps: 25 fps Video bit rate: 860 kbps Time: 00:00:03 Demo: Encode Decode Display: D1 PAL Video Codec: MPEG4 SP Video Resolution: 720x576

    But I can't get any key message now for disable "TI DaVinci Key Scan.

    BR
         Terry K.G

  • Okay, so i guess enabling "TI Davinci Key Scan" in kernel has some conflict with either capture or display drivers. Can you please try running PSP Linux driver video loopback example to isolate whether its driver bug vs demo issue. The PSP example applications are installed in DVSDK/psp/linux-driver-example-xxxx directory.

    I assume you are using DVSDK 4.01.

    Thanks

    Brijesh

  • HI Brijesh

     [I assume you are using DVSDK 4.01.] In fact, I just used DVSDK3.1.

    BR
        Terry K.G

  • HI Brijesh

     I am using DVSDK3.1 now. I didn't find [DVSDK/psp/linux-driver-example-xxxx directory]. Can you give us some idea for DVSDK3.1.
     Thank you.

    BR
         Terry K.G

  • Hi Terry,

     

    I'm using DVSDK3.1, too.

    First I had the same problem you mentioned above, that I just could use keyscan, or encode-/decode-demo, but not at the same time.

    I tried to make keyscan as module for later insmod'ing it, that worked for me fine.

    Now I can use both at the same time.

    Hope this helps you.

     

    @ all:

    But I got another question:

    I'm trying to start Encode-/Decode-Demo out of the interrupt handler of keyscan-module.

    But I don't know how to start an application out of a module (or out of the interrupt handler),

    as I'm absolutely new to Linux-programming.

    I hope someone could give me any hints, to solve this problem.

     

    Best regards,

    Simon

  • HI Simon and all,

      I am trying a way, very nearly like yours. It will waste many DSP's loading to start one module again and again.
      It's normal to enable and disable the keyscan interrupt maybe.

     When one frame start from sersor, I will disable keyscan interrupt.
     When one frame end  from sersor, I will  enable keyscan interrupt.

    I am now learning the code, and try to know where can add these two control in the sensor codes.

    BR
        Terry K.G