Closed blistex closed 6 years ago
Hey glad to hear it is mostly working for you! I will definitely be continuing development (I'm working with google to get it listed in the play store for android TV devices, they have not been very helpful so far unfortunately) and am very much open to others contributing to the project!
Have you tried running the opengl version of the grabber? In my experience it works far more reliably - mine has been running on my shield since the most recent commit 9 days ago. The code for the alternate grabber is much more elegant but less stable, so I figured I would add both and let people with different devices hash out which is better for their use. Let me know if that helps with stability (and maybe the LEDs not being as bright on one side, but this is the first I am hearing of that issue).
I'm not sure what you mean by "option for how much % in the picture should be scanned"!
I may look into enabling the user to define the resolution of the grabbed image, but right now that is determined automatically. Basically the app determines a scale factor to apply to the screen dimensions in order to achieve a target bitrate. If I can work out a more user friendly way to do that I would be open to it, but simply plugging in some dimensions would not achieve the exact effect the user may be expecting.
I saw you made a fork though, so if you want to play around with the grabber resolution just tweak the values in HyperionScreenEncoderBase
on lines 9 & 10 - just look into how the TARGET_BIT_RATE
is used later on to determine how much to scale the screen by.
I also get freezes.. here is the logcat when it happens..
05-19 21:12:03.189 2274-2299/com.abrenoch.hyperiongrabber E/BufferQueueProducer: [ImageReader-79x44f1m5-2274-0] requestBuffer: BufferQueue has been abandoned
05-19 21:12:03.190 2274-2288/com.abrenoch.hyperiongrabber E/BufferQueueProducer: [ImageReader-79x44f1m5-2274-0] cancelBuffer: BufferQueue has been abandoned
05-19 21:12:03.195 2274-2299/com.abrenoch.hyperiongrabber E/BufferQueueProducer: [ImageReader-79x44f1m5-2274-0] setAsyncMode: BufferQueue has been abandoned
05-19 21:12:03.245 2274-2287/com.abrenoch.hyperiongrabber E/BufferQueueProducer: [ImageReader-79x44f1m5-2274-0] setAsyncMode: BufferQueue has been abandoned
I've tried to figure out why.. and I think I found the problem. I move ImageReader up to a class member ( I think it's called that? )
public class HyperionScreenEncoder extends HyperionScreenEncoderBase {
private static final int MAX_IMAGE_READER_IMAGES = 5;
private static final String TAG = "HyperionScreenEncoder";
private VirtualDisplay mVirtualDisplay;
private ImageReader mImageReader;
And now it's been working for two days... I will do some testing to see if it is that (been changing many things trying to find why it freezes)
Interesting observation @NisseDILLIGAF, keep an eye on that let us know if it seems more reliable please!
@abrenoch
Have you tried running the opengl version of the grabber? In my experience it works far more reliably
Yes I did and indeed I can confirm that it's much more reliable. I used it for 2 hours without any freezers.
Let me know if that helps with stability (and maybe the LEDs not being as bright on one side, but this is the first I am hearing of that issue).
Unfortunately it didn't 😢 this is the only that keeps from using this method from full time. (Why does it only has to not work on my setup...)
In this Picture it's visible although the my camera brightens everything up and messes with the color. IRL it's much much more noticeable like the right is nearly off.
but then again 4:3 content is being capture normal without any issue! weird.
I was able to capture this weird behavior on video. When start capturing the screen it looks like in the first picture I posted. But when exit the the app and enter it again for the first few seconds the right side gets captured correctly before the right get turned off again 😖 please have a look: https://youtu.be/Kkkd7MredCI
I'm not sure what you mean by "option for how much % in the picture should be scanned"!
sorry for not phrasing it correctly! you know how on HyperCon (the actual Hyperion configuration Tool) there is a point under Image Process where you can set the horizontal and vertical depth in %? I thought maybe that would help me if I could set different values. Because like I showed 4:3 is being grabbed correctly.
I saw you made a fork though
that was just an accident 😓 I thought I could see other versions if I click on fork! turns out that's not the case 😀
Like I said great app just not working for me right now....
edit: so I installed it on my phone and I'm not experiencing the issue with that! all sides are working perfectly! so it has something to do with my shield tv. Do I have pay attention to something? I looked at the settings like overscan and everything but nothing changed...
Hey @blistex that is pretty damn weird! I can't say anything immediately comes to mind what could be causing that on just the shield. Maybe 4:3 content is capturing correctly because the hyperion server is processing the black bar on the dimmer side?
I'll see if I can reproduce this on my end, maybe it is happening to me too :neutral_face: lol
Hey @NisseDILLIGAF do you have a compiled version with your changes? Happy to test and maybe get pushed to main.
@ziggy73701 sorry, I don't want to share an apk here, and you shouldn't install apk's from strange people ;) It's pretty easy to download Android Studio and compile yourself.. just make the changes in 'HyperionScreenEncoder.java' line 24 add 'private ImageReader imageReader;' line 93 remove 'ImageReader' so that it says ' imageReader = ImageReader.newInstance(mWidthScaled, mHeightScaled, '
@abrenoch This seems to work for me, if you don't see any problems you could change this. I think It has something to do with Android garbage collection..? but I'm not an expert..
If I hadn’t installed an apk from a stranger in the first place I wouldn’t be here.
But no worries, il have a punt around myself.
hey @ziggy73701 I'm playing around with this right now... I can post a link to an apk if it is working alright for me!
@abrenoch yes please! maybe the new build will fix my issue! *hopes
Sweet.... I’ll take a look at Android Studio as well..
Here is a patched apk for the TV build if you guys want to play around with it!
[link removed]
Let me know how it goes, I played some 4k content on loop for a while and watched a little bit of TV and it seemed to have gone well so far!
Also, @blistex, I think that right side of the LEDs being dimmer (actually totally off in my case) was something weird going on with just the UI of the grabber app itself - I'm really not sure what. I threw up just a white image and all LEDs appear correct.
I have an open pull request right now though that adjusts the UI and will mitigate the problem entirely though!
@abrenoch I took that picture with the ui just because it was convenient. The problem appeared and still appears everywhere except on 4:3 content.
Maybe the next update will fix it or the oreo update for the shield...
btw thanks you for your hard work :)
Been running nearly 2 hours on the new version. Amazing job!
All credit goes to @NisseDILLIGAF for finding a fix!
@blistex If you try this youtube video, which is just a white screen, does it light up all your LEDs correctly? I tried on my end and everything was working as expected!
@abrenoch just to prove it here are some more pictures
tommorow I'm gonna try and try this on a FireTV Stick and see if the same happens. Just to be clear, my LED's on the right are not completely off. They just light up maybe 30% as the rest.... and any content that's not this white/bright it's very noticeable.
Hey @blistex, I've been pondering about this and just simply can't think of what would be causing this, at least from the grabber's side of things. Would you mind posting a copy of you hyperion config file to pastebin for me please? I just want to consider all avenues. The LEDs being dimmer on just that side I find really strange because I am not adjusting the pixel data from the screen in any way - just porting over the RGB values per-pixel exactly as they are. So I'm just not seeing where that color difference would come from!
Not sure how relevant it is, but what resolution is yout TV running at? I do have some old code from when I was still experimenting with this app that would save the frames being sent to hyperion as images on the device. I may toss together a debug apk for you to try so we can actually see the pixels being sent to hyperion.
At this point we might want to cover the basics. Did you try to set all leds to white with the official hyperion android app? https://play.google.com/store/apps/details?id=nl.hyperion.hyperionfree
Hey @blistex I think there is a really good way for us to see what is going on here, but it would require you build and install the new version of hyperion. The new version comes with a web tool that allows the user to get a live preview of the data being sent to hyperion. It is really cool and probably help us get a better idea of what is being sent to your screen!
The issue with the side of the screen is resolved now, look forward to the fix in the next release (unless you want to compile yourself of course)!
First of all thank you @abrenoch 😘
I am currently super worried and pissed at the current state of things... let me explain. Android is not a small or niche platform, but still when it comes to some stuff it get's left behind.
SPMC is a great kodi fork very important for android / shield tv users especially because it's ability to run the Hyperion-Ambilight Addon while hardware acceleration is turned off. If I turn off hardware acceleration on any kodi build I can't playback any video file without stutter... but as most of you know SPMC got discontinued few weeks ago which really worries me about the future. I don't wanna be stuck with SPMC forever. I know these developers sacrifice their free time and don't owe us anything! I'm not complaining just voicing my concerns that's all.
It's really cool that @abrenoch has made this application! I use SPMC/kodi and YouTube on my shield tv and it's great that I'm not dependent on the kodi youtube addon because it's sucks and is limited to only 720P.
The Grabber works fine but sometime freezes and I have to manually restart it. But has some pro's and con's.
Pro's: not limited to kodi/SPMC has a settings for framerates good black border recognition very quick hasn't has a issues with different framerates (causes no delay while watching 24fps movies)
Con's: isn't 100% reliable yet stops working randomly right side of LED's not bright as the rest! no settings option for how much % in the picture should be scanned no settings like the Hyperion addon which enables to set picture width and high I have mine set to 225 and 120 which results in a more accurate effect. shield tv can handle stuff like this. there is a noticeable difference in the ambilight effect between the addon and this apk.
I just hope @abrenoch continues development on this very promising app.