Log in or register to post comments

Samsung Galaxy S4 Slow initialize

October 1, 2013 - 10:06pm #14

Hello everyone,

I developed a customized version of  ImageTargets. And my main problem is, when i try it on Galaxy S3 , the initialization of the camera is fast. But when i try the same app in Galaxy S4 its taking really a lot of time just to initialize the camera and open the camera preview. 

S4 is 4.2.2,  and S3 is 4.1.2.

Does anyone have any idea about the reason? Do others have similiar problem like this with S4? Can it be a hardware issue?

Thanks

Samsung Galaxy S4 Slow initialize

October 2, 2013 - 12:16am #13

Could you provide exact model number of your S4 ?

(you can find the Model Number in your Device Settings).  Also, is it an S4 "Mini" or regular one ?

 

 

Samsung Galaxy S4 Slow initialize

October 2, 2013 - 1:15am #12

Its GT-I9500. and Its a regular one.

Samsung Galaxy S4 Slow initialize

October 2, 2013 - 1:27am #11

Thanks for this.

Our tests on S4 do not show any specific issue; for example, on a GT-I9505 performance are perfectly aligned (or even better) with S3 devices.

It might be something specific with GT-I9500, but could you provide some numbers, e.g. measuring time of initialization on S3 vs. S4, with indication of exact step of intialization that are slow ?

(Some reference to the relevant code where the application consumes more time would help, for instance between CameraDevice.init() and starting of Tracker, or other...)

 

Samsung Galaxy S4 Slow initialize

October 3, 2013 - 1:30am #10

Hello again,

 

I think the problem is happenign with android 4.2.2, because i tried with Sony Xperia Z which is using 4.2.2 and i came across the slow initializtion incident too.

I did some Logging and found out that the code piece below is causing the wait on 4.2.2,

 

 

if (mInitQCARTask != null
				&& mInitQCARTask.getStatus() != InitQCARTask.Status.FINISHED) {
			
			mInitQCARTask.cancel(true);
			mInitQCARTask = null;
		}

 

 

Samsung Galaxy S4 Slow initialize

October 3, 2013 - 6:42am #9

Ok, thanks, this is very helpful information;

what is weird however is the fact that the code you mention is only executed when the Activity is destroyed, so it should not be executed during initialization phase;

could you double check that this is actually the code ?

also, do you have some figures / numbers (even approximate) about the time spent on that code on your devices ? (on 4.2.2 and on others) ?

 

Samsung Galaxy S4 Slow initialize

October 8, 2013 - 5:26am #8

Hi

The waiting is happening during the  InitQCARTask AsyncTask execution. It waits for the onPostMethod to be called. So i guess the waiting happens during the execution of QCAR.init()

 

On S3 and Nexus S, it takes approx 1000-1500ms. But on Galaxy S4 and Xperia Z it takes around 4500-5000 ms

Samsung Galaxy S4 Slow initialize

October 8, 2013 - 7:41am #7

Thanks for this details.

Could you verify if you have Internet connection (and network ON, Wifi or other) on each of those devices ?

I tested on a Sony Xperia Z and I observed the following results:

- QCAR.init() takes about 1000 - 1500 ms when the network is enabled, on the first run (i.e. first time after installing the App)

- QCAR.init() takes about 100 - 200 ms (much faster) when the network is disabled, or when running the same App a second time (i.e. run the app the first, time, then exit via Back button, then restart the app)

 I also got similar results on S4, which seems to indicate that this could simply be related to the downloading of the DeviceProfile and/or other network operations that are done by QCAR on initialization (if network is available).

 

Samsung Galaxy S4 Slow initialize

October 9, 2013 - 12:07am #6

Hi again,

When i try with the internet disabled its very fast comparing to while they are online.  But unlike you said, its not faster after starting it for once, it is the same slow speed of initializtion no matter how many times you restart the camera preview (on S4 and Xperia Z). 

The thing i dont understand , why is it faster (while its connected to internet) on Galaxy S3 and Nexus S than Galaxy S4 and Xperia Z? And what can i do to make the initialization faster on S4 and Xperia Z? Any suggestions?  

Samsung Galaxy S4 Slow initialize

October 9, 2013 - 1:12am #5

it is the same slow speed of initializtion no matter how many times you restart the camera preview (on S4 and Xperia Z). 

 

I have repeated the tests on both Samsung S4 and Sony Xperia Z (both with Android 4.2.2 installed), and here is what I consistently get:

Test 1:

  • uninstall the App (Image Targets sample) from device,
  • enable network connection (Wi-Fi), and verify that internet connection is actually working (e.g. browsing internet)
  • install and run the App

Test 1 Results (on very first run):

  • QCAR initialization time (until reaching the onPostExecute method):  between 1050 and 1550 ms (values are variable as I repeated this test several times, and with both S4 and Xperia Z)

Test 2: 

  • after running Test 1, and still with network ON, exit the App by pressing Back button (until getting back to your device home screen) 
  • re-run the App

Test 2 Results:

  • QCAR initialization time (until reaching the onPostExecute method):  between 50 and 200 ms (values are variable as I repeated this test several times, and with both S4 and Xperia Z)

Test 3: 

  • uninstall the App from device
  • disable network connection  (verify network is really OFF, including any WiFi or other wireless network, by trying to browse internet)
  • re-install and run the App

Test 3 Results:

  • QCAR initialization time (until reaching the onPostExecute method):  between 50 and 150 ms (values are variable as I repeated this test several times, and with both S4 and Xperia Z)

Could you check if you have executed the tests in the same way ?

 

Note: on top of this, the total initialization time is also affected by the Loading of Datasets, which can add another 1500 - 2000 ms; this is however quite similar across devices in the category S3, S4, Xperia.

So, total init time can be around 3-4 seconds.

Samsung Galaxy S4 Slow initialize

October 11, 2013 - 12:46am #4

Hi,

Test 1 Results (on very first run):

  • Galaxy S4: 5000-6000 Ms
  • Galaxy S3: 1500-2000 Ms

Test 2 Results:

  • Galaxy S4: 4500-5000 Ms
  • Galaxy S3: 1000-1500 Ms

Test 3 Results:

  • Galaxy S4: 1000-1500 Ms
  • Galaxy S3:  500-1000 Ms

I tried the tests as you wrote and the results are like above before. As long as it is connected to internet it takes  approx 5-6 seconds to finish initialization. Doesnt matter how many times i repeat it, go back to homescreen etc. Also the Dataset is not big, it has only two images. They are  5 stars targets.

I am still very confused why can i get much faster opening in inferior phones , but getting very slow init for the phones like S4 and Xperia Z.

Can there be a way of optimizing the init procedure?

Samsung Galaxy S4 Slow initialize

October 11, 2013 - 1:16am #3

Are the S3 and S4 connected to the same wireless network ? 

 

 

Samsung Galaxy S4 Slow initialize

October 11, 2013 - 1:23am #2

yes

Samsung Galaxy S4 Slow initialize

October 11, 2013 - 8:16am #1

Ok, thanks for confirming.

We'll keep an eye on this issue, but as per my previous tests, I cannot reproduce the behaviour you observe,

i.e. on S4 (and Xperia Z as well), the init time are much faster on second run (i.e. after the first run) and then remain consistently fast (close to S3 values).

 

Concerning your question:

Can there be a way of optimizing the init procedure?

The samples show how to perform such initialization asynchronously already, but there is no specific way of "optimizing", if you mean "speeding it up".

 

 

Log in or register to post comments