Amlogic Video Capture support

Post Reply
xonestonex
Posts: 8
Joined: Tue Mar 29, 2016 5:27 am
languages_spoken: english, german
ODROIDs: ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Amlogic Video Capture support

Post by xonestonex »

Hi,

please enable the "Amlogic Video Capture support" (AM_VIDEOCAPTURE) by default.
The video capture driver allows access to decoded video frames. Hyperion can use it to create Ambilight effects of the running video.
The driver needs to allocate memory for a whole frame, but its more than the kernel allows in its default configuration.
To make the driver work the FORCE_MAX_ZONEORDER parameter in arch/arm64/Kconfig needs to be changed from "11" to "13".

Together with this small change in Hyperion, the driver works perfect:

Code: Select all

--- a/libsrc/grabber/amlogic/AmlogicGrabber.cpp
+++ b/libsrc/grabber/amlogic/AmlogicGrabber.cpp
@@ -22,7 +22,7 @@
 
 // Flags copied from 'include/linux/amlogic/amports/amvstream.h' at https://github.com/codesnake/linux-amlogic
 #define AMSTREAM_IOC_MAGIC   'S'
-#define AMSTREAM_IOC_GET_VIDEO_DISABLE      _IOR(AMSTREAM_IOC_MAGIC,   0x48, unsigned long)
+#define AMSTREAM_IOC_GET_VIDEO_DISABLE      _IOR(AMSTREAM_IOC_MAGIC,   0x48, int)
 
 AmlogicGrabber::AmlogicGrabber(const unsigned width, const unsigned height) :
        // Minimum required width or height is 160

crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

Ideally, we should find another method of doing the capture such as using GE2D directly. The issue is that the capture driver forces a V4L dependency in the kernel. This makes it impossible to use USB TV tuners from the linuxtv media backport tree.
http://forum.odroid.com/viewtopic.php?f=136&t=20302

Another benefit of using GE2D directly would be reduced memory space and bandwidth requirements. GE2D can scale, colorspace convert, and blit directly from the video layer to a reduced sample buffer. For ambilight, a full 4K image is not required; neither is the overhead of the Video4Linux API and subsystem.

xonestonex
Posts: 8
Joined: Tue Mar 29, 2016 5:27 am
languages_spoken: english, german
ODROIDs: ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by xonestonex »

I think you're wrong. I can enable AM_VIDEOCAPTURE and disable V4L_AMLOGIC_VIDEO or set it to module.

crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

xonestonex wrote:I think you're wrong.
You are correct. I was mistaken that you were referring to this driver:
https://github.com/hardkernel/linux/blo ... videocap.c
while I thought you meant this one:
https://github.com/hardkernel/linux/blo ... amlvideo.c

The first driver does not depend on V4L. The second one does.

User avatar
odroid
Site Admin
Posts: 38328
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2121 times
Been thanked: 1263 times
Contact:

Re: Amlogic Video Capture support

Post by odroid »

Thank you for the suggestion. We will check your patch.

BTW, should we update this instruction once we set V4L_AMLOGIC_VIDEO to module?
http://forum.odroid.com/viewtopic.php?f=136&t=19433
Or is the driver module loaded automatically thanks to the DT?

redPanther
Posts: 15
Joined: Mon Aug 21, 2017 1:52 am
languages_spoken: english
ODROIDs: Odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by redPanther »

Hi,
I'm the main developer of hyperion. I now have an odroid c2 and want to polish the amlogic support. currently I'm not able to read from /dev/amcideocap0 (resource temporarily not availabe), so I'm very interessted in getting this stuff working

You wrote using GE2D directly, sounds nice - can you give me a hint what to do/where to start? Does this method work with mainline ubuntu kernel or did I have to recompile it?

greets, redpanther

crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

I enabled amvideocap here:
https://github.com/OtherCrashOverride/l ... mvideocap2

I found that there is an issue where the work queue freezes for unknown reasons. The freeze is less likely to happen with slower capture rates (10fps). So, I started implementing a kernel driver API extension to allow direct access (and GE2D use) here:
https://github.com/OtherCrashOverride/l ... c2-amvideo
An example of using this API is here:
https://github.com/OtherCrashOverride/c ... #L271-L367
In the above, the current video frame is captured, color converted, and scaled using GE2D entirely in user space.

I am uncertain what the current status of amvideocap is. I believe LibreELEC currently uses it.

Having been in the exact situation of wanting to use hyperion, I can say there are three choices:
1) Enable amvideocap and tweak settings to minimize amvideocap freezing.
2) Find the issue causing the freezing in amvideocap and fix it.
3) Integrate a new API into the kernel drivers.

For me, the option #3 suits my needs best. If there is anything I can do to assist, let me know. I share the goal of wanting first class Hyperion support on C2.

[edit]
See also Odroid Magazine Ambilight article, page 23:
https://magazine.odroid.com/wp-content/ ... 201611.pdf

redPanther
Posts: 15
Joined: Mon Aug 21, 2017 1:52 am
languages_spoken: english
ODROIDs: Odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by redPanther »

I read the ambi light article before. It was a good hint to recompile kernel to get amvideocap0. I also found some kernel patch that introduces some locks in amvideocap driver. None of this worked out. Nevertheless the Situation is quite bad. Capturing should be working without additional kernel and config voodoo.
Is your new api stable enough? Are there any chances that your code will be accepted and integrated into mainline aml kernel? In the end it should be easy for users to use video capturing ....

I will look into your new api.
Thanks so far :-)

redPanther
Posts: 15
Joined: Mon Aug 21, 2017 1:52 am
languages_spoken: english
ODROIDs: Odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by redPanther »

I'm now running my kernel with your changes. Can you strip down your example code for just grabbing? Just a bare minimum app ...
This would speed up the thing a bit :-)

crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

C2, like every other low cost ARM board, requires a vendor kernel to utilize all the hardware such as codecs. The plans for mainline, as I understand them, are to transition to a V4L API (currently Amlogic provides its own solution). In that case, the kernel patches would not be required since V4L would offer the same functionality of directly accessing the buffers (dma_buf).

The API patch is an interim solution to the issue. There has been no definitive time frame given for V4L codec integration or mainline support that I know of.

crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

redPanther wrote:Can you strip down your example code for just grabbing?
Without "extra stuff" I would have no way of verifying operation. So here is some annotations instead:

The API extensions are defined here for userspace to use:
https://github.com/OtherCrashOverride/c ... pp#L24-L31

Code: Select all

#define AMVIDEO_MAGIC  'X'

#define AMVIDEO_EXT_GET_CURRENT_VIDEOFRAME _IOR((AMVIDEO_MAGIC), 0x01, int32_t)
#define AMVIDEO_EXT_PUT_CURRENT_VIDEOFRAME _IO((AMVIDEO_MAGIC), 0x02)

#define AMVIDEO_EXT_CURRENT_VIDEOFRAME_GET_GE2D_FORMAT _IOR((AMVIDEO_MAGIC), 0x03, uint32_t)
#define AMVIDEO_EXT_CURRENT_VIDEOFRAME_GET_SIZE _IOR((AMVIDEO_MAGIC), 0x04, uint64_t)
#define AMVIDEO_EXT_CURRENT_VIDEOFRAME_GET_CANVAS0ADDR _IOR((AMVIDEO_MAGIC), 0x05, uint32_t)
The following line performs the "capture":
https://github.com/OtherCrashOverride/c ... n.cpp#L273

Code: Select all

io = ioctl(amvideo_fd, AMVIDEO_EXT_GET_CURRENT_VIDEOFRAME, &canvas_index);
With the frame captured, we get the canvas address, the color format (NV12), and the buffer size (a canvas is an Amlogic concept):
https://github.com/OtherCrashOverride/c ... #L284-L309

Code: Select all

					uint32_t canvas0addr;
					io = ioctl(amvideo_fd, AMVIDEO_EXT_CURRENT_VIDEOFRAME_GET_CANVAS0ADDR, &canvas0addr);
					if (io < 0)
					{
						throw Exception("AMSTREAM_EXT_CURRENT_VIDEOFRAME_GET_CANVAS0ADDR failed.");
					}

					//printf("amvideo: canvas0addr=%x\n", canvas0addr);

					uint32_t ge2dformat;
					io = ioctl(amvideo_fd, AMVIDEO_EXT_CURRENT_VIDEOFRAME_GET_GE2D_FORMAT, &ge2dformat);
					if (io < 0)
					{
						throw Exception("AMSTREAM_EXT_CURRENT_VIDEOFRAME_GET_GE2D_FORMAT failed.");
					}

					//printf("amvideo: ge2dformat=%x\n", ge2dformat);

					uint64_t size;
					io = ioctl(amvideo_fd, AMVIDEO_EXT_CURRENT_VIDEOFRAME_GET_SIZE, &size);
					if (io < 0)
					{
						throw Exception("AMSTREAM_EXT_CURRENT_VIDEOFRAME_GET_SIZE failed.");
					}
Then we inform GE2D of the canvas information:
https://github.com/OtherCrashOverride/c ... #L372-L402

Code: Select all

					configex.src_para.mem_type = CANVAS_TYPE_INVALID;
					configex.src_para.canvas_index = canvas0addr;
					configex.src_para.left = 0;
					configex.src_para.top = 0;
					configex.src_para.width = videoWidth;
					configex.src_para.height = videoHeight / 2;
					configex.src_para.format = ge2dformat;
					


					configex.dst_para.mem_type = CANVAS_ALLOC;
					configex.dst_para.format = GE2D_FORMAT_S16_RGB_565;
					configex.dst_para.left = 0;
					configex.dst_para.top = 0;

					configex.dst_para.width = fb0.Width();
					configex.dst_para.height = fb0.Height();
					configex.dst_planes[0].addr = (long unsigned int)videoBuffer.PhysicalAddress();
					configex.dst_planes[0].w = configex.dst_para.width;
					configex.dst_planes[0].h = configex.dst_para.height;


					io = ioctl(ge2d_fd, GE2D_CONFIG_EX, &configex);
					if (io < 0)
					{
						throw Exception("video GE2D_CONFIG_EX failed.\n");
					}
Then we define source and destination rectangles on the above surfaces:
https://github.com/OtherCrashOverride/c ... #L410-L430

Code: Select all

					blitRect.src1_rect.x = 0;
					blitRect.src1_rect.y = 0;
					blitRect.src1_rect.w = configex.src_para.width;
					blitRect.src1_rect.h = configex.src_para.height;


					blitRect.dst_rect.x = videoRect.X;
					blitRect.dst_rect.y = videoRect.Y;
					blitRect.dst_rect.w = videoRect.Width;
					blitRect.dst_rect.h = videoRect.Height;


					//printf("rect=%d,%d %dx%d\n", videoRect.X, videoRect.Y, videoRect.Width, videoRect.Height);

					// Blit to videoBuffer
					io = ioctl(ge2d_fd, GE2D_STRETCHBLIT_NOALPHA, &blitRect);
					if (io < 0)
					{
						throw Exception("GE2D_STRETCHBLIT_NOALPHA failed.");
					}
When done with the capture, we return it to the driver:
https://github.com/OtherCrashOverride/c ... n.cpp#L434

Code: Select all

					io = ioctl(amvideo_fd, AMVIDEO_EXT_PUT_CURRENT_VIDEOFRAME);
Since GE2D can only use CMA memory, the blit destination need to be obtained from the ION driver. This is illustrated in a different project:
https://github.com/OtherCrashOverride/c ... #L333-L408
The physical address is what is passed to GE2D as the destination.

redPanther
Posts: 15
Joined: Mon Aug 21, 2017 1:52 am
languages_spoken: english
ODROIDs: Odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by redPanther »

Thx.for the input. My plan is to integrate both methods, Amvideocap and ge2d. I will add a detection which driver to use.

This implemention would be only an intermediate as long as aml implements the v4l interface.

My work is done in hyperion.ng repository. This is then next big version of hyperion. Development in hyperion repo has stopped for a while to focus the power to the new version.

redPanther
Posts: 15
Joined: Mon Aug 21, 2017 1:52 am
languages_spoken: english
ODROIDs: Odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by redPanther »

can I change the output color format:
configex.dst_para.format = GE2D_FORMAT_S16_RGB_565;
to GE2D_FORMAT_S24_BGR?

crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

You can change the color format to any supported by GE2D as shown in the header:
https://github.com/OtherCrashOverride/c ... #L189-L274

Be aware that there are alignment requirements. You may need a larger stride to meet them. For example a 1x1 RGB24 format would likely need a stride of 4 pixels to align it on a 32bit boundary. If you experience image corruption, it is likely due to alignment.

I should also note that you can logical "OR" the color formats with GE2D_LITTLE_ENDIAN if needed:
https://github.com/OtherCrashOverride/c ... e2d.h#L120

redPanther
Posts: 15
Joined: Mon Aug 21, 2017 1:52 am
languages_spoken: english
ODROIDs: Odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by redPanther »

I'm in the middle of implementing, but if you want to take a look:

https://github.com/redPanther/hyperion.ng/tree/aml

compile hints:
https://github.com/redPanther/hyperion. ... leHowto.md

running:
when compiled and you are in build folder just call bin/hyperiond --debug
the config file will be written to ~/.hyperion.config.json

currently it crash when you play accelerated video, thats why start kodi in menu mode first. when launching video the debug messages regarding ge2d capture appear ...

if you want to make mods to config just call the web ui http://<your odroid>:8099
there is a led preview (in the top bar the "monitor" button.) - no need for real leds :-)

The current situation is that it looks like frames are captured but never freed.

Code: Select all

ion handle=236
ion map=301
ion phys_addr=1980981248
amvideo: canvas0addr=c3
amvideo: ge2dformat=20102
amvideo: size=438 (1920x1080)
rect=-44143600,127 -44143600x127
ion handle=237
ion map=302
ion phys_addr=1981120512
amvideo: canvas0addr=c3
amvideo: ge2dformat=20102
amvideo: size=438 (1920x1080)
rect=-44143600,127 -44143600x127
ion handle=238
ion map=303
ion phys_addr=1981259776
amvideo: canvas0addr=c3
amvideo: ge2dformat=20102
amvideo: size=438 (1920x1080)
rect=-44143600,127 -44143600x127
ion handle=239
ion map=304
ion phys_addr=1981399040
amvideo: canvas0addr=c3
amvideo: ge2dformat=20102
amvideo: size=438 (1920x1080)
rect=-44143600,127 -44143600x127
ion handle=240
ion map=305
ion phys_addr=1981538304
amvideo: canvas0addr=c3
amvideo: ge2dformat=20102
amvideo: size=438 (1920x1080)
rect=-44143600,127 -44143600x127
terminate called after throwing an instance of 'std::runtime_error'
  what():  ION_IOC_ALLOC failed.
Aborted


crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

I looked at the code posted to correlate with the log. The issue appears to be the ION memory buffer is never freed. My *guess* is that this is because it mmap'd into user space but never munmap'd. I believe this would cause a reference to persists and you will either run out of ION memory or run out of virtual address to mmap into.

[edit]
I should also note that its preferred to only create/destroy an ION buffer when the width or height changes rather than every frame.

redPanther
Posts: 15
Joined: Mon Aug 21, 2017 1:52 am
languages_spoken: english
ODROIDs: Odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by redPanther »

next step reached: now it captures without crash. Also croping is integrated

Code: Select all

[hyperiond Core] <INFO> Unregister input source named 'Rainbow swirl fast' from priority register
[hyperiond AMLOGICGRABBER] <INFO> VPU mode
ion handle=1
ion map=42
ion phys_addr=1948254208
amvideo: canvas0addr=c3
amvideo: ge2dformat=20102
amvideo: size=2900000023e (656x574)
rect=10,10 265x140
amvideo: canvas0addr=c3
amvideo: ge2dformat=20102
amvideo: size=2900000023e (656x574)
rect=10,10 265x140
amvideo: canvas0addr=c3
amvideo: ge2dformat=20102
amvideo: size=2900000023e (656x574)
rect=10,10 265x140
now it's time to transfer data to hyperion :-)

crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

I am considering condensing all the "capture" API calls into a single one:
https://github.com/redPanther/hyperion. ... #L206-L235

Since this is the only other "client" of the API, I do not believe a "breaking" change would be an issue. Instead of four (4) IOCTLs, I am proposing a single IOCTL that both captures the frame and returns canvas, format, and size at the same time as a stuct parameter. This would simplify the API set to 2 calls: one to grab, and one to release.

redPanther
Posts: 15
Joined: Mon Aug 21, 2017 1:52 am
languages_spoken: english
ODROIDs: Odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by redPanther »

Sounds good, I'm awsiting your changes :-)

redPanther
Posts: 15
Joined: Mon Aug 21, 2017 1:52 am
languages_spoken: english
ODROIDs: Odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by redPanther »

hooray :-) first video data from ge2d into hyperion. ok color order, alignment, .. not correct now, but it works.

I want to get RGB888. The ion buffer which size should it have, w*h *3 or w*h *4.
The next thing is croping. My gues is I use the blit stuff for that to extract the rect that I want. Did I have to use another ionbuffer to get only that cropped data?
shot6.png
shot6.png (133.03 KiB) Viewed 13308 times

crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

redPanther wrote:I want to get RGB888. The ion buffer which size should it have, w*h *3 or w*h *4.
The size calculation is: stride * h (where stride = w * 4 for RGB32). For RGB24 you will need to test to ensure GE2D can use your alignment. I have never tested RGB24.
redPanther wrote:The next thing is croping. My gues is I use the blit stuff for that to extract the rect that I want. Did I have to use another ionbuffer to get only that cropped data?
The source and destination surface can be different sizes. The blit rectangle determines what area of each you are interested in. When source and destination are different sized, you need to use a scaling blit (GE2D_STRETCHBLIT_NOALPHA instead of GE2D_BLIT_NOALPHA). There is no need for another ION buffer or an additional copy:
https://github.com/OtherCrashOverride/c ... _cmd.h#L31

Code: Select all

#define	GE2D_STRETCHBLIT_NOALPHA            0x4702
The rectangle is :
https://github.com/OtherCrashOverride/c ... 1168-L1176

Code: Select all

			blitRect.src1_rect.x = 0;
			blitRect.src1_rect.y = 0;
			blitRect.src1_rect.w = width;
			blitRect.src1_rect.h = height;

			blitRect.dst_rect.x = 0;
			blitRect.dst_rect.y = 0;
			blitRect.dst_rect.w = width;
			blitRect.dst_rect.h = height;

redPanther
Posts: 15
Joined: Mon Aug 21, 2017 1:52 am
languages_spoken: english
ODROIDs: Odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by redPanther »

I think it should work, but it doesn't. My plan is to grab rgba and then use hyperion methode to transform it to rgb. This is the same way we do it with accelerated stuff on raspi (dispmanx).

some log:

Code: Select all

amvideo: canvas0addr=c3
amvideo: ge2dformat=20102
amvideo: size=78000000438 (1920x1080)
rect=0,0 285x160
buf 182400 182400
and the output picture
shot7.png
shot7.png (335.45 KiB) Viewed 13250 times
code is pushed to my aml branch mentioned above.

did you have any what I'm doing wrong?
configex.src_para.mem_type = CANVAS_TYPE_INVALID;
configex.src_para.canvas_index = canvas0addr;
configex.src_para.left = 0;
configex.src_para.top = 0;
configex.src_para.width = videoWidth;
configex.src_para.height = videoHeight / 2;
configex.src_para.format = ge2dformat;
why videoHeight / 2 ?

crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

redPanther wrote:why videoHeight / 2 ?
The video is in NV12 format. With this format the UV planes are sampled at half resolution. The GE2D driver internally does math based on color formats. Testing indicated that height/2 yielded correct operation. For testing, I found it easiest to use OSD0 (the display) as the target for blit operations. This allows you to immediately see the results of blit operations.

Stride is an important consideration. It may be necessary to use a larger stride than the width of the image due to alignment. For example, since NV12 is sub-sampled at half width and half height, operations must be performed on even values of width and height.

It may be a while before I can take an look at the issue. We are currently dealing with emergency conditions where I am located.

redPanther
Posts: 15
Joined: Mon Aug 21, 2017 1:52 am
languages_spoken: english
ODROIDs: Odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by redPanther »

I got the amvideocap working. Interessting thing is I got same decoding problems like with ge2d. I'll investigate ...

redPanther
Posts: 15
Joined: Mon Aug 21, 2017 1:52 am
languages_spoken: english
ODROIDs: Odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by redPanther »

I found the problem with amvideocap. Some stupid tiny typo ... will look into if this is the problem for ge2d interface too.

redPanther
Posts: 15
Joined: Mon Aug 21, 2017 1:52 am
languages_spoken: english
ODROIDs: Odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by redPanther »

It works now. After some cleanup code will be merge in master branch. Thx for help and good luck with your emergency

crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

redPanther wrote:It works now.
I love those words!

Thanks for putting the time and effort into this.

[Epilogue]
Hurricane Harvey has not deterred us. ;)
Our resolve is stronger than ever. What doesn't kill you makes you stronger. :D

User avatar
mad_ady
Posts: 9946
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 629 times
Been thanked: 774 times
Contact:

Re: Amlogic Video Capture support

Post by mad_ady »

[offtopic] What region do you live in @crashoverride? Your posts have not betrayed your Texan herritage. Also, a personal question: what's the largest caliber weapon you own? [/offtopic]

crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

I live in [REDACTED]. The largest caliber weapon I own is [REDACTED].
:lol:

[edit]
Nobody can ever make fun of our monster trucks again.

danielfmo
Posts: 62
Joined: Tue Mar 28, 2017 6:35 pm
languages_spoken: english
ODROIDs: ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by danielfmo »

Hi,

@crashoverride and @redPanther,

First of all thank you for the great work!

As you may already noticed from other threads I'm trying to make kodi, moonlight and Hyperion.ng to work together with Hardkernel's Ubuntu image, this time I have questions regarding GE2D and optimisations described in this thread.

So, I created a C2 kernel fork from Harkelnel's GitHub where I merged it with crashoverride's c2-amvideocap2 and c2-amvideo branches, then applied redPanther patch as suggested HEREand some other small stuff to make it work with moonlight.

Now I have the following issues:
  • - If I launch kodi before moonlight, the latter does not work and I only get a black screen (how can I debug this?)
    - GE2D capture is not working, hyperion logs bellow
First time I start Hyperion.ng after reboot

Code: Select all

[hyperiond ChannelAdjust_BLACK] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ChannelAdjust_WHITE] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,200,255
[hyperiond ChannelAdjust_RED] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,0,0
[hyperiond ChannelAdjust_GREEN] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,200,0
[hyperiond ChannelAdjust_BLUE] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,255
[hyperiond ChannelAdjust_CYAN] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,200,255
[hyperiond ChannelAdjust_MAGENTA] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,0,255
[hyperiond ChannelAdjust_YELLOW] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,200,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond Core] <INFO> ColorAdjustment 'default' => [0; 199]
[hyperiond Core] <DEBUG> <Hyperion.cpp:315:getLedLayoutGridSize()> led layout grid: 66x38
[hyperiond ComponentRegister] <INFO> Json/Proto forwarder: off
[hyperiond LedDevice] <DEBUG> <LedDeviceAdalight.cpp:53:init()> Adalight header for 200 leds: Ada 0x00 0xc7 0x92
[hyperiond LedDevice] <INFO> LedDevice 'adalight' configured.
[hyperiond LedDevice] <INFO> Opening UART: /dev/ttyACM0
[hyperiond LedDevice] <DEBUG> <ProviderRs232.cpp:182:tryOpen()> Setting baud rate to 2000000
[hyperiond LedDevice] <DEBUG> <ProviderRs232.cpp:198:tryOpen()> Device blocked for 1500 ms
[hyperiond Core] <INFO> Creating linear smoothing
[hyperiond Smoothing] <INFO> smoothing cfg 0: interval: 33 ms, settlingTime: 30 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 1: pause
[hyperiond ComponentRegister] <INFO> Smoothing: activated
[hyperiond ComponentRegister] <INFO> LED device: activated
[hyperiond Smoothing] <INFO> smoothing cfg 2: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 3: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 4: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 5: interval: 50 ms, settlingTime: 500 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 6: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 7: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 8: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 9: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 10: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 11: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 12: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 13: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 14: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 15: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 16: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 17: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 18: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 19: interval: 40 ms, settlingTime: 200 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 20: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 21: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 22: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 23: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 24: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 25: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 26: interval: 40 ms, settlingTime: 200 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 27: interval: 50 ms, settlingTime: 200 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 28: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 29: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 30: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 31: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 32: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 33: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 34: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 35: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 36: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 37: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond EFFECTENGINE] <INFO> 35 effects loaded from directory :/effects/
[hyperiond EFFECTENGINE] <INFO> 19 effect schemas loaded from directory :/effects/schema/
[hyperiond EFFECTENGINE] <INFO> 0 effects loaded from directory /home/odroid/.hyperion/custom-effects
[hyperiond EFFECTENGINE] <DEBUG> <EffectEngine.cpp:43:EffectEngine()> Initializing Python interpreter
[hyperiond Core] <DEBUG> <Hyperion.cpp:448:Hyperion()> configured leds: 200 hw leds: 200
[hyperiond ChannelAdjust_BLACK] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ChannelAdjust_RED] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,0,0
[hyperiond ChannelAdjust_GREEN] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,200,0
[hyperiond ChannelAdjust_BLUE] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,255
[hyperiond ChannelAdjust_CYAN] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,200,255
[hyperiond ChannelAdjust_MAGENTA] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,0,255
[hyperiond ChannelAdjust_YELLOW] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,200,0
[hyperiond ChannelAdjust_WHITE] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,200,255
[hyperiond MAIN] <INFO> Hyperion initialized
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:286:createKODIVideoChecker()> KODI checker created
[hyperiond ComponentRegister] <INFO> KodiVideoChecker: off
[hyperiond MAIN] <INFO> Json server created and started on port 19444
[hyperiond MAIN] <INFO> Proto server created and started on port 19445
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:341:startNetworkServices()> Boblight server created
[hyperiond ComponentRegister] <INFO> Boblight server: off
[hyperiond Core] <INFO> Register new input source named 'UDPLISTENER' for priority channel '200'
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:360:startNetworkServices()> UDP listener created
[hyperiond ComponentRegister] <INFO> UDP listener: off
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:383:startNetworkServices()> UDP LIstener mDNS responder started
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:390:startNetworkServices()> Json mDNS responder started
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:396:startNetworkServices()> Proto mDNS responder started
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderDetector.cpp:26:calculateThreshold()> threshold set to 0.050000 (13)
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderProcessor.cpp:26:BlackBorderProcessor()> mode: default
[hyperiond BLACKBORDER] <DEBUG> <ImageProcessor.cpp:62:setLedMappingType()> set led mapping to type 0
[hyperiond ComponentRegister] <INFO> Blackborder detector: activated
[hyperiond V4L2:auto] <DEBUG> <Grabber.cpp:33:setVideoMode()> setvideomode 0
[hyperiond V4L2:auto] <INFO> Signal threshold set to: {12, 12, 12}
[hyperiond V4L2:auto] <INFO> Signal detection area set to: 0.250000,0.250000 x 0.750000,0.750000
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:606:createGrabberV4L2()> V4L2 grabber created
[hyperiond ComponentRegister] <INFO> V4L capture device: off
[hyperiond MAIN] <INFO> set screen capture device to 'amlogic'
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderDetector.cpp:26:calculateThreshold()> threshold set to 0.050000 (13)
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderProcessor.cpp:26:BlackBorderProcessor()> mode: default
[hyperiond BLACKBORDER] <DEBUG> <ImageProcessor.cpp:62:setLedMappingType()> set led mapping to type 0
[hyperiond ComponentRegister] <INFO> Blackborder detector: activated
[hyperiond AMLOGICGRABBER] <DEBUG> <Grabber.cpp:33:setVideoMode()> setvideomode 0
[hyperiond FRAMEBUFFERGRABBER] <DEBUG> <Grabber.cpp:33:setVideoMode()> setvideomode 0
[hyperiond FRAMEBUFFERGRABBER] <INFO> Display opened with resolution: 1920x1200@32bit
[hyperiond AMLOGICGRABBER] <DEBUG> <AmlogicGrabber.cpp:36:AmlogicGrabber()> constructed(160 x 160)
[hyperiond Core] <INFO> Register new input source named 'AmLogic' for priority channel '250'
[hyperiond MAIN] <INFO> AMLOGIC grabber created and started
[hyperiond ComponentRegister] <INFO> Framegrabber: activated
[hyperiond MAIN] <INFO> Hyperion started
[hyperiond EFFECTENGINE] <INFO> run effect Knight rider on channel 0
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderDetector.cpp:26:calculateThreshold()> threshold set to 0.050000 (13)
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderProcessor.cpp:26:BlackBorderProcessor()> mode: default
[hyperiond BLACKBORDER] <DEBUG> <ImageProcessor.cpp:62:setLedMappingType()> set led mapping to type 0
[hyperiond Core] <INFO> Register new input source named 'Knight rider' for priority channel '0'
[hyperiond MAIN] <INFO> Inital foreground effect 'Knight rider' started
[hyperiond EFFECTENGINE] <INFO> run effect Warm mood blobs on channel 254
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderDetector.cpp:26:calculateThreshold()> threshold set to 0.050000 (13)
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderProcessor.cpp:26:BlackBorderProcessor()> mode: default
[hyperiond BLACKBORDER] <DEBUG> <ImageProcessor.cpp:62:setLedMappingType()> set led mapping to type 0
[hyperiond Core] <INFO> Register new input source named 'Warm mood blobs' for priority channel '254'
[hyperiond MAIN] <INFO> Inital background effect 'Warm mood blobs' started
[hyperiond WEBSERVER] <DEBUG> <WebConfig.cpp:38:WebConfig()> WebUI initialized, document root: :/webconfig
[hyperiond WEBSERVER] <INFO> started on port 8099 name 'Hyperion WebConfig'
[hyperiond WEBSERVER] <DEBUG> <StaticFileServing.cpp:62:onServerStarted()> Web Config mDNS responder started
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderDetector.cpp:26:calculateThreshold()> threshold set to 0.050000 (13)
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderProcessor.cpp:26:BlackBorderProcessor()> mode: default
[hyperiond BLACKBORDER] <DEBUG> <ImageProcessor.cpp:62:setLedMappingType()> set led mapping to type 0
[hyperiond AMLOGICGRABBER] <INFO> VPU mode
[hyperiond AMLOGICGRABBER] <ERROR> cannot open devices
[hyperiond AMLOGICGRABBER] <WARNING> GE2D capture interface not available! try Amvideocap instead
[hyperiond AMLOGICGRABBER] <ERROR> Read of device failed: 11 - Resource temporarily unavailable
[hyperiond Smoothing] <INFO> set smoothing cfg: 11, interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond LedDevice] <DEBUG> <LedDeviceAdalight.cpp:80:receivedData()> >>received 4 bytes data
[hyperiond Core] <DEBUG> <Hyperion.cpp:537:bonjourRecordResolved()> found hyperion session: odroid64.local.:8099
[hyperiond Smoothing] <INFO> set smoothing cfg: 0, interval: 33 ms, settlingTime: 30 ms, updateDelay: 0 frames
[hyperiond EFFECTENGINE] <INFO> effect finished
[hyperiond Core] <INFO> Unregister input source named 'Knight rider' from priority register
^C[hyperiond MAIN] <INFO> Application closed with code 0
[hyperiond WEBSERVER] <INFO> stopped Hyperion WebConfig
[hyperiond Core] <INFO> set current input source to auto select
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:93:freeObjects()> destroy grabbers and network stuff
[hyperiond Core] <INFO> Unregister input source named 'AmLogic' from priority register
[hyperiond AmLogic] <DEBUG> <GrabberWrapper.cpp:47:~GrabberWrapper()> Close grabber: AmLogic
[hyperiond V4L2:auto] <DEBUG> <V4L2Grabber.cpp:75:uninit()> uninit grabber: auto
[hyperiond Core] <INFO> Unregister input source named 'V4L2:auto' from priority register
[hyperiond V4L2:auto] <DEBUG> <GrabberWrapper.cpp:47:~GrabberWrapper()> Close grabber: V4L2:auto
[hyperiond KODI] <INFO> stopped
[hyperiond Core] <INFO> set current input source to auto select
[hyperiond EFFECTENGINE] <DEBUG> <EffectEngine.cpp:53:~EffectEngine()> Cleaning up Python interpreter
[hyperiond LedDevice] <DEBUG> <ProviderRs232.cpp:138:closeDevice()> Close UART: /dev/ttyACM0
second time I start Hyperion.ng

Code: Select all

[hyperiond ChannelAdjust_BLACK] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ChannelAdjust_WHITE] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,200,255
[hyperiond ChannelAdjust_RED] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,0,0
[hyperiond ChannelAdjust_GREEN] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,200,0
[hyperiond ChannelAdjust_BLUE] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,255
[hyperiond ChannelAdjust_CYAN] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,200,255
[hyperiond ChannelAdjust_MAGENTA] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,0,255
[hyperiond ChannelAdjust_YELLOW] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,200,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond Core] <INFO> ColorAdjustment 'default' => [0; 199]
[hyperiond Core] <DEBUG> <Hyperion.cpp:315:getLedLayoutGridSize()> led layout grid: 66x38
[hyperiond ComponentRegister] <INFO> Json/Proto forwarder: off
[hyperiond LedDevice] <DEBUG> <LedDeviceAdalight.cpp:53:init()> Adalight header for 200 leds: Ada 0x00 0xc7 0x92
[hyperiond LedDevice] <INFO> LedDevice 'adalight' configured.
[hyperiond LedDevice] <INFO> Opening UART: /dev/ttyACM0
[hyperiond LedDevice] <DEBUG> <ProviderRs232.cpp:182:tryOpen()> Setting baud rate to 2000000
[hyperiond LedDevice] <DEBUG> <ProviderRs232.cpp:198:tryOpen()> Device blocked for 1500 ms
[hyperiond Core] <INFO> Creating linear smoothing
[hyperiond Smoothing] <INFO> smoothing cfg 0: interval: 33 ms, settlingTime: 30 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 1: pause
[hyperiond ComponentRegister] <INFO> Smoothing: activated
[hyperiond ComponentRegister] <INFO> LED device: activated
[hyperiond Smoothing] <INFO> smoothing cfg 2: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 3: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 4: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 5: interval: 50 ms, settlingTime: 500 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 6: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 7: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 8: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 9: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 10: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 11: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 12: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 13: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 14: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 15: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 16: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 17: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 18: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 19: interval: 40 ms, settlingTime: 200 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 20: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 21: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 22: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 23: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 24: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 25: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 26: interval: 40 ms, settlingTime: 200 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 27: interval: 50 ms, settlingTime: 200 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 28: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 29: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 30: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 31: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 32: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 33: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 34: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 35: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 36: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond Smoothing] <INFO> smoothing cfg 37: interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond EFFECTENGINE] <INFO> 35 effects loaded from directory :/effects/
[hyperiond EFFECTENGINE] <INFO> 19 effect schemas loaded from directory :/effects/schema/
[hyperiond EFFECTENGINE] <INFO> 0 effects loaded from directory /home/odroid/.hyperion/custom-effects
[hyperiond EFFECTENGINE] <DEBUG> <EffectEngine.cpp:43:EffectEngine()> Initializing Python interpreter
[hyperiond Core] <DEBUG> <Hyperion.cpp:448:Hyperion()> configured leds: 200 hw leds: 200
[hyperiond ChannelAdjust_BLACK] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,0
[hyperiond ChannelAdjust_RED] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,0,0
[hyperiond ChannelAdjust_GREEN] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,200,0
[hyperiond ChannelAdjust_BLUE] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,0,255
[hyperiond ChannelAdjust_CYAN] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 0,200,255
[hyperiond ChannelAdjust_MAGENTA] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,0,255
[hyperiond ChannelAdjust_YELLOW] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,200,0
[hyperiond ChannelAdjust_WHITE] <DEBUG> <RgbChannelAdjustment.cpp:24:resetInitialized()> initialize mapping with 225,200,255
[hyperiond MAIN] <INFO> Hyperion initialized
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:286:createKODIVideoChecker()> KODI checker created
[hyperiond ComponentRegister] <INFO> KodiVideoChecker: off
[hyperiond MAIN] <INFO> Json server created and started on port 19444
[hyperiond MAIN] <INFO> Proto server created and started on port 19445
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:341:startNetworkServices()> Boblight server created
[hyperiond ComponentRegister] <INFO> Boblight server: off
[hyperiond Core] <INFO> Register new input source named 'UDPLISTENER' for priority channel '200'
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:360:startNetworkServices()> UDP listener created
[hyperiond ComponentRegister] <INFO> UDP listener: off
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:383:startNetworkServices()> UDP LIstener mDNS responder started
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:390:startNetworkServices()> Json mDNS responder started
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:396:startNetworkServices()> Proto mDNS responder started
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderDetector.cpp:26:calculateThreshold()> threshold set to 0.050000 (13)
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderProcessor.cpp:26:BlackBorderProcessor()> mode: default
[hyperiond BLACKBORDER] <DEBUG> <ImageProcessor.cpp:62:setLedMappingType()> set led mapping to type 0
[hyperiond ComponentRegister] <INFO> Blackborder detector: activated
[hyperiond V4L2:auto] <DEBUG> <Grabber.cpp:33:setVideoMode()> setvideomode 0
[hyperiond V4L2:auto] <INFO> Signal threshold set to: {12, 12, 12}
[hyperiond V4L2:auto] <INFO> Signal detection area set to: 0.250000,0.250000 x 0.750000,0.750000
[hyperiond MAIN] <DEBUG> <hyperiond.cpp:606:createGrabberV4L2()> V4L2 grabber created
[hyperiond ComponentRegister] <INFO> V4L capture device: off
[hyperiond MAIN] <INFO> set screen capture device to 'amlogic'
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderDetector.cpp:26:calculateThreshold()> threshold set to 0.050000 (13)
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderProcessor.cpp:26:BlackBorderProcessor()> mode: default
[hyperiond BLACKBORDER] <DEBUG> <ImageProcessor.cpp:62:setLedMappingType()> set led mapping to type 0
[hyperiond ComponentRegister] <INFO> Blackborder detector: activated
[hyperiond AMLOGICGRABBER] <DEBUG> <Grabber.cpp:33:setVideoMode()> setvideomode 0
[hyperiond FRAMEBUFFERGRABBER] <DEBUG> <Grabber.cpp:33:setVideoMode()> setvideomode 0
[hyperiond FRAMEBUFFERGRABBER] <INFO> Display opened with resolution: 1920x1200@32bit
[hyperiond AMLOGICGRABBER] <DEBUG> <AmlogicGrabber.cpp:36:AmlogicGrabber()> constructed(160 x 160)
[hyperiond Core] <INFO> Register new input source named 'AmLogic' for priority channel '250'
[hyperiond MAIN] <INFO> AMLOGIC grabber created and started
[hyperiond ComponentRegister] <INFO> Framegrabber: activated
[hyperiond MAIN] <INFO> Hyperion started
[hyperiond EFFECTENGINE] <INFO> run effect Knight rider on channel 0
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderDetector.cpp:26:calculateThreshold()> threshold set to 0.050000 (13)
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderProcessor.cpp:26:BlackBorderProcessor()> mode: default
[hyperiond BLACKBORDER] <DEBUG> <ImageProcessor.cpp:62:setLedMappingType()> set led mapping to type 0
[hyperiond Core] <INFO> Register new input source named 'Knight rider' for priority channel '0'
[hyperiond MAIN] <INFO> Inital foreground effect 'Knight rider' started
[hyperiond EFFECTENGINE] <INFO> run effect Warm mood blobs on channel 254
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderDetector.cpp:26:calculateThreshold()> threshold set to 0.050000 (13)
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderProcessor.cpp:26:BlackBorderProcessor()> mode: default
[hyperiond BLACKBORDER] <DEBUG> <ImageProcessor.cpp:62:setLedMappingType()> set led mapping to type 0
[hyperiond Core] <INFO> Register new input source named 'Warm mood blobs' for priority channel '254'
[hyperiond MAIN] <INFO> Inital background effect 'Warm mood blobs' started
[hyperiond WEBSERVER] <DEBUG> <WebConfig.cpp:38:WebConfig()> WebUI initialized, document root: :/webconfig
[hyperiond WEBSERVER] <INFO> started on port 8099 name 'Hyperion WebConfig'
[hyperiond WEBSERVER] <DEBUG> <StaticFileServing.cpp:62:onServerStarted()> Web Config mDNS responder started
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderDetector.cpp:26:calculateThreshold()> threshold set to 0.050000 (13)
[hyperiond BLACKBORDER] <DEBUG> <BlackBorderProcessor.cpp:26:BlackBorderProcessor()> mode: default
[hyperiond BLACKBORDER] <DEBUG> <ImageProcessor.cpp:62:setLedMappingType()> set led mapping to type 0
[hyperiond AMLOGICGRABBER] <INFO> VPU mode
[hyperiond AMLOGICGRABBER] <ERROR> cannot open devices
[hyperiond AMLOGICGRABBER] <WARNING> GE2D capture interface not available! try Amvideocap instead
[hyperiond Smoothing] <INFO> set smoothing cfg: 11, interval: 40 ms, settlingTime: 1 ms, updateDelay: 0 frames
[hyperiond LedDevice] <DEBUG> <ProviderRs232.cpp:216:writeBytes()> 32 frames dropped
[hyperiond LedDevice] <DEBUG> <LedDeviceAdalight.cpp:80:receivedData()> >>received 4 bytes data
[hyperiond Core] <DEBUG> <Hyperion.cpp:537:bonjourRecordResolved()> found hyperion session: odroid64.local.:8099
[hyperiond Smoothing] <INFO> set smoothing cfg: 0, interval: 33 ms, settlingTime: 30 ms, updateDelay: 0 frames
[hyperiond AMLOGICGRABBER] <ERROR> Read of device failed: 11 - Resource temporarily unavailable
[hyperiond EFFECTENGINE] <INFO> effect finished
[hyperiond Core] <INFO> Unregister input source named 'Knight rider' from priority register
Note the missing "Read of device failed" message and the presence of "32 frames dropped" on the second time.

Any hints on how to fix all this?

Best regards,

crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

danielfmo wrote:If I launch kodi before moonlight, the latter does not work and I only get a black screen (how can I debug this?)
Kodi assumes it is the only program that will ever use the hardware codecs. It changes many settings that affect operation of hardware codecs. For example:
https://github.com/OtherCrashOverride/c ... #L272-L285

Code: Select all

	// Restore settings that Kodi tramples
	r = ioctl(cntl_handle, AMSTREAM_IOC_SET_VIDEO_DISABLE, (unsigned long)VIDEO_DISABLE_NONE);
	if (r != 0)
	{
		throw Exception("AMSTREAM_IOC_SET_VIDEO_DISABLE VIDEO_DISABLE_NONE failed.");
	}


	uint32_t screenMode = (uint32_t)VIDEO_WIDEOPTION_NORMAL;
	r = ioctl(cntl_handle, AMSTREAM_IOC_SET_SCREEN_MODE, &screenMode);
	if (r != 0)
	{
		std::string err = "AMSTREAM_IOC_SET_SCREEN_MODE VIDEO_WIDEOPTION_NORMAL failed (" + std::to_string(r) + ").";
		throw Exception(err.c_str());
	}
As shown above, Kodi disabling video is the most likely issue.

danielfmo
Posts: 62
Joined: Tue Mar 28, 2017 6:35 pm
languages_spoken: english
ODROIDs: ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by danielfmo »

crashoverride wrote:
danielfmo wrote:If I launch kodi before moonlight, the latter does not work and I only get a black screen (how can I debug this?)
Kodi assumes it is the only program that will ever use the hardware codecs. It changes many settings that affect operation of hardware codecs. For example:
https://github.com/OtherCrashOverride/c ... #L272-L285
As shown above, Kodi disabling video is the most likely issue.
Hi,

I'm pretty sure that you're tired of hearing (reading) this but, thank you once more @crashoverride!
I feel that all bits and pieces to make this work are scattered around the forum and without the help of all of you it would not be possible to achieve my goal.

I did some testing with launching moonlight and kodi and checked what changes in between, and simply, as usual, by doing what you mentioned did the trick.
I followed this post: viewtopic.php?f=136&t=23143&hilit=c2pla ... 50#p159892

Anyway I'll detail my finding for future reference:

Before starting kodi after a cold boot (regardless if I start moonlight or not) the values are as follows:

Code: Select all

odroid@odroid64:~$ cat /sys/class/video/axis
0 0 -1 -1
odroid@odroid64:~$ cat /sys/class/video/screen_mode
0:normal
odroid@odroid64:~$ cat /sys/class/video/disable_video
0
After starting and stooping kodi, they changed to:

Code: Select all

odroid@odroid64:~$ cat /sys/class/video/axis
0 0 1919 1199
odroid@odroid64:~$ cat /sys/class/video/screen_mode
1:full stretch
odroid@odroid64:~$ cat /sys/class/video/disable_video
1
By just enabling video moonlight works again :)

Code: Select all

echo 0 > /sys/class/video/disable_video
Though I wonder if is is still necessary or recommended to reset also the values of /sys/class/video/axis and /sys/class/video/screen_mode. What do you think?

Finally, regarding my previous post, do you have any hints why GE2D capture with hyperion.ng is not working?

Code: Select all

[hyperiond AMLOGICGRABBER] <WARNING> GE2D capture interface not available! try Amvideocap instead
[hyperiond AMLOGICGRABBER] <ERROR> Read of device failed: 11 - Resource temporarily unavailable
Best regards,

[EDIT]
I'll pass the above mentioned information to the Libreelec section as I believe thy're facing the same issue
Last edited by danielfmo on Wed Nov 08, 2017 2:40 am, edited 1 time in total.

crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

danielfmo wrote:do you have any hints why GE2D capture with hyperion.ng is not working?
I have no experience with hyperion.

danielfmo
Posts: 62
Joined: Tue Mar 28, 2017 6:35 pm
languages_spoken: english
ODROIDs: ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by danielfmo »

crashoverride wrote:
danielfmo wrote:do you have any hints why GE2D capture with hyperion.ng is not working?
I have no experience with hyperion.
Hi,

No problem, I may have found the issue, or at least one of them, but it is on Hyperion side.
I'll try to contact redPanther or someone from their team.

Anthrax
Posts: 7
Joined: Wed Sep 05, 2018 8:50 pm
languages_spoken: english
ODROIDs: ODROID C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by Anthrax »

Hello everybody,

I just joined this forum and wanted to thank all of you for the time and effort you spent/d on keeping ambilight for the odroid-c2 a possibility.

After I bought a new 4k tv i decided to retire my trusty ambilight setup (Raspberry Pi 3B, Aduino Teensy with Adalight, 116 WS2801 LEDs, Hyperion classic) and go for a shiny new Odroid-C2 with 16GB eMMC...
I was really happy how well this little thing performed when playing 2160p content. But the second I tried to get hyperion up and running all went downhill ;-(

After hours of research on a handful of forums I figured that there was once again a rift going through the Open/Libre/Core-Elec community and the best best for Odroid support would be Coreelec because most devs seemed to have flocked there.

After much trial and error with different builds (LE, milhouse, CE) and hyperion versions I'm on the verge of sending my Odroid back (sadly without any viable ambilight alternative) :-(

So my question is:
Is there any known configuration/combination of *ELEC-build & hyperion that does 4k without issue?

best regards
Anthrax

PS: I'm currently trying to make sense of all the different kernel, hyperion and *ELEC patches that float around between forums to possibly be able to build something myself - but the info is to cluttered for me to grasp at the moment...
Is there anybody who could point me in the right direction an give some advice?

crashoverride
Posts: 5479
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 482 times
Contact:

Re: Amlogic Video Capture support

Post by crashoverride »

Anthrax wrote:So my question is:
Is there any known configuration/combination of *ELEC-build & hyperion that does 4k without issue?
You can ask in the *Elec sub-forum: viewforum.php?f=144

Anthrax
Posts: 7
Joined: Wed Sep 05, 2018 8:50 pm
languages_spoken: english
ODROIDs: ODROID C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Amlogic Video Capture support

Post by Anthrax »

Hey crashoverride,

thanx. I saw that part of the forum but didn't want to double post for my first two posts ;-)

regards
Anthrax

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 2 guests