/srv/irclogs.ubuntu.com/2013/09/19/#ubuntu-mir.txt

rsalvetikdub_: hey, afaik nothing changed in libhardware that could affect mir01:16
rsalvetikdub_: can you get some more details, and open a bug as well?01:16
rsalvetiI'm in vac this week, but I can take a look at the bug01:16
=== grenadecx-Ascend is now known as 65MAA0XUD
=== dandrader is now known as dandrader|afk
=== dandrader|afk is now known as dandrader
robert_ancellmterry, https://launchpad.net/~ubuntu-unity/+archive/experimental-prevalidation14:39
mterryrobert_ancell, ah... that's a boring PPA that doesn't have armhf enabled  :(14:49
robert_ancellmterry, :(14:49
mterryrobert_ancell, I'm trying to avoid rebuilding the "world" in armhf14:49
kdubrsalveti, so, i have a theory about how to fix the nexus4 flicker14:53
kdubbut need some help spinning up a phablet build14:53
kdubspecifically, a kernel14:53
kgunnricmm: ^ could you possibly help kdub ?15:52
ricmmkdub: whats the issue?16:04
kdubricmm, long story short... i want to make a build for mako with this in BoardConfig.mk16:05
kdubTARGET_QCOM_DISPLAY_VARIANT := caf16:05
kdubwhen i try to do so though, it needs a kernel with some new ioctls16:05
kdubricmm, the 'why' is that the hwcomposer.msm8960.so module that we're using is just what works for CM... its not what qcom ships from codeaurora forum16:06
ricmmok, ill build one for you16:07
ricmmgive me a bit16:07
kdubricmm, thanks16:08
rsalvetikdub: ricmm: this might not be necessarily trivial but something to test16:16
kdubrsalveti, not trivial because of the kernel changes?16:20
rsalvetiyup, not sure if our kernel has everything that's needed by it16:20
kdubwell, our kernel does not... i think the lge-kernel-mako from cyanogenmod does though?16:21
rsalvetiwell, our kernel should reflect that, might not be completely updated with our current cyanogen branch16:22
kdubits in the 10.2 kernel16:23
kduband we're still 10.1 basde?16:23
=== dandrader is now known as dandrader|lunch
rsalvetiiirc, yes16:36
tvosskdub, are we able to reproduce the flicker issue with a simple test setup?16:59
kdubtvoss, like, if i drive the display with the fb hal, i see it... or if i force surfaceflinger in certain ways17:04
kdubthe obvious problem is that the fb isn't being synced right17:05
tvosskdub, okay17:05
tvosskdub, was just curious17:05
kduband its plain to see why looking through the source for the hwc we're /currently/ using :)17:05
tvosskdub, ?17:06
tvosskdub, does that mean you know the root cause?17:06
kdubi meant that its obvious that what the hwc is doing right now won't cause any fb sync17:07
tvossah okay17:07
ricmmrsalveti: yea right just saw that17:10
ricmmso not trivial to build with what kdub needs17:10
ricmmkdub: can you isolate the kernel patch? or got a link I can see the relevant bits in?17:11
kdubricmm, i'll see if i can dig up the kernel patch17:14
kdubthe relevant bits are17:14
kdubthe MSM_ROTATOR_IOCTL_BUFFER_SYNC ioctl in https://github.com/CyanogenMod/lge-kernel-mako/blob/cm-10.2/drivers/char/msm_rotator.c17:14
ricmmkdub: how come we dont see this in SF tho?17:16
ricmmwe are running 10.1 and that isnt available there17:16
kdublooking up sources... i minute17:16
kdub1 minute17:17
kdubso if you look here... https://github.com/CyanogenMod/android_hardware_qcom_display/blob/cm-10.1/libhwcomposer/hwc.cpp#L28317:18
kdubyou see that hwc skips doing any fb sync if we have 1 layer (like mir runs with)17:19
kdubsf always operates with 2 or more layers, so they get the sync code17:19
kdubbut really, i don't know where that hwc came from17:19
kdubbecause the ones qualcomm puts out are in...17:20
kdubhere: https://github.com/CyanogenMod/android_hardware_qcom_display-caf/tree/cm-10.117:20
kdubi've tried to patch the one we're using, haven't gotten it quite right yet :)17:22
ricmmthat'd be a nicer solution :)17:22
ricmmcan you just do the sync outside of the check?17:23
* ricmm taking wild guesses17:23
tvosskdub, but the qualcomm one you are referring only syncs for more than one layer, too, see: https://github.com/CyanogenMod/android_hardware_qcom_display-caf/blob/cm-10.1/libhwcomposer/hwc.cpp#L36717:23
kdubtvoss, right, but it goes and calls draw in l38717:24
kdubwhereas the first one just returns17:25
tvosskdub, true17:25
tvossand it does a display_commit, too17:25
ricmmsounds patchable17:26
ricmmwhatever their argument for doing it differently, the patch will show if it works or not17:26
ricmm;)17:26
tvossricmm, +117:26
kdubright, trying to make a patch, but i think we should move to the caf stuff from qualcomm17:27
ricmmtry the patch first, the other move might be more intrusive than you think17:27
ricmmCM also has a reason for not using that, I guess17:27
kdubi'm sure they do, just don't know if its a good reason (or one that applies to mir/ubuntu touch too)17:28
kdubat any rate, trying to patch17:28
ricmmok, fingers crossed17:29
ricmmgood catch if it is that17:29
alan_gthomi: did you figure out the valgrind incantation on arnhf? Maybe just run the tests without valgrind?17:53
thomialan_g: I did not17:53
thomiI believe that's all done in the packaging17:54
thomiso, we can do whatever we like there :)17:54
thomiwill try and get mir building on the phone though, that sounds like fun17:54
alan_gdo you also watch paint dry?17:55
tvossthomi, what's wrong with the cross-building setup?17:56
=== dandrader|lunch is now known as dandrader
thomitvoss: the script? It used to fail in wierd and wonderful ways, so I generally don't trust it. Also I'm trying to make sure I can run the tests on the target hardware, so cross-compiling really isn't a solution here18:27
alan_gthomi: the script is rubbish, but cross compiling works and I run the tests on an N418:30
=== dandrader is now known as dandrader|afk
=== dandrader|afk is now known as dandrader
ricmmkdub: ping, still around?20:41
kdubricmm, yep20:42
ricmmkdub: I have this http://paste.ubuntu.com/6129884/20:42
ricmmwhen running the gstreamer-backed mediaplayer20:42
ricmmworks under SF20:42
kdubso... somehow a client has an egl context and is trying to...20:44
kdubuse buffers from the video decoders with it?20:44
ricmmindeed20:44
ricmmthe gstreamer pipeline is set to use the android decoder20:45
ricmmkdub: jhodapp is the guy20:45
jhodappyo20:45
kdubjhodapp, so what's the scenario? specifically what egl windows are in play20:46
ricmmjhodapp: maybe a quick run down of what the arch looks like for your gstreamer plugin20:46
jhodappkdub: I use eglGenTextures() to get a texture id, and then I use the Android SurfaceTexture call which I pass off to a SurfaceTextureClient20:47
jhodappkdub, that texture id is obtained from qtmultimedia, which passes it to my video sink, which does the calls into hybris where I make the Android calls to set up a SurfaceTexture20:47
kdubsimple, eh? ;-)20:48
jhodapphehe, yeah20:48
jhodapp:)20:48
kdubbut with this backtrace http://paste.ubuntu.com/6129884/20:48
jhodappthat's the high level call chain20:48
kdubmir is used20:48
jhodappyes, and with this other logcat output: http://paste.ubuntu.com/6129901/, you can see that it blows up when trying to create the SurfaceTextureClient20:49
ricmmI'll have to say that I was getting weird backtraces20:50
ricmmlike corrupt stacks or something, whenever I added some debugging it went past20:50
ricmmuntil I started hitting some Mir in the backlog20:50
jhodappgreat20:50
ricmmthen I pinged people20:50
jhodappa heisenbug20:51
ricmmbut indeed the last I see is the ::connect(), client-wise20:51
kdubso the client is rendering to a mir buffer20:51
kdubi guess i don't see how a SurfaceTextureClient would mesh with a mir client20:51
jhodappis that a statement or a question?20:51
jhodapphow so?20:52
kdubjhodapp, a question, sorry20:52
kdubso the client connects to the mir server, wit the intention of posting some buffers to the screen, right?20:52
jhodappI guess so, I'm not making any direct mir client/server calls myself20:52
jhodapphave you essentially gutted the Android SurfaceTexture and SurfaceTextureClient underneith to use a mir buffer?20:53
ricmmno no, this is a normal QtUbuntu client, out through mirclient20:53
ricmmour SurfaceTexture is bound with the Mir window20:53
jhodappa SurfaceTextureClient just needs to be able to take a raw decoded frame and push that to the rendering texture buffer20:54
ricmmthe difference here is that we are then passing that ST to the decoder to dump back decoded buffers into it20:54
jhodappexactly20:54
jhodappthe SurfaceTextureClient connects the GL API to do that buffer pushing that avoids the main CPU20:55
jhodappdoes that help at all kdub?20:56
kdubjhodapp, okay so, the buffers that were acquired came from mir, via qtubuntu?20:59
jhodappricmm, can you answer that one?20:59
kdubbecause if you switch QT_QPA_PLUGIN environment variable, it will switch from getting the buffers from sf to mir21:00
jhodappkdub, I'm not familiar with how mir fits in behind the scenes as I developed everything with SurfaceFlinger21:00
kdubjhodapp, right, so there might be some banging on mir bits to get it to work with the media stuff21:00
jhodappkdub, indeed...now I kind of wish ricmm and I were at the sprint with you to push through this21:01
kdubjhodapp, so when you get a buffer to feed to the video decoders, that comes from where?21:02
ricmmthe buffer is allocated natively21:02
ricmmdirectly out gralloc21:02
jhodappkdub, it comes from gralloc21:02
jhodappyes21:02
ricmmjhodapp: this runs the same code path in hybris as the old media stuff, right?21:03
ricmmthe non-SF provided buffers21:03
jhodappricmm, it is a new hybris compat layer, but it uses a SurfaceTextureClient and such just like the old one21:03
ricmmkdub: SurfaceTextureClient's BufferQueue used to use the SF allocator by default, in the hybris code we now extracted that code natively into hybris21:03
ricmmso we use GraphicBuffer() directly21:04
jhodappricmm, it merely gets rid of using the MediaPlayer class, and uses MediaCodec instead21:04
ricmmand thats what we pass to the STC21:04
jhodappso in theory it should be the same21:04
ricmmjhodapp: oh, what file is that?21:04
jhodappricmm: compat/media/media_codec_layer.cpp21:04
jhodappricmm: and also take a look at surface_texture_client_hybris.cpp21:05
ricmm_SurfaceTextureClientHybris::getInstance().surface_texture = new SurfaceTexture(texture_id, allow_synchronous_mode);21:05
ricmmthats wrong, we need to pass the native BufferQueue as in media_compatibility_layer.cpp21:05
jhodappexactly21:05
ricmmotherwise it will try to reach out into SF for it21:05
jhodappricmm, I need a SurfaceTexture though because I need to be able to call updateTexImage() on it21:06
jhodappricmm, if we can still do that with what you said, that's fine21:06
ricmmthats fine, just look at how its done in media_compatibility_layer21:06
ricmmits weird because I dont see the failing call out into SurfaceFlinger21:06
ricmmbut I'm sure that this code path will block that thread and maybe blow up somewhere else, perhaps21:07
ricmmlemme get something for my wife and I'll give it a shot21:07
jhodappricmm, so more like this, minus the SurfaceTexture: _SurfaceTextureClientHybris::getInstance().setISurfaceTexture(surface_texture->getBufferQueue());21:07
kdubi got a little lost in the discussion there, but it sounds to me like the client is allocating the buffer for media usage directly?21:09
jhodappyes21:09
jhodappdown on the bionic side21:10
kdubin which case... you could composite it to a mir buffer21:10
ricmmkdub: not yet, right now we realized theres something wrong in the code21:10
ricmmwe'll take a stab at fixing it21:10
kdubokay21:10
jhodappricmm, so you're wanting to try messing with it, is that right?21:11
jhodappricmm, if so that's cool, otherwise I can try in the morning as I've got to run for the evening21:12
ricmmjhodapp: go ahead, ill take a look21:14
ricmmand if not ill get an email going with the three of us for later/tomorrow21:14
jhodappricmm, ok, I can come back on later this evening...I'll ping you when I get home21:15
jhodappricmm, let me know if you have any success21:15
ricmmjhodapp: DONE21:16
ricmmworks21:16
jhodapplol21:16
ricmmshipping now21:16
jhodappwhat's your change?21:16
ricmmtheres a weird flickering but its decoding and showing21:16
jhodappdude, you're on a role21:16
ricmmmade it use the native buffer allocator21:16
jhodappone line change?21:16
ricmmI'll send a patch to salveti later21:16
ricmm~521:16
jhodappok, send it to me as well so I can update my local git branch21:17
ricmmkk21:17
jhodappthanks dude21:17
jhodappthe flickering sounds interesting21:18
jhodappricmm, on maguro?21:18
ricmmyep21:18
jhodappwonder if it would flicker on the n421:18
jhodappricmm, ok I'm out now21:19
ricmmok cya tomorrow21:20
=== jhodapp is now known as jhodapp|afk
jhodapp|afklater21:20
ricmmkdub: did you manage to get a patch for the hwcomposer ?21:20
kdubricmm, no, digging a bit deeper21:21
kdubi have a suspicion though about why the patches aren't working, i'll let you know if it works out21:21
ricmmalright21:33

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!