Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android App sucked all my high speed data plan #647

Closed
florie1706 opened this issue Jun 11, 2018 · 30 comments
Closed

Android App sucked all my high speed data plan #647

florie1706 opened this issue Jun 11, 2018 · 30 comments
Labels

Comments

@florie1706
Copy link
Contributor

florie1706 commented Jun 11, 2018

Hi @pliablepixels ,

I switched to Multi-Ports, so I tested zmNinja if it works from outside my local network. That was around noon today. After that I closed zmNinja, so it was in the background with the "exit app in background" option activated. But it seems, that this did not work as the app sucked 1.4 GB within a couple of hours.
I was not at home during that time, so I was just connected to my mobil data or my work wifi.

Attached I send you the current log:

@pliablepixels
Copy link
Member

Can you please do this:

  1. Start zmNinja, go to logs, delete everything
  2. from the logs screen, kill the app by terminating it using android's usual app terminating mechanism (don't use zmNinja exit menu)
  3. Start zmNinja, go to Montage Screen
  4. Wait for 5 seconds
  5. Make it go to background. Wait 20 seconds.
  6. Get into zmNinja and send me logs

thx

@florie1706
Copy link
Contributor Author

florie1706 commented Jun 11, 2018

zmNinja version:1.3.005 (android)
ZoneMinder version:1.31.44

@pliablepixels
Copy link
Member

Thanks, the important part is

1:Jun 11, 2018 06:15:21 PM INFO App is resuming from background
2:Jun 11, 2018 06:14:52 PM DEBUG DataModel: killing live stream ck:148463
3:Jun 11, 2018 06:14:52 PM DEBUG DataModel: killing live stream ck:966185
4:Jun 11, 2018 06:14:52 PM DEBUG Killing all streams in montage to save memory/nw...
5:Jun 11, 2018 06:14:52 PM DEBUG MontageCtrl: onpause called

line 2-4: It should be killing all the streams before exiting

Can you increase the time it is paused in your test and see if your network monitor still shows the app sucking data?

@florie1706
Copy link
Contributor Author

florie1706 commented Jun 11, 2018

zmNinja version:1.3.005 (android)
ZoneMinder version:1.31.44

@pliablepixels
Copy link
Member

pliablepixels commented Jun 11, 2018

Thanks - did you check if your network data was being consumed while in background during the 2nd logs?

@pliablepixels
Copy link
Member

pliablepixels commented Jun 11, 2018

confirmed - need to investigate. For now, please turn off background cellular data for zmNinja in android settings->data usage

@florie1706
Copy link
Contributor Author

was about 100 MB, so yes, mobil data was consumed again :(

@pliablepixels
Copy link
Member

can you send me an email - I have a debug version I'd like you to test. pliablepixels @ gmail

@pliablepixels
Copy link
Member

@florie1706 - please test the debug apk and once you confirm it consistently works without consuming NW bandwidth in multiport mode, we can close this

@pliablepixels pliablepixels changed the title Android App sucked all my high speed data plan Android App sucked all my high speed data plan (multiport mode) Jun 12, 2018
@florie1706
Copy link
Contributor Author

@pliablepixels I tested it the last 8 hours and background data seems to be okay right now. It just increased by 100kb which is ok for that period and a couple of foreground to background switches.

@pliablepixels
Copy link
Member

I just released 1.3.006 with this fix - please delete the debug app and re-update from the app store

@xenoxaos
Copy link

xenoxaos commented Jun 13, 2018

Hey asker, it looks like this happend to me as well. 1.6G of background data (on a limited plan too). I'm currently on 1.3.006
screenshot_20180613-050805 luckily my plan restarts the 16th...

@pliablepixels
Copy link
Member

Xenoxaos do you have multiport enabled?

@pliablepixels
Copy link
Member

Pushed 1.3.007 that force quits the app in android when moved to background. The core problem is the browser controls image streaming and in some situations doesn't seem to stop pulling data even when in background

@DamnJack
Copy link

Got zmNinja running with zoneminder this morning and it's plowed through about a gig of mobile data. Running 1.3.007, will tell you if I have multiports configured once I find out. Didn't explicitly set any options with that name.

@DamnJack
Copy link

I have not enabled multiport; I'm running the app installed from Google Play.

@pliablepixels
Copy link
Member

pliablepixels commented Jun 28, 2018

  1. can you confirm how much of this is background data?
  2. When you switch to background, is the app still running in the task bar (should have exited)

The 1.3.007 patch logs a "force exiting app since its android" and quits

@DamnJack
Copy link

zmNinja had used 1.32GB in the background before I disabled background data for the app. I currently have a cached background instance of zmNinja, but no other indication that it is running. If I open it and press the home button, I see a second cached instance of it that remains until I reopen the app, and "formally" exit it.

@pliablepixels
Copy link
Member

Can you post the logs which capture a case when you move the app to the background?

@DamnJack
Copy link

If you can tell me which logs specifically you need. This is my first time contributing feedback to an android app, but I'm a hardware and firmware engineer (so general debugging background) and can do my own googling, once I know what you're after.

@pliablepixels
Copy link
Member

pliablepixels commented Jun 29, 2018

@DamnJack zmNinja logs.

  1. Launch zmNinja, tap menu->logs. Delete all all logs (trash icon)
  2. Go to Montage screen, stay there for a few seconds
  3. Go to background, stay in background for 5-10 seconds
  4. launch zmNinja again
  5. Go to logs, send me logs (email icon)

Good to know you have a debugging background, so let me explain what I'm doing. When you move the app to the background, I detect if you are running on Android and forcibly exit the app. So in your app, if I see "force exiting app since its android" show up in logs, then my code handler is called, but for whatever reason the exit function is doing nothing in your case. Which will be my next debugging step.

@pliablepixels
Copy link
Member

ARGH there was a typo in the code. @DamnJack please send me an email (pliablepixels @ gmail). I have a test version for you.

pliablepixels added a commit that referenced this issue Jun 29, 2018
…r 5 sec, if exitApp did not work, removed redundant multiport exit app
@pliablepixels pliablepixels changed the title Android App sucked all my high speed data plan (multiport mode) Android App sucked all my high speed data plan Jun 29, 2018
pliablepixels added a commit that referenced this issue Jun 29, 2018
@DamnJack
Copy link

Looks like that took care of it; I sent you a log for good measure.

@DamnJack
Copy link

Looks like a bit of residual data in the background, but only a couple of kB at a time

@pliablepixels
Copy link
Member

Good to know. The logs you sent me don’t show a background and resume action so I’m not sure which of my fixes worked in your case. Would it be possible to send logs again? ( launch app, delete logs, go to bkgrnd, wait 20s, start app send logs). Thx.

@DamnJack
Copy link

Done. I assume by "go to background" you mean hitting the home button, as opposed to manually exiting zmNinja?

@pliablepixels
Copy link
Member

pliablepixels commented Jun 30, 2018

Yes, thanks.

@pliablepixels
Copy link
Member

I'll be making a 1.3.008 release soon - I'll keep this issue open for a few days - if I hear no further issues on this after release, I suppose we can consider it closed.

@DamnJack
Copy link

Sounds good. You'll note here when it's on the play store so I can switch back to it?

@pliablepixels
Copy link
Member

Just pushed 1.3.008

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants