murat8505 / android-xbmcremote

Automatically exported from code.google.com/p/android-xbmcremote
0 stars 0 forks source link

Optimize SQL queries without storing the whole reponse #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open Music section of the remote and try to view any of the views other
than the file view
2. Progress circle appears in top right corner of XBMC but a socket timeout
error shows before the required library information is passed on to the remote 

What is the expected output? What do you see instead?

The music library view in question

What version of the product are you using? On what operating system?

tested with 0.5 0.5.1, 0.5.2. 0.5.3 using the latest t3ch release of XBMC
on the original XBOX 9.04 r20848

Problem only occurs when using the original XBOX, have tested with XBMC on
the computer on which my media is stored without the problem occuring.

Music library is 70 gigs just under 10k songs, more information available
in the forum thread. 

Original issue reported on code.google.com by anthony....@gmail.com on 13 Oct 2009 at 3:38

GoogleCodeExporter commented 9 years ago
http://pastebin.com/pastebin.php?dl=f606c6a13

debugging log here from the albums view erroring 

Original comment by anthony....@gmail.com on 13 Oct 2009 at 6:07

GoogleCodeExporter commented 9 years ago
Attached is a proposed debug-patch, which sets the connection-/read- timeout to 
zero 
(i.e. disables the timeouts)
Furthermore, it outputs the elapsed time from "openConnection" and until the 
call 
returns. This output should make it to the debug log, and can then be used for 
further 
analysis.

:O) Mikkle

Original comment by mukkenb...@gmail.com on 14 Oct 2009 at 1:39

Attachments:

GoogleCodeExporter commented 9 years ago
Many thanks, unfortunately I haven't got a properly set up copy of eclipse at 
the
minute so I can't compile but if someone can make an apk I'd be more than happy 
to
post an updated debugging log. 

Original comment by anthony....@gmail.com on 14 Oct 2009 at 1:44

GoogleCodeExporter commented 9 years ago
Confirmed. Tested with my Xbox running pre-9.10 @ r23157, getting some timeouts 
too
with ~350 albums.

Original comment by phree...@gmail.com on 15 Oct 2009 at 7:46

GoogleCodeExporter commented 9 years ago

Original comment by phree...@gmail.com on 15 Oct 2009 at 7:46

GoogleCodeExporter commented 9 years ago
Issue 34 has been merged into this issue.

Original comment by phree...@gmail.com on 15 Oct 2009 at 7:52

GoogleCodeExporter commented 9 years ago
0.5.4 with socket timeout in preferences.

Set it to 0 for indef. timeout.

Original comment by phree...@gmail.com on 15 Oct 2009 at 9:48

GoogleCodeExporter commented 9 years ago
Whoops!
Bug in ConnectionManager - it never gets the user-set pref for sockettimeout, 
since 
prefs.getInt is not applicable to "<EditTextPreference>"
Patch attached that uses Integer.ParseInt and getString() to get the integer 
value of 
the pref.
Same approach is actually in use for http port and some other stuff.

In other words, the read-timeout is always 10 seconds no matter what the user 
sets.
Attached patch fixes this.

:O) Mikkle

Original comment by mukkenb...@gmail.com on 19 Oct 2009 at 7:49

Attachments:

GoogleCodeExporter commented 9 years ago
Shame on me for not testing. Will make it into next release, thanks!

Original comment by phree...@gmail.com on 19 Oct 2009 at 10:03

GoogleCodeExporter commented 9 years ago
From the forum:

Debug logs with 0ms timeout:

App 0.5.7
http://pastebin.ca/1634850

XBMC pre-9.10 r23858
http://pastebin.ca/1634841

That's with ~3000 albums. Seems there is a memory issue.

Original comment by phree...@gmail.com on 21 Oct 2009 at 2:52

GoogleCodeExporter commented 9 years ago
Change title

Original comment by phree...@gmail.com on 21 Oct 2009 at 2:53

GoogleCodeExporter commented 9 years ago
pasted in from forum as pr freezy's req:
Just thinking aloud here...

The Android SDK actually has interfaces for working with sqlite dbs...
Would it be possible to download MyMusic7.db from the xbmc box and store it on 
the sd 
card and then do all the queries locally on the phone?
This would remove a lot of load from the xbmc box...

That itself wouldn't solve the mem issues, but wouldn't it be possible to only 
instantiate/render the albums that are actually visible in the view, and not 
the 
whole list? - With a local db, the album views could sort of synchronize the 
visible 
albums (via an adapter) with a cursor in the result set of the local query...

- for the record, StarChild's huge collection is contained in about 24MB of 
MyMusic7.db

Original comment by mukkenb...@gmail.com on 21 Oct 2009 at 3:03

GoogleCodeExporter commented 9 years ago
I have had no problems on my xbox since 5.7 using a timeout of 30000ms 

Original comment by anthony....@gmail.com on 21 Oct 2009 at 4:39

GoogleCodeExporter commented 9 years ago
Think this one can be marked as fixed since the optimisations in 5.9 :) 

Original comment by anthony....@gmail.com on 22 Oct 2009 at 11:12

GoogleCodeExporter commented 9 years ago
So your 3000 albums list correctly now?

Original comment by phree...@gmail.com on 23 Oct 2009 at 9:35

GoogleCodeExporter commented 9 years ago
I'm the one with ~3000 albums.
It's hard to say, It does list everything that XBMC lists, so I guess it's ok 
now.
There are other problems, such as Force Stop, but I don't think they have 
anything to
do with this one.

Cheers

Original comment by bolin.andreas@gmail.com on 23 Oct 2009 at 11:04

GoogleCodeExporter commented 9 years ago
Maybe this could help

Original comment by bolin.andreas@gmail.com on 11 Nov 2009 at 5:11

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by bolin.andreas@gmail.com on 11 Nov 2009 at 5:16

Attachments:

GoogleCodeExporter commented 9 years ago
Will test library behavior with your lib, but optimizations for HTTPAPI are 
aborted.

Original comment by phree...@gmail.com on 21 Apr 2010 at 8:16