/srv/irclogs.ubuntu.com/2015/06/24/#ubuntu-mir.txt

=== mibofra is now known as Guest89474
=== Cimi_ is now known as cimi
u_glideHello folks! How I can join to alpha testing of https://www.youtube.com/watch?v=c3PUYoa1c9M&feature=youtu.be&t=2m45s ?09:54
mcphailHi. I'm trying to force landscape orientation in an SDL2 game on Ubuntu Phone. I've found I can obtain a MirConnection* and a MirSurface*, and was wondering if either of those pointers are worth investigating to force a change in orientation? I don't know much about Mir and don't want to be chasing a dead-end10:05
duflumcphail: Yes, I believe we added APIs that will help you. Let me check10:07
=== shiznix_ is now known as shiznix
mcphailduflu: great!10:07
duflumcphail: I think it is:   mir_surface_set_preferred_orientation(MirSurface *surface, MirOrientationMode orientation);10:08
dufluAlthough never used it myself so don't know if it's fully wired up10:08
mcphailduflu: ooh - that sounds like it. Do you happen to know which version of Mir that first appears? Is it available on the Mir running on vivid phones?10:09
duflumcphail: It will take a minute to check10:10
mcphailduflu: cheers. I greatly appreciate this10:11
duflu(bzr is far too slow)10:12
alan_gmcphail: you could look in mir_toolkit/mir_surface.h to see what's available10:12
mcphailalan_g: I'll do that. Thanks for the hint10:12
duflumcphail: Yes it is in Mir 0.12 (vivid)10:13
dufluBut also relies on the server to honour it. Which Unity8 should by now10:14
mcphailduflu: that's brilliant news! Look forward to trying this out this evening10:14
dufluNo problem.... 'night...10:14
mcphailThanks duflu, alan_g et al10:14
alan_gu_glide: I know there were a lot of experimental branches to different components in that proof-of-concept - while some of that has landed I think I don't think there's yet a version with it all integrated.10:23
seb128hey there10:23
seb128is there any documentation on starting unity8 manually/in  debug mode?10:24
seb128trying to debug http://paste.ubuntu.com/11763124/10:25
seb128"ERROR: QMirServer - Mir failed to start"10:25
seb128on a snappy personal image10:25
seb128the mir demo server works on the same machine and I can start a gtk application and use it10:25
alan_gseb128: normally I'd suggest asking greyback but I've not seen him around recently10:38
seb128alan_g, right, seems he's on vac this week10:43
alan_gseb128: may no longer be current but... "Aug 27 17:44:04 <greyback>camako: MIR_SERVER_NAME=session-0 MIR_SOCKET=/run/mir_socket QT_QPA_PLATFORM=mirserver  /usr/bin/unity8"10:49
alan_gAug 27 17:46:17 <greyback>camako: it's started by upstart usually. "start unity8" does the job. /usr/share/upstart/sessions/unity8.conf the config file10:50
alan_gHTH10:50
seb128alan_g, thanks10:53
=== alan_g is now known as alan_g|lunch
=== alan_g|lunch is now known as alan_g
=== Guest89474 is now known as mibofra
=== ValicekB_ is now known as ValicekB
=== dandrader is now known as dandrader|lunch
racarrMornng16:09
alan_gAfternoon16:11
=== alan_g is now known as alan_g|EOD
=== dandrader|lunch is now known as dandrader
bregmadandrader, can you tells us anything about how the Mir server nested in Unity 8 connects with the system compositor?18:37
dandraderbregma, that's quite a vague question. but the unity-system-compositor puts a socket file that unity8 connects to18:39
dandraderbregma, I think mir guys are better suited to answer that18:40
bregmadandrader, yeah, that much is clear18:40
dandraderbregma, when it comes to mir details, I know very little.18:40
bregmadandrader, we're trying to connect a client directly to the system compositor witout Unity 8, we're just having trouble finding where in the whole Unity 8 stack the mir_connect gets called18:40
dandraderbregma, it's in qtmir18:41
bregmathere is no mir_connect call in qtmir18:41
bregmaor mir_connect_*18:41
dandraderbregma, but it's all done there, one way or another18:42
* dandrader checks18:42
dandradersomewhere in src/platforms/mirserver18:42
kdubbregma, so, on startup, mir will try to connect as a nested server from options given to it18:42
kdubhavent looked into how that's negotiated, let me poke around qtmir quickly18:43
bregmathe trick is somehow it gets the environment variable MIR_SERVER_NAME and passes that to mir_connect(), but neither the enviroment variable nor the mir_connect call appear in the qtmir code18:43
kdubright mir can process that from the environment18:44
kdubor the command line18:44
kdubI don't see qtmir forcing nested mode either18:45
dandradermaybe it's in the upstart session18:46
bregmanaturally obfiscated code18:46
kdubeh, just too many ways to pass in options :)18:47
bregmathe obfuscation is that most of the functionality is implicit and elsewhere rather than explicit and readable by humans with the code in front of them18:48
bregmazen coding18:48
dandraderbregma, I think magic is in the env vars set by /usr/share/upstart/sessions/unity8.conf18:49
bregmadandrader, no, the env vars are set by LightDM, but it's how they're used that stymies us18:49
racarrIt's not obfuscated it's intentionally abstracted18:54
racarrbecause unity8 doesn't know if its running nested or on18:54
racarra real hardware platform or on18:54
racarran offscreen platform18:54
racarror whatever18:54
kdubmir_demo_server_minimal --help has all the default mir options with a description18:55
AlbertAbregma, the connect code is in the nested code within mir...specifically src/server/graphics/nested/mir_client_host_connection.cpp19:02
AlbertAthe connection name can either come from a --name cmd line option19:03
AlbertAor a MIR_NAME env variable19:03
kdubMIR_SERVER_NAME19:03
AlbertAkdub: oh right the prefix is MIR_SERVER...19:04
bschaefersoo in a sense we'll need a nest server to render into mir? Or change how USC works (which doesnt seem like a small task)19:06
bschaefernested*19:06
bschaeferas it just sits there waiting for "next_name" (which seems to be waiting for a session name of "session-0")19:07
bschaeferto say its ready to display, and no longer booting19:07
bschaeferif, instead of a mir_server I attempted just a mir client with the same session name/app name....19:07
bschaeferhow problematic would that be haha...19:08
AlbertAa mir client with a connection name of "session-0" would work assuming you have permissions to the socket19:08
bschaeferAlbertA, it has to push a frame correct? As i made a very simple client that just connected and waited for ever19:08
bschaeferand didnt do anything :(19:08
AlbertAbschaefer: why wouldn't you draw?19:10
bschaeferAlbertA, well mainly ... we just want to boot process to be over19:10
bschaeferie. we want freedom to do w/e we want on the socket :)19:10
* bschaefer just renames the spinner app the session-019:10
bschaeferand sees what happens19:10
AlbertAbscahefer: oh...does USC wait to pong lightdm until the first frame?19:11
bschaeferAlbertA, it looks like theres a hackish stuff in umm shell? Or surface observeer19:11
bschaeferwhere it waits for 2 frames to post19:11
AlbertAbschaefer: the archive version waits until a couple of frames19:11
bschaeferto say the surface is ready19:11
bschaeferyeah19:11
AlbertAyeah to work around a black frame bug....19:11
bschaeferAlbertA, i've to use an older version 15.0419:11
bschaeferyeah, but ill try renaming the spinner to session-0 and see what happens :)19:12
AlbertAyou could try just swapping buffers without drawing at all19:12
bschaeferAlbertA, well i would need to set up egl etc19:12
bschaeferthats what i was avoiding, set egl, pick the correct pf create the surface19:12
* bschaefer was being lazy19:12
kdubthere's a mir_buffer_stream_swap_buffers()19:12
bschaefernot in 15.04 :(19:13
bschaeferno 0.1319:13
bschaefermir19:13
* bschaefer should just move this dang snappy image to 15.1019:13
AlbertAin 0.12: mir_surface_swap_buffers_sync19:13
bschaeferright, but i still need egl set up19:13
bschaeferotherwise it'll do nothing (in the driver, i would think)19:13
kdubnah, it'll just think you're a software client19:13
bschaefero19:13
bschaefertrue, i was thinking i needed at lease a created mir surface19:14
* bschaefer tries that19:14
bschaeferkdub, AlbertA thanks!19:14
bschaefero no... i guess next_name is "" for me... meaning ... im never getting set_next_session ... which is what it looks like session switcher is using to figure out if19:16
bschaeferis_session_ready_for_display(next_name)19:16
AlbertAbschaefer: ummm...that comes from lightdm right?19:17
bschaeferAlbertA, yeah19:18
bschaefernow im just thinking...do i have something messed up in the confs hmm19:18
AlbertAracarr: can I get a review for https://code.launchpad.net/~mir-team/platform-api/remove-mirserver/+merge/262284 ?19:18
bschaeferthing is this is bregma USC log http://paste.ubuntu.com/11765460/19:19
AlbertAracarr: it's on top of your delete-deprecations branch19:19
bschaeferand i dont see any mention of a next session setup19:19
bschaeferbut unity8 is working hmm well ill try just making a client with session-0 and go from there19:19
bschaefermaybe i've been looking at the wrong code... ... i mean ... session switch makes sense since it talks about booting19:20
racarrAlbertA: On it19:20
bschaeferooo nm19:21
bschaefer    if (allowed_to_display_active && is_session_ready_for_display(active_name))19:21
* bschaefer missed that part19:21
bschaefersoo i have the session setup in such as way that20:03
bschaeferis_session_ready_for_display == true20:03
bschaeferAllowed to display active == true20:03
bschaeferbooting == false20:03
bschaefershow_spinner == false20:03
bschaeferbut still only 1 frame of my demos are renderering :(20:04
bschaefer1 frame renderers then goes back to a black mir server20:04
* bschaefer doesn't really under stand why only 1 frames renders ... if the session is active and ready for display20:05
AlbertAbschaefer: it will only composite the session/connection named "session-0"20:05
AlbertAany surfaces created over that connection (well probably only the first) will be rendered20:05
bschaeferAlbertA, that make sense... so i've to create a launcher in a sense20:06
bschaeferdang20:06
bschaefersoo now i need to create a new mir server to render w/e i want haha20:06
bregmabschaefer, surely all you need to do is make sure your client connects as session-0?20:08
bschaeferbregma, yeah20:08
bschaeferbut ... that would mean w/e app we now connect we need to make sure its name is "session-0"20:08
bschaeferi suppose ... that is hackable...20:08
bregmabschaefer, yeah, that's "all"20:08
bschaeferwill there be issues if more then 1 app shares the same appname?20:09
* bschaefer doesn't think so20:09
bschaefersince all demos share the same name20:09
bregmabschaefer, we do not expect that to ever happen with what we're doing20:10
bschaeferbregma, true20:10
bschaeferbut just a thought20:10
* bschaefer should have thought about doing this earlier20:10
bschaeferthough the spinner will be an issue since it'll keep opening/closing (since once the session-0 goes down it opens the spinner up)20:11
bschaeferbregma, so im just going to do, once a session is opened and the shell/window manager sees it20:11
bschaeferim going to change its name to "session-0" ... should give a free pass to all20:12
bschaeferor w/e app we write20:12
bschaeferwill need the app name "session-0"20:12
bregmabschaefer, (1) there is no shell or window managers and (2) a free pass for all is a security hole bigger than Windows itself20:12
bschaeferbregma, thats what USC does20:13
bschaefererr20:13
bschaeferUSC is the simple shell/window manager20:13
bschaefer(or attempts to be)20:13
bregmaUSC is just a compositor20:13
bregmaUnity8 is a shell and window manager20:13
bschaeferbut to make a server you need to add the shell/window manger bits (from what im reading)20:14
bschaeferbregma,20:15
bschaeferhttp://bazaar.launchpad.net/~unity-system-compositor-team/unity-system-compositor/trunk/view/head:/src/window_manager.cpp20:15
bschaeferthough i think thats just basic compositing....20:15
bregmabschaefer, all we want is an app running full screen:  no shell, no window management20:15
bschaeferright20:15
bschaeferbregma, i think we can make USC do that20:16
bschaeferbregma, yup (hacking the session-0 as the name for all new session opening works but thats just to test thats the real issue...)20:19
bschaefersoo from here...20:19
bschaeferget the SDK working20:19
* bschaefer goes back a week20:19
=== dandrader is now known as dandrader|afk
=== dandrader|afk is now known as dandrader
mcphailbschaefer: Hi. I'm still trying to be able to set the orientation to landscape for an SDL2 game on the phone. I can use the SDL_SysWMinfo to get a MirConnection* and MirSurface*, but mir_surface_set_preferred_orientation() doesn't seem to do anything useful. Any hints on what else I can try?21:15
bschaefermcphail, not sure if thats really working on pure mir21:16
bschaeferIIRC its done in qtmir but not yet done for pure mir surfaces21:16
mcphailbschaefer: the Neverball game in the store sets orientation, but I'm not sure how it does it. That is SDL2 rather than qt21:17
bschaeferhmm it must be doing something... unless it was forced in qml21:17
bschaefer(somehow)21:17
bschaeferif you force all surfaces in qml to be landscape21:17
* bschaefer isnt 100% sure how its getting landscaped through neverball21:18
bschaeferracarr, would you happen to know about landscapes and surfaces?21:18
mcphailbschaefer: it doesn't seem to have any Qt/QML at all. Just a pure SDL app21:18
bschaeferpopey, you run neverball on unity8 right?21:18
bschaefermcphail, i know it works on pure mir, not sure if you tested it out your self or if you watched popey video21:19
mcphailbschaefer: tested neverball? I have it installed on the phone21:19
bschaeferhmm and on your phone you're just running a bare mir_demo_server?21:20
bschaeferor through a *.desktop file?21:20
mcphailbschaefer: I launches through a .desktop file hook21:20
mcphailit21:20
bschaefermcphail, when i say running through qtmir/qml i mean if you're running it on the phone it goes through our qt compositor21:21
mcphailaah21:21
bschaeferso on the phone when you get a surface its composited by qtmir21:21
mcphailthe layers of abstarction are confusing21:21
bschaefervery hahaha21:21
mcphail*abstraction21:21
* bschaefer gets lost all the time21:21
popeyheh21:22
mcphailso I need to poke qtmir in some way?21:22
popey(yes, I run it on the phone)21:22
bschaeferthat im not sure, i think ... *think* qtmir/qml handles the rotation21:22
bschaeferwhich then you would request a surface for that rotation (not sure how to) or how thats handled21:22
bschaeferso when you grab the surface from SDL221:23
bschaeferthe unity8 doesnt like you messing with the "orientation"21:23
bschaefersince unity8 is what reallly controls things, all you can do is merely suggest what you want21:23
mcphailso by the time SDL2 gets the surface, the orientation is already a fait accompli?21:23
bschaeferthrough the mir API21:23
bschaefermcphail, sdl2 requests a surface from the mir server21:24
bschaeferfrom there it gets generated by the server and handed back, the W/H might be differnet as well IIRC21:25
bschaeferits all confusing :(21:25
mcphailbschaefer: you're not wrong there21:25
bschaeferi had an issue with the title eating up space21:25
bschaeferetc, but that should be handled correctly now21:25
bschaeferas far as actually getting things to rotate im not sure, and ... someone who is better versed at unity8/qtmir would be more helpful ... possibly21:26
bschaeferie. greyback would know this answer (but hes not here)21:26
mcphailbschaefer: Ha! thanks anyway. I'll lurk and post if I see him21:26
bschaefermcphail, good luck!21:27
mcphailCheers. Thanks for your advice21:27
bschaefermcphail, also if you figure your question out let me know! (would like to know how to do that as well :)21:28
mcphailWill do :). Really need to track down the neverball dev21:28
bschaeferyou can always dig through the source :)21:29
bschaeferand check the SDL calls21:29
bschaefermcphail, what it could do it do landscape on its own21:30
bschaeferie. it renders based on H/W21:30
bschaefersoo it could do that internally21:30
* bschaefer hasn't tried neverball21:31
mcphailbschaefer: from what I've made out from the source on github, there isn't anmything fancy done to force orientation. I'm not sure if that source matches the finished product, though21:33
bschaeferyou can always try apt-get source neverball to see what its like in main21:33
bschaefer(could be different)21:33
mcphailthere is a separate touch branch from the main trunck. I've had a look through the git diff for that21:34
mcphail*trunk21:34
mcphailI think I'm going to have to look again21:35
popeymcphail: good spot on the swiping in that bug22:03
mcphailpopey: does that clear up neverball for you?22:06
mcphailbschaefer: looks as if you are right about neverball. I think it is hard coded to render "fake" landscape orientation, so it isn't a general solution for all sdl apps22:23
bschaefermcphail, yeeah was afraid of that :(22:27
popeyaww22:29
popeymcphail: no, not tried, just impressed you stumbled upon that "fix"22:29
mcphailpopey: it only fixes it until you release your finger :)22:29
popeyget more fingers22:29
bschaeferMAX_FINGERS=1122:30
mcphailha!22:30
bschaeferthats bregma joke...but i think it was actually true22:30

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