AT91SAM9M10 video decoder with Gstreamer

Moderator: nferre

Chalo
Posts: 10
Joined: Mon Sep 28, 2015 4:41 pm

AT91SAM9M10 video decoder with Gstreamer

Mon Sep 28, 2015 4:56 pm

Hello. I am working with the SAM9M10. I want to reproduce an AVI file using the Hantro hardware decoder with Gstreamer.

I compile the hx170dec and memalloc modules for the Linux 2.6.38 and loaded them with insmod. This is the output when they are loaded:

memalloc: clenup called
memalloc: memalloc: Freeing all memory
memalloc: memalloc: module removed
memalloc: 8190 Linear Memory Allocator, $Revision: 1.1 $
memalloc: linear memory base = 0x74000000
memalloc: allocation method: MEMALLOC_BASIC
memalloc: 117727232 bytes (112MB) configured. Check RAM size!
hx170dec: module init
hx170dec: dec/pp kernel module. $Revision: 1.9 $
hx170dec: supports 8170 and 8190 hardware
hx170dec: base_port=0x00900000 irq=30
hx170dec: HW ID=0x81701250
hx170dec: Compatible HW found at 0x00900000
hx170dec: module inserted. Major = 247

Then when I try to execute the gst-launch with the x170 plug-in whit the following line:

gst-launch-0.10 --gst-debug-level=3 filesrc location=/home/root/1.avi ! avidemux name=dem dem.video_00 ! x170 output=RGB16 output-width=320 output-height=240 ! fbdevsink

I get the following error log:

0:00:00.076311409 6148 0x18050 INFO GST_INIT gstquery.c:107:_gst_query_initialize: init queries
0:00:00.103773186 6148 0x18050 INFO GST_INIT gstmessage.c:73:_gst_message_initialize: init messages
0:00:00.108802629 6148 0x18050 INFO GST_PLUGIN_LOADING gstplugin.c:350:_gst_plugin_initialize: registering 0 static plugins
0:00:00.117926475 6148 0x18050 INFO GST_PLUGIN_LOADING gstplugin.c:255:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.118324875 6148 0x18050 INFO GST_PLUGIN_LOADING gstplugin.c:257:gst_plugin_register_static: added static plugin "staticelements", result: 1
0:00:00.127282641 6148 0x18050 INFO GST_REGISTRY gstregistry.c:1648:ensure_current_registry: reading registry cache: /home/root/.gstreamer-0.10/registry.arm.bin
0:00:00.545193948 6148 0x18050 INFO GST_REGISTRY gstregistrybinary.c:614:gst_registry_binary_read_cache: loaded /home/root/.gstreamer-0.10/registry.arm.bin in 0.417419 seconds
0:00:00.546366109 6148 0x18050 INFO GST_REGISTRY gstregistry.c:1518:scan_and_update_registry: Validating plugins from registry cache: /home/root/.gstreamer-0.10/registry.arm.bin
0:00:00.549831711 6148 0x18050 INFO GST_REGISTRY gstregistry.c:1610:scan_and_update_registry: Registry cache has not changed
0:00:00.550118751 6148 0x18050 INFO GST_REGISTRY gstregistry.c:1683:ensure_current_registry: registry reading and updating done, result = 1
0:00:00.550315551 6148 0x18050 INFO GST_INIT gst.c:805:init_post: GLib runtime version: 2.30.3
0:00:00.550496031 6148 0x18050 INFO GST_INIT gst.c:807:init_post: GLib headers version: 2.30.3
0:00:00.558228837 6148 0x18050 INFO GST_PIPELINE gstparse.c:334:gst_parse_launch_full: parsing pipeline description 'filesrc location=/mmc/bin/1.avi ! avidemux name=dem dem.video_00 ! x170 output=RGB16 output-width=320 output-height=240 ! fbdevsink '
0:00:00.578464690 6148 0x18050 INFO GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstcoreelements.so" loaded
0:00:00.578818930 6148 0x18050 INFO GST_ELEMENT_FACTORY gstelementfactory.c:376:gst_element_factory_create: creating element "filesrc"
0:00:00.585123254 6148 0x18050 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<GstBaseSrc@0xd2038> adding pad 'src'
0:00:00.586166774 6148 0x18050 INFO filesrc gstfilesrc.c:374:gst_file_src_set_location: filename : /mmc/bin/1.avi
0:00:00.586423095 6148 0x18050 INFO filesrc gstfilesrc.c:375:gst_file_src_set_location: uri : file:///mmc/bin/1.avi
0:00:00.625237840 6148 0x18050 INFO GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstavi.so" loaded
0:00:00.625586320 6148 0x18050 INFO GST_ELEMENT_FACTORY gstelementfactory.c:376:gst_element_factory_create: creating element "avidemux"
0:00:00.665401386 6148 0x18050 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<GstAviDemux@0xe0210> adding pad 'sink'
0:00:00.710354374 6148 0x18050 INFO GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstx170.so" loaded
0:00:00.715448138 6148 0x18050 INFO GST_ELEMENT_FACTORY gstelementfactory.c:376:gst_element_factory_create: creating element "x170"
0:00:00.727127505 6148 0x18050 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<Gstx170@0xe6000> adding pad 'sink'
0:00:00.728827666 6148 0x18050 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<Gstx170@0xe6000> adding pad 'src'
0:00:00.738931672 6148 0x18050 INFO GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstfbdevsink.so" loaded
0:00:00.739254232 6148 0x18050 INFO GST_ELEMENT_FACTORY gstelementfactory.c:376:gst_element_factory_create: creating element "fbdevsink"
0:00:00.748210078 6148 0x18050 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<GstBaseSink@0xead98> adding pad 'sink'
0:00:00.749236318 6148 0x18050 INFO GST_ELEMENT_FACTORY gstelementfactory.c:376:gst_element_factory_create: creating element "pipeline"
0:00:00.758146085 6148 0x18050 INFO GST_PIPELINE ./grammar.y:568:gst_parse_perform_link: linking filesrc0:(any) to dem:(any) (0/0) with caps "(NULL)"
0:00:00.760347366 6148 0x18050 INFO GST_ELEMENT_PADS gstutils.c:1698:gst_element_link_pads_full: trying to link element filesrc0:(any) to element dem:(any)
0:00:00.762873129 6148 0x18050 INFO GST_PADS gstutils.c:1032:gst_pad_check_link: trying to link filesrc0:src and dem:sink
0:00:00.764236329 6148 0x18050 INFO GST_PADS gstutils.c:1596:prepare_link_maybe_ghosting: filesrc0 and dem in same bin, no need for ghost pads
0:00:00.764975530 6148 0x18050 INFO GST_PADS gstpad.c:1978:gst_pad_link_prepare: trying to link filesrc0:src and dem:sink
0:00:00.765335530 6148 0x18050 INFO GST_PADS gstpad.c:2161:gst_pad_link_full: linked filesrc0:src and dem:sink, successful
0:00:00.766030570 6148 0x18050 INFO GST_PARENTAGE gstbin.c:3762:gst_bin_get_by_name: [pipeline0]: looking up child element dem
0:00:00.766470251 6148 0x18050 INFO GST_PIPELINE ./grammar.y:568:gst_parse_perform_link: linking dem:dem to x1700:(any) (1/0) with caps "(NULL)"
0:00:00.766809131 6148 0x18050 INFO GST_ELEMENT_PADS gstutils.c:1698:gst_element_link_pads_full: trying to link element dem:video_00 to element x1700:(any)
0:00:00.767055851 6148 0x18050 INFO GST_ELEMENT_PADS gstelement.c:972:gst_element_get_static_pad: no such pad 'video_00' in element "dem"
0:00:00.767290091 6148 0x18050 INFO default gstutils.c:2037:gst_element_link_pads_filtered: Could not link pads: dem:video_00 - x1700:(null)
0:00:00.767750892 6148 0x18050 INFO GST_PIPELINE ./grammar.y:568:gst_parse_perform_link: linking x1700:(any) to fbdevsink0:(any) (0/0) with caps "(NULL)"
0:00:00.768084012 6148 0x18050 INFO GST_ELEMENT_PADS gstutils.c:1698:gst_element_link_pads_full: trying to link element x1700:(any) to element fbdevsink0:(any)
0:00:00.768381612 6148 0x18050 INFO GST_PADS gstutils.c:1032:gst_pad_check_link: trying to link x1700:src and fbdevsink0:sink
0:00:00.780062900 6148 0x18050 INFO GST_PADS gstutils.c:1596:prepare_link_maybe_ghosting: x1700 and fbdevsink0 in same bin, no need for ghost pads
0:00:00.782929461 6148 0x18050 INFO GST_PADS gstpad.c:1978:gst_pad_link_prepare: trying to link x1700:src and fbdevsink0:sink
0:00:00.787023864 6148 0x18050 INFO GST_PADS gstpad.c:2161:gst_pad_link_full: linked x1700:src and fbdevsink0:sink, successful
Setting pipeline to PAUSED ...
0:00:00.799510591 6148 0x18050 INFO GST_STATES gstelement.c:2460:gst_element_continue_state:<fbdevsink0> completed state change to READY
0:00:00.799859071 6148 0x18050 INFO GST_STATES gstelement.c:2365:_priv_gst_element_state_changed:<fbdevsink0> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.803500354 6148 0x18050 INFO GST_STATES gstbin.c:2526:gst_bin_change_state_func:<pipeline0> child 'fbdevsink0' changed state to 2(READY) successfully
0:00:00.805320515 6148 0x18050 INFO GST_STATES gstelement.c:2768:gst_element_change_state:<x1700> have FAILURE change_state return
0:00:00.805684355 6148 0x18050 INFO GST_STATES gstelement.c:2335:gst_element_abort_state:<x1700> aborting state from NULL to READY
0:00:00.805954115 6148 0x18050 INFO GST_STATES gstbin.c:2542:gst_bin_change_state_func:<pipeline0> child 'x1700' failed to go to state 2(READY)
0:00:00.806300675 6148 0x18050 INFO GST_STATES gstelement.c:2768:gst_element_change_state:<pipeline0> have FAILURE change_state return
0:00:00.806560836 6148 0x18050 INFO GST_STATES gstelement.c:2335:gst_element_abort_state:<pipeline0> aborting state from NULL to PAUSED
ERROR: Pipeline doesn't want to pause.
Setting pipeline to NULL ...
0:00:00.818448523 6148 0x18050 INFO GST_STATES gstelement.c:2460:gst_element_continue_state:<fbdevsink0> completed state change to NULL
0:00:00.818858443 6148 0x18050 INFO GST_STATES gstelement.c:2365:_priv_gst_element_state_changed:<fbdevsink0> notifying about state-changed READY to NULL (VOID_PENDING pending)
0:00:00.819337483 6148 0x18050 INFO GST_STATES gstbin.c:2526:gst_bin_change_state_func:<pipeline0> child 'fbdevsink0' changed state to 1(NULL) successfully
0:00:00.819702284 6148 0x18050 INFO GST_STATES gstelement.c:2460:gst_element_continue_state:<x1700> completed state change to NULL
0:00:00.820014284 6148 0x18050 INFO GST_STATES gstbin.c:2526:gst_bin_change_state_func:<pipeline0> child 'x1700' changed state to 1(NULL) successfully
0:00:00.820380044 6148 0x18050 INFO GST_STATES gstbin.c:2237:gst_bin_element_set_state:<dem> skipping transition from NULL to NULL, since bin pending is NULL : last change state return follows
0:00:00.823013326 6148 0x18050 INFO GST_STATES gstbin.c:2526:gst_bin_change_state_func:<pipeline0> child 'dem' changed state to 1(NULL) successfully
0:00:00.823550926 6148 0x18050 INFO GST_STATES gstbin.c:2237:gst_bin_element_set_state:<filesrc0> skipping transition from NULL to NULL, since bin pending is NULL : last change state return follows
0:00:00.823849486 6148 0x18050 INFO GST_STATES gstbin.c:2526:gst_bin_change_state_func:<pipeline0> child 'filesrc0' changed state to 1(NULL) successfully
0:00:00.824164366 6148 0x18050 INFO GST_STATES gstelement.c:2460:gst_element_continue_state:<pipeline0> completed state change to NULL
0:00:00.824458127 6148 0x18050 INFO GST_STATES gstbin.c:1784:gst_bin_get_state_func:<pipeline0> getting state
Freeing pipeline ...
0:00:00.825079247 6148 0x18050 INFO GST_ELEMENT_PADS gstpad.c:1750:gst_pad_unlink: unlinking x1700:src(0xd1258) and fbdevsink0:sink(0xd1320)
0:00:00.825686927 6148 0x18050 INFO GST_ELEMENT_PADS gstpad.c:1795:gst_pad_unlink: unlinked x1700:src and fbdevsink0:sink
0:00:00.826363728 6148 0x18050 INFO GST_PARENTAGE gstbin.c:1465:gst_bin_remove_func:<pipeline0> removed child "fbdevsink0"
0:00:00.826866768 6148 0x18050 INFO GST_PARENTAGE gstbin.c:1465:gst_bin_remove_func:<pipeline0> removed child "x1700"
0:00:00.827309328 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3064:gst_element_dispose:<x1700> dispose
0:00:00.827575249 6148 0x18050 INFO GST_ELEMENT_PADS gstelement.c:847:gst_element_remove_pad:<x1700> removing pad 'src'
0:00:00.828311569 6148 0x18050 INFO GST_ELEMENT_PADS gstelement.c:847:gst_element_remove_pad:<x1700> removing pad 'sink'
0:00:00.828924049 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3088:gst_element_dispose:<x1700> parent class dispose
0:00:00.829253330 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3119:gst_element_finalize:<x1700> finalize
0:00:00.829495250 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3130:gst_element_finalize:<x1700> finalize parent
0:00:00.829789970 6148 0x18050 INFO GST_ELEMENT_PADS gstpad.c:1750:gst_pad_unlink: unlinking filesrc0:src(0xd1000) and dem:sink(0xd10c8)
0:00:00.830329490 6148 0x18050 INFO GST_ELEMENT_PADS gstpad.c:1795:gst_pad_unlink: unlinked filesrc0:src and dem:sink
0:00:00.838471256 6148 0x18050 INFO GST_PARENTAGE gstbin.c:1465:gst_bin_remove_func:<pipeline0> removed child "dem"
0:00:00.838933016 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3064:gst_element_dispose:<dem> dispose
0:00:00.839217177 6148 0x18050 INFO GST_ELEMENT_PADS gstelement.c:847:gst_element_remove_pad:<dem> removing pad 'sink'
0:00:00.839656857 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3088:gst_element_dispose:<dem> parent class dispose
0:00:00.840068697 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3119:gst_element_finalize:<dem> finalize
0:00:00.840351897 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3130:gst_element_finalize:<dem> finalize parent
0:00:00.842983260 6148 0x18050 INFO GST_PARENTAGE gstbin.c:1465:gst_bin_remove_func:<pipeline0> removed child "filesrc0"
0:00:00.845007901 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3064:gst_element_dispose:<filesrc0> dispose
0:00:00.845313181 6148 0x18050 INFO GST_ELEMENT_PADS gstelement.c:847:gst_element_remove_pad:<filesrc0> removing pad 'src'
0:00:00.845690461 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3088:gst_element_dispose:<filesrc0> parent class dispose
0:00:00.845990942 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3119:gst_element_finalize:<filesrc0> finalize
0:00:00.846258782 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3130:gst_element_finalize:<filesrc0> finalize parent
0:00:00.846534302 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3064:gst_element_dispose:<pipeline0> dispose
0:00:00.846804062 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3064:gst_element_dispose:<fbdevsink0> dispose
0:00:00.847041182 6148 0x18050 INFO GST_ELEMENT_PADS gstelement.c:847:gst_element_remove_pad:<fbdevsink0> removing pad 'sink'
0:00:00.847391582 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3088:gst_element_dispose:<fbdevsink0> parent class dispose
0:00:00.847754463 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3119:gst_element_finalize:<fbdevsink0> finalize
0:00:00.848038623 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3130:gst_element_finalize:<fbdevsink0> finalize parent
0:00:00.848413023 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3088:gst_element_dispose:<pipeline0> parent class dispose
0:00:00.848696223 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3119:gst_element_finalize:<pipeline0> finalize
0:00:00.848957343 6148 0x18050 INFO GST_REFCOUNTING gstelement.c:3130:gst_element_finalize:<pipeline0> finalize parent
0:00:00.849229983 6148 0x18050 INFO GST_INIT gst.c:1023:gst_deinit: deinitializing GStreamer
0:00:00.912410504 6148 0x18050 INFO GST_INIT gst.c:1129:gst_deinit: deinitialized GStreamer

Don't know what Im doing wrong.

Thanks
blue_z
Location: USA
Posts: 1960
Joined: Thu Apr 19, 2007 10:15 pm

Re: AT91SAM9M10 video decoder with Gstreamer

Mon Sep 28, 2015 7:57 pm

Chalo
Posts: 10
Joined: Mon Sep 28, 2015 4:41 pm

Re: AT91SAM9M10 video decoder with Gstreamer

Mon Sep 28, 2015 10:23 pm

I did. But that post solution was to use the atmel-vdec driver with the Linux 3.10.

I need to make this work with Linux 2.6.38.

Does the atmel-vdec driver works with Linux 2.6.38 anyway? Or I have to use the old modules?
In the last case, the one I try, is where I got the problem.
blue_z
Location: USA
Posts: 1960
Joined: Thu Apr 19, 2007 10:15 pm

Re: AT91SAM9M10 video decoder with Gstreamer

Tue Sep 29, 2015 1:31 am

Chalo wrote:I did. But that post solution was to use the atmel-vdec driver with the Linux 3.10.
But did you study the entire thread?
There are a few debugging ideas, such as sanity testing with a software decoder and using an Atmel video clip.
Chalo wrote:I need to make this work with Linux 2.6.38.
What versions are you using?
Where did you get the source code that you're using?
The Atmel version of the Hantro decoder in the legacy experimental patch is intended for mainline Linux 2.6.30 with the maxim.org AT91 patch file.
There are no assurances that kernel modules can be ported to another kernel version without requiring changes.

Regards
Chalo
Posts: 10
Joined: Mon Sep 28, 2015 4:41 pm

Re: AT91SAM9M10 video decoder with Gstreamer

Tue Sep 29, 2015 3:48 pm

Yes. The software decoder works but the CPU goes to 70%.

Taking into account that I have no assurances that the kernel modules will work. In the case they do, what are the steps to make them work?

The patches creates the hx170dec and memalloc modules and compile the kernel with them. Then configure the video clock in the device.
Are there any other steps the patchs make?

Regards
blue_z
Location: USA
Posts: 1960
Joined: Thu Apr 19, 2007 10:15 pm

Re: AT91SAM9M10 video decoder with Gstreamer

Wed Sep 30, 2015 9:28 pm

Chalo wrote:The patches creates the hx170dec and memalloc modules...
One more time...
What patches?
What kernel?
From where?
If you don't want to provide salient responses, and want to use an oddball kernel version, then it's up to you to provide your own support (or buy it).

Regards
Chalo
Posts: 10
Joined: Mon Sep 28, 2015 4:41 pm

Re: AT91SAM9M10 video decoder with Gstreamer

Thu Oct 01, 2015 3:39 pm

I use the 2.6.30-at91-exp.4.patch patches for the memalloc and hx170dec but changing the ioctl format functions to compile with the Linux 2.6.38.

-static int memalloc_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
+static long memalloc_ioctl(struct file *filp,
unsigned int cmd, unsigned long arg)

-static int hx170dec_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
+static long hx170dec_ioctl(struct file *filp,
unsigned int cmd, unsigned long arg)

The Linux is the 2.6.38 as I said. But I don't know from where. I just have the source when I start to work. Thats the reason I can't use a new tarrball.

How much for the support? lol

Regards

Return to “SAM9-based”

Who is online

Users browsing this forum: No registered users and 4 guests