Jump to content

music players fix (yes, all!)


Recommended Posts

Guest The Limit
Posted (edited)

Everyone knows the infamous bug that the core libary of android doesnt sort artists correctly.

Right now my artist list for one album is

Accelerator ft. Radiate & Beatstream -> Angels deserve to die -> Trashing my scene

Accelerator ft. Firestone -> Angels deserve to die -> I don't care

Paul Elstak ft. Accelerator -> Angels Deserve to Die -> Angels Deserve to Die

Whereas it should be

Paul Elstak -> Angels Deserve to Die -> the three songs.

This is because android uses the artist tag instead of album artist tag. I already sent it to Cyanogen, who has commited it to 5.0.8, but since Cyanogen does not do Desire (kinda weird, seeing as it is as popular as the N1).

Anyway, a huge amount of people is annoyed by this bug, and i present the fix (posted on XDA by me as well):

http://forum.xda-developers.com/showthread.php?t=694903

So modaco, please commit this in your build, for it is a stable fix! All there is to left to fix on the music player after this is genres and (not really needed) an equalizer.

(Anything beyond this is from google code, the guy talking is rainwoodman)

Further study shows it is more complicated than a few lines of changes.

The definition of MediaStore will be relevant. They are putting all stuff into one

database during scanning.

I wasn't able to find the source code for MediaStore. But I suppose the change would

be in where they build the database and determine 'ArtistID' from ArtistName.

This is where they refer to the database:

http://android.git.kernel.org/?p=platform/...41ce091;hb=HEAD

The column names are declared in MediaStore, imported on line 46. No clue where to

find it. The class is also imported in

http://android.git.kernel.org/?p=platform/...3e370fd;hb=HEAD

Then:

Tracked down to this line:

http://android.git.kernel.org/?p=platform/...d;hb=HEAD#l1454

Who the hell is calling MediaProvider.insert ?

Then:

The problem is on the following line of MediaScanner.java(link in comment 6).

Simply replace these lines

(THIS IS THE COMMENT 9 SPOKEN OF IN THE FIX IN THE END)

 680			  // use album artist if artist is missing

 681			 if (mArtist == null || mArtist.length() == 0) {

 682				 mArtist = mAlbumArtist;

 683			 }


----replace with ----


  681 if(mAlbumArtist != null && mAlbumArtist.length() != 0) {

  682		  mArtist = mAlbumArtist;

  683	}
will solve the problem. I do not have the 6GB free space to build and test the changes. Someone look at this issue; at least merge it to Cyanogen Mod! then he gets to: http://android.git.kernel.org/p=platform/p...providers/media /MediaProvider.java;h=cbc4f9411e48fd725bd245172e81d55633e370fd;hb=HEAD Around line 2410, the same-album heuristic is wrong. Then he concludes to: Further traces down to these lines:
1477				 synchronized(albumCache) {

1478					 int albumhash = path.substring(0, path.lastIndexOf('/')).hashCode();

1479					 String cacheName = s + albumhash;

1480					 Long temp = albumCache.get(cacheName);

1481					 if (temp == null) {

1482 

						albumRowId = getKeyIdForName(db, "albums", "album_key", "album",

1483								 s, cacheName, path, albumhash, artist, albumCache, uri);

1484					 } else {

1485						 albumRowId = temp;

1486					 }

1487				 }

Folder name is definintely not the right rehash key to use. Shall use Album artist & year

& number of tracks & release & cd number here.

His final fix is:

Two modifications towards a full fix:

0. revert the temperory fix on comment 9.

1. put albumartist (default = artist) to values in mediascanner

2. int albumhash = values.getAsString("albumartist") + values.getAsString("year") +

values.getAsString(".......")...... in media provider

Google code links:

http://code.google.com/p/android/issues/detail?id=3679

http://code.google.com/p/android/issues/detail?id=2397 (less relevant)

Edited by The Limit
Guest Climbatize
Posted

Good job mate, hope Paul will include it in next release :)

Guest TheScrub
Posted

Slightly off topic here but has anyone else noticed that the android contacts app (not HTC) doesn't sort contacts correctly either?

Guest The Limit
Posted

Any way to push this in pauls vision so it gets added into all modaco builds pronto? It isnt just a fix for the desire -it fixes the music player on all android devices, as well as all 3rd party music players relying on android (think Mixzing etc.). imho this should be semi-high priority.

Guest The Limit
Posted (edited)

BUMP (sent paul a PM, he still hasnt replied, so i will keep on bumping untill he adds it into Modaco rom)

Edited by The Limit
Guest trashjunkie
Posted
BUMP (sent paul a PM, he still hasnt replied, so i will keep on bumping untill he adds it into Modaco rom)

I too want to see this fix included

Guest djtosh
Posted

ye would be good to see this fixed, shame theres no flashable zip to update to it

Guest The Limit
Posted

heh seems support is rising for this fix ^^

Also, remember to go to the google code page and star it, if you have a google code account. That way it gets more attention from the devs as well, meaning it'll get added into the standard rom faster as well.

Guest The Limit
Posted (edited)

bump (read above if wonderwing why so many bumps)

Edited by The Limit
Guest privatesam
Posted
bump

Is there anyway to implement the change in code manually on a rooted android device (I have a rooted Milestone). This Album Artist problem is killing me. Basically can I dive into the system files and change the code?

Guest privatesam
Posted
Is there anyway to implement the change in code manually on a rooted android device (I have a rooted Milestone). This Album Artist problem is killing me. Basically can I dive into the system files and change the code?

Errr - read the post fully Sam. Ok so I need to do the fix in comment of the google code thread and then the 2 other changes afterwards - just a little confused because in the original post it says "revert changes in comment 9"...

Guest The Limit
Posted (edited)
Errr - read the post fully Sam. Ok so I need to do the fix in comment of the google code thread and then the 2 other changes afterwards - just a little confused because in the original post it says "revert changes in comment 9"...

You need all the fixes. However, read carefully.

The comment 9 fix is a tempoorary workaround.

In the end, you still need to fix mediascanner (which is being edited in comment 9), only know as described in the final fix instead as the way it was done first. So instead of actually changing the code, you just replace mArtist with mAlbumArtist and vica versa.

You also need to fix the mediaprovider. If you do get this fix working, please upload your ROM, or the latest modaco rom with the fix. I would really, really like to have it.

Edited by The Limit
Guest The Limit
Posted

btw, also messaged Paul.. again.. he still hasn't replied. atm he seems like a rather rude fellow, ignoring a fix when it is presented for him on a plate.

Guest The Limit
Posted

rebump.. will keep bumping untill mod gets angry, so this fix is atleast noted by Paul. There is a craving need for it.

Guest Formel-LMS
Posted

I think, we need this fix.

Hoping that Paul can implement it in his ROMs.

@TheLimit:

Know I know, that you know many over android.

Could you look, how to change the code what makes the WiFi Slow when the screen is off? We can't hear any Livestream, because WiFi gets too slow for it.

Guest The Limit
Posted
I think, we need this fix.

Hoping that Paul can implement it in his ROMs.

@TheLimit:

Know I know, that you know many over android.

Could you look, how to change the code what makes the WiFi Slow when the screen is off? We can't hear any Livestream, because WiFi gets too slow for it.

I'm not certain since i'm not that into the networking codebase of android, but i think it is due to battery conservation. as soon as the screen goes off, a lot of processes get either frozen in memory or severy slowed to get atleast a decent amount of battery life. I guess its the same for wifi, although im not sure.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.