/srv/irclogs.ubuntu.com/2016/03/11/#ubuntu-app-devel.txt

=== beuno_ is now known as beuno
dev85exit02:40
dev85hello02:40
=== chihchun_afk is now known as chihchun
=== chesedo- is now known as chesedo
=== marcusto_ is now known as marcustomlinson
=== chihchun is now known as chihchun_afk
aquariusjhodapp, if I set a playlist playing from my app, and then my app gets killed, and I restart my app, how do I tell whether my playlist is still playnig?11:47
davmor2aquarius: as I understand it if the app is closed the playlist is removed from mediahub completely I would assume that, that is the case for when an app is killed too but I could be wrong11:51
aquariuswhat?11:51
aquariusso how do I kick off a playlist which keeps playing in the background then? :(11:51
aquariusmy app might get killed at any time as long as it's nor foreground. I thought the whole point of giving this stuff to the media hub rather than playing it myself was that it'd keep playing even if I got killed11:52
davmor2aquarius: aiui as long as the app is open it will remain in the media-hub queue if oom kills it the app is still technically open so the playlist remains in place it has to be closed11:55
davmor2aquarius: so no ticket in the spread anymore11:55
davmor2aquarius: jim will be able to confirm11:56
=== _salem is now known as salem_
jhodappaquarius, if your app is killed, then the playlist and everything associated with that player session is removed13:06
aquariusoh13:07
aquariusso, if I set a playlist playing, and then switch to another app, and Ubuntu kills my app, my app's music stops, and there is nothing I can ever do about that?13:07
jhodappaquarius, correct13:07
ogra_you could complain13:07
jhodapplol13:07
ahayzenjhodapp, kills or OOM ?13:08
aquariusif I lock the phone, is the app that was in the foreground before I locked it guaranteed to not be killed?13:08
ahayzenjhodapp, i thought it would continue with OOM but only stop if that app was stopped by the user?13:08
jhodappahayzen, doesn't matter, if the app is no longer running in any way, it's player session is gone13:08
aquariusspecifically: if I want to set music playing and then lock the phone, will Ubuntu sometimes stop that music playing even though I didn't tell it to?13:08
ahayzenjhodapp, so how are we going to stop music stopping when music loses its lifecycle exception ?13:08
ogra_aquarius, only if something consumes your RAM ... which could make OOM kick in13:09
jhodappaquarius, unless you run out of memory and the OOM killer kills your app, it should continue to play (assuming proper playback settings apply like repeat)13:09
ahayzeni would expect music to keep playing with OOM and only stop if music is *stopped* by the *user*13:09
ogra_(which is surely a bug somewhere)13:09
jhodappahayzen, why?13:09
ogra_ahayzen, "with OOM" ?13:09
ogra_how would you do that .... magically make more RAM chips appear when you run out ?13:10
aquariusif the OOM killer kills the media hub, obviously music will stop -- nothing that can be done about that13:10
ahayzenbecause the user selects music to play, goes to the browser, loads websites...music is killed by the OOM killer thing...13:10
ahayzeni'd expect my music to keep playing13:10
ahayzeni don't care if the UI/app has been killed13:10
popey+113:10
aquariusif the OOM killer kills my app, I would *not* expect the music it's playing to stop13:10
jhodappahayzen, if music-app or whatever app playing your music is killed, that music playback will stop13:10
ogra_ahayzen, so you would prefer that unity8 crashes but your music plays on ?13:10
aquariusthat's the whole point of having the media hub in the first place!13:10
ahayzenogra_, why would unity8 crash?13:10
ogra_ahayzen, where would you take the ram from ?13:11
ahayzenogra_, it is being played by media-hub not the music-app..13:11
aquariusogra_, absolutely I'd prefer that, yes. Why should my playing music be affected?13:11
ahayzenmedia-hub13:11
popeyogra_: you're misinterpreting13:11
popeyhe's not saying "Don't OOM" he is saying "if you OOM, don't stop music"13:11
ogra_popey, huh ?13:11
popey(given the thing that was OOM-killed is _not_ the thing actually _playing_ the music"13:11
popeys/"/)/13:11
jhodappahayzen, sure ideally, but that's not what the current implementation does...I'm not stating what a better design might or might not be13:11
ogra_if you OOM, what plays the music ?13:11
jhodappahayzen, does Android do that?13:11
ogra_OOM means there is no more free physical ram ... no way around that13:12
ahayzenogra_, media-hub plays the music ... musicapp is just a UI for it13:12
popeyogra_: the media-hub has a playlist it was given13:12
popeyogra_: no, you're hung up on the ram thing - that's not the issue here13:12
ogra_ah, so if you OOM *the UI*13:12
ahayzenso if music-app dies..media-hub has the list of tracks, shuffle, repeat etc...it doesn't *need* the music-app13:12
popeyyes13:12
ahayzenAndriod keeps music playing when the app is OOM'd13:12
ahayzenor does for the Walkman app anyway13:12
jhodappahayzen, it may need it...it's a weird situation in that case IMO13:13
aquariusConsider this: I have an Ubuntu tablet at a party, and it's plugged into speakers and running the music for the party... and I have, on the screen, the cocktail menu for the party in a web page so people can look at it. I expect that Ubutnu will suspend or kill the music app because the music app is not the foreground app (the browser is). I do *not* expect that the music will stop, when that happens!13:13
ahayzenthat's what i thought the major point of bgplaylists was with the other additional feature of the platform being able to control the queue13:13
jhodappahayzen, you no longer have full control over that session, and if it's set to play forever, how do you regain full control over it if you don't bring that app back up?13:13
ahayzenjhodapp, you select the app again in the spread..the music app is restored and session restored?!13:13
ogra_jhodapp, your indicator controls should still have control13:14
ahayzenthen you select pause13:14
jhodappaquarius, playback will not stop in that case13:14
jhodappogra_, not full control, you can change repeat or shuffle or select a new track or album for instance13:14
aquariusjhodapp, er. You just said it would; if my app gets killed, it loses its session and its playlist stops.13:14
jhodapp*can't13:14
ogra_jhodapp, but i can stop it13:14
ogra_or pause13:14
jhodappaquarius, the last situation you just mentioned did not say an OOM scenario13:14
ogra_if i re-start the UI app it should recieve the playlist again from media-hub13:15
jhodappogra_, yes and we'd need some kind of method for identifying an existing session13:15
ahayzenogra_, yeah exactly...the only time it should stop the music is if the *user* swipes up the music-app from the spread.. or they select pause13:15
aquariusso, apps are either (a) running (when foreground) (b) suspended (can happen at any time when you're not the foreground app) or (c) killed (which ONLY happens for OOM reasons)?13:16
popey(d) crashed13:16
popey(e) killed by user action13:16
ahayzene) not running/stopped by user13:16
ogra_d is a bug though13:17
ogra_(not normal behaviour)13:17
ahayzenbut the point is c != e13:17
aquariusbut there's no way of me dealing with the transition between b and c -- if my app gets suspended because it's in the background, and then becomes the foreground app, my app's session comes back, but if my app gets OOM killed while it's in the background, and then becomes the foreground app, it'll lose its session. And, importantly, Ubuntu does not distinguish between these two things for the user13:17
ahayzenin the case of c) music should continue... it should only stop in e)13:17
aquariusthe whole point of the lifecycle stuff is that your app might get killed but that's not supposed to matter, as long as the app dev is diligent about saving its state when it's backgrounded13:18
aquariusbut you cannot save your media-hub session in your state!13:18
jhodappthe other thing is, how would I detect that an app was killed vs crashed vs normally quit?13:18
ahayzenaquarius, i sense you may need some of the info we are tracking here bug 151816013:18
ubot5bug 1518160 in qtubuntu-media (Ubuntu RTM) "Once the music-app has a normal app lifecycle there needs to be a mechanism to sync the info lost during the suspend period" [Medium,Triaged] https://launchpad.net/bugs/151816013:18
ahayzenjhodapp, the StateSaver object only saves stuff when in OOM IIRC13:18
aquariusahayzen, yeah, I see we're confronting the same issue!13:19
ahayzenjhodapp, https://developer.ubuntu.com/api/apps/qml/sdk-15.04.1/Ubuntu.Components.StateSaver/ .. so that knows somehow13:19
aquariusStateSaver only saves QML properties13:19
jhodappahayzen, right, this needs to be lower level13:19
ahayzenyeah but it knows the different between OOM and app closed13:19
jhodappand anyway, it's a serious edge case13:19
aquariusif the media-hub made available a session-id or similar, then that could be StateSaver'ed13:19
ahayzenso can't the qtubuntu-media just use the same code ?13:20
ahayzenyeah or that aquarius13:20
jhodappahayzen, no idea, have never looked at statesaver13:20
aquariusof course if you try to resume a session by passing a session-id and that session has gone away, then it can't be resumed, but that's fine13:20
ahayzenyeah that seems like the best way13:20
ahayzenas there is already a session id internally with media-hub? right jhodapp ?13:21
aquariusbut killing my playback just because Ubuntu killed my app seems daft, especially since the OOM killer kills background apps *all the time* and it's currently impossible to make things continue to work in that situation13:21
jhodappahayzen, yes absolutely, that's how each dbus communication identifies a particular player13:21
jhodappaquarius, sure, but as I said before the real issue is why are you getting to an OOM situation...that should be a bug that should be fixed13:22
jhodappso this should be a real edge case13:22
aquariusit isn't.13:22
jhodappso that's a bug that needs fixing13:22
ahayzenyou could be getting OOM'd for many reasons..many real reasons13:22
ahayzeni have N tabs open, email, games, music13:22
jhodappdoesn't happen on iOS13:22
aquariusOpen music app: play a playlist. Open web browser; view web page. View web page 2. View web page 3. Music stops playing.13:22
ahayzeni'm sure it does13:22
ahayzenit happens on Android all the time13:22
jhodappI'm not saying that it might not, but I've never noticed an app get killed13:23
ahayzen'noticed'13:23
ahayzenit probably has in the background13:23
jhodapppossibly13:23
popeyjhodapp: easy to test - open two apps :)13:23
aquariusjhodapp, really? Try uploading a file to a web page. Half the time, the web page itself gets killed while you're in the Content Hub choosing the file to upload :(13:23
popey(also, happens way more on bq e4.5 than mx4)13:23
ahayzenremember apps don't take 5 seconds to start on iOS ;-)13:23
popeymeow13:23
ahayzenhehe13:24
jhodappaquarius, you're misunderstanding me, I'm not saying that it doesn't happen on Touch but it should not happen so easily and that is the real bug to fix first13:24
* popey downloads more ram13:24
ahayzenbut the real point is this is still a use case and will be forever until someone creates infinite RAM or cloud RAM or something :')13:25
aquariusjhodapp, that's the real bug to fix. It isn't the real bug to fix first, because it's completely open-ended, it'll never be entirely fixed, and everyone is screwed *until* it's fixed. If we make it so app devs can Do The Right Thing *even while the OOM killer is really aggressive*, then we can deal with the problem13:25
jhodappaquarius, sure, I'm not opposed to it however there's many things to implement on our end and we're very short staffed13:25
jhodappaquarius, I'd be happy to help you get started in implementing this13:25
aquariusso, we'd need media-hub to not decide to kill a session just because its app goes away, and to provide some way of an app "reconnecting" to that session if the app has the session ID13:27
ahayzensurely somewhere in mir/qtmir/somewhere it knows if the app has been OOM killed/closed ?13:27
ahayzenas keeping *all* the sessions around just in case an app uses the same ID doesn't feel too efficient13:28
aquariussecurity problem there, perhaps, unless it's possible to tell that "this app talking to me now is the same app that was talking to me before, even if it's got a different D-Bus endpoint because it was killed and restarted"13:28
jhodappaquarius, yes, so you'd need some way of an identifying and app to a player session and getting that back to media-hub when it tries to restore a session13:28
aquariusahayzen, you only need to keep the session ID around for *the currently playing music*13:28
ahayzenah yeah..i guess13:28
ahayzencurrently playing on the multimedia role :-)13:28
jhodappaquarius, yes indeed, this is not a simple thing...I've thought through it a bit before and we'd want a proper architecture and security review13:29
aquariusI am perfectly fine if this happens: start music app, tell it to play playlist, OOM kill music app, (music keeps playing), start game, game plays music (stopping the playlist), restart music app, music app tries to resume session, media hub says "no such session".13:29
ahayzenjust take the APP id + session id as the identifier13:29
aquariusthat's fine -- the music got stopped explicitly by the user13:29
ahayzenaquarius, yeah that makes sense13:29
aquariusif there is such a thing as an "app id" on D-Bus, then that'd work, ahayzen13:30
jhodappaquarius, he means the apparmor app id, right ahayzen?13:31
ahayzenmedia-hub knows it is com.ubuntu.music playig?  thought ?13:31
ahayzen*i thought13:31
jhodappyes13:31
ahayzenso use that + session id13:31
jhodappthat would probably work13:31
aquariusya, but you don't want a newly installed different app to be able to use that ID, and there's no way to prevent that, is there?13:31
ahayzenthat (sil.music-app, 1) != (com.ubuntu.music, 1)13:31
ahayzen*then ...(i can't type today)13:31
jhodappaquarius, that's enforced via the click package13:31
aquariuswe don;t actually even need a session ID, then, do we? Since there's only one active session. So just use the app ID *as* the session ID?13:31
aquariusmusic app just keeps the app ID that started this session around.13:32
ahayzenaquarius, but do we want a way to say yes restore or no we want a new session13:32
aquariusahayzen, ya, you'd want a resume: True property on Audio13:32
aquariusand if you *wanted* to start a new one, you'd set resume:False13:33
ahayzenhmmm is that on MediaPlayer?13:33
jhodappahayzen, you could have a flag on the new session dbus method13:33
aquarius(or maybe it's a resumeSession() method on MediaPlayer and Audio, whichever)13:33
ahayzenyeah anything like that could work13:33
ahayzenand in that same session could the method return the info for bug 1518160 ;-)13:34
ubot5bug 1518160 in qtubuntu-media (Ubuntu RTM) "Once the music-app has a normal app lifecycle there needs to be a mechanism to sync the info lost during the suspend period" [Medium,Triaged] https://launchpad.net/bugs/151816013:34
jhodappaquarius, so we do have detach_session and reattach_session methods in media-hub today13:35
ahayzenso resumeSession() then returns {"played": [1,2,3,4]} or something13:35
jhodappaquarius, they need debugging however as things don't resume perfectly13:35
aquariusahayzen, those would be properties on the QML object(s) rather than returned from a method, but yeah13:35
ahayzen:-)13:36
aquariusjhodapp, sounds like most of this is already done from an architecture point of view; it just needs the dots to be connected?13:36
aquariusthat's pretty cool13:36
jhodappaquarius, and these methods take the app id and a unique session id into account13:36
jhodappaquarius, yes indeed13:36
ahayzensweet :-)13:36
aquariusjhodapp, is the unique session ID actually needed?13:36
ahayzenare you allowed two MediaPlayer objects in the same app ?13:37
ahayzenor two Audio{} ?13:37
aquariushuh13:37
jhodappaquarius, I don't remember...I didn't write this code (ricmm did) and it's been a long while since I've looked at it13:37
ahayzenwhat happens if i want two audio sounds playing13:37
aquariusI figured they'd be part of one session13:37
aquariusbecause you can't play two sounds simultaneously13:37
aquariusyou can play two SoundEffects, but not two Audios13:37
ahayzenah cool13:37
aquariusbut maybe I'm wrong about that13:37
jhodappaquarius, you can play two sounds simultaneously, depends on your audio role13:37
aquarius(or maybe you can't but you *should* be able to :))13:37
ahayzenfor multimedia, maybe you shouldn't13:38
jhodappyou can't for multimedia13:38
jhodappthat's always true13:38
ahayzenbut you can see a case for games or alerts13:38
jhodappabsolutely13:38
aquarius*nod* multimedia is what we're thinking of here13:38
aquariussure, but alerts are the alert role; those don't have a session because they're fire-and-forget13:38
jhodappaquarius, let me point you to the code I'm referring to, one min13:38
aquariusjhodapp, completely separate question: when playnig back an ogg vorbis file on Bq E4.5 it's stopping playback/dropping out for a short time every few seconds. What do I need to look at to work out why?13:39
jhodappaquarius, here you are: http://bazaar.launchpad.net/~phablet-team/media-hub/trunk/view/head:/src/core/media/service_skeleton.cpp#L12113:40
aquariusI'm not likely to be able to help much with C++ stuff; I'm not clever enough :)13:40
ahayzen:-)13:40
jhodappaquarius, is this over the normal phone speaker?13:40
aquariusyup, normal phone speaker13:40
* ahayzen has Uni work todo..but later in the year if this is still a problem..maybe i'll take a look ;-)13:41
jhodappaquarius, I'd be curious what the system load looks like during this as well as the specific CPU usage of media-hub-server13:41
aquariusmight be worth linking to this conversation from the bug, ahayzen?13:41
ahayzenyeah, into bug 1518160 ? or a separate one?13:41
ubot5bug 1518160 in qtubuntu-media (Ubuntu RTM) "Once the music-app has a normal app lifecycle there needs to be a mechanism to sync the info lost during the suspend period" [Medium,Triaged] https://launchpad.net/bugs/151816013:41
aquariusjhodapp, what's the best way to get that data? top?13:41
jhodappaquarius, yes or even slightly better, install htop13:42
jhodappahayzen, let's change that bug description to be more specific, something like: "If music-app is killed by the OOM handler while playing music, it's player session should continue to live on"13:43
ahayzenjhodapp, ok, i've added a comment with the IRC log13:44
ahayzenupdated bug 1518160 :-)13:44
ubot5bug 1518160 in qtubuntu-media (Ubuntu RTM) "If music-app is killed by the OOM handler while playing music, it's player session should continue to live on and info lost during the suspend period needs to be exposed" [Medium,Triaged] https://launchpad.net/bugs/151816013:44
jhodappahayzen, thanks man13:44
aquariusjhodapp, while playing (and getting the minor dropouts), media-hub CPU is at 6.3%. Pulseaudio is at 11%. The dropouts are fairly regular (that is, they happen every 4-5 seconds)13:55
ahayzen_aquarius, have you tried different ogg files ?14:01
aquariusI have14:01
ahayzen_maybe it is how that one is encoded14:01
aquariusI thought of that :)14:01
ahayzen_we have had weird stuff happen with different encodings14:01
aquariusmight be an encoding thing, I suppose14:01
aquariusI'll have a fiddle with my avconv line :)14:01
ahayzen_not sure if turning the debug on media-hub/gst would help ?14:02
jhodappaquarius, out of curiosity, does it drop out on an Ubuntu desktop using a client that uses gstreamer?14:02
jhodappahayzen_, possibly14:02
aquariusit does not drop out on an Ubutnu desktop in totem14:03
jhodappaquarius, try this: "stop media-hub; GST_DEBUG=*:3 CORE_UBUNTU_MEDIA_SERVICE_VIDEO_SINK_NAME=mirsink CORE_UBUNTU_MEDIA_SERVICE_AUDIO_SINK_NAME=pulsesink media-hub-server"14:03
jhodappaquarius, make sure to quit and restart music-app14:03
aquariusdoing that now14:03
aquarius(it's not actually music-app, it's my app, but I'm restarting it as expected, and we'll see what happens)14:04
jhodappyup14:04
aquarius0:01:06.740346927  5065   0xff1d80 WARN                   pulse pulsesink.c:702:gst_pulsering_stream_underflow_cb:<audio-sink> Got underflow14:04
aquariusthat seems to be thrown when there's a dropout14:05
jhodappaquarius, seems like a bad encoding14:05
aquariuscool. I will do different encodings until I find one that works then!14:05
jhodappaquarius, or the ogg decoder in gstreamer isn't that great14:05
aquariusit also writes a shedload of:14:05
aquarius0:01:36.421771083  5065   0xfc0280 FIXME                    bin gstbin.c:4075:gst_bin_query: implement duration caching in GstBin again14:05
aquariusi am happy to use some other format14:05
jhodappaquarius, yeah I see that in a lot of different decoding scenarios14:06
aquariusI was worried that some phones might not have mp3 support out of the box?14:06
aquariushence choosing vorbis14:06
aquariusbut if there's some better idea, I'm happy to change14:06
jhodappaquarius, they will all have mp3 support out of the box14:06
ahayzen_is mp3 in the /ubuntu image? or only in the device ones with their extra binaries ?14:06
aquariuseven third party ports?14:06
ahayzen_i thought the /ubuntu images were 'pure' OSS14:07
jhodappaquarius, not sure about the 3rd party ports14:07
aquariushence not wanting to use mp3 ;)14:07
aquariusI'll fiddle with the avconv vorbis parameters14:07
* ahayzen_ adds FLAC to the argument ;-)14:07
jhodappaquarius, investigate that though just to make sure14:07
aquariusyay, encoded with oggenc rather than avconv and changed the quality and now no dropouts. Thank you jhodapp14:21
jhodappaquarius, awesome, np14:21
ogra_kool kids use flac anyway :P14:21
ahayzen_\o/14:21
aquariusI don't need lossless for this :)14:22
ogra_hwo else do you fill your externnal SD then o_O ?14:22
jhodappor stay warm with your portable heater phone ;)14:22
=== ahayzen_ is now known as ahayzen
=== chihchun_afk is now known as chihchun
=== salem_ is now known as _salem
=== _salem is now known as salem_
=== salem_ is now known as _salem
=== _salem is now known as salem_
=== salem_ is now known as _salem
=== chihchun is now known as chihchun_afk
=== _salem is now known as salem_
=== salem_ is now known as _salem
=== _salem is now known as salem_
=== JanC_ is now known as JanC
=== salem_ is now known as _salem

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