A fix for missing artwork and phantom songs on iPhone!
I have been having problems for a while now with album artwork on my iPhone. I have music from a variety of sources: purchased from iTunes, purchased from Amazon, purchased from Google, whole albums ripped from CDs, miscellaneous MP3s downloaded from the web or from my son's music library. The music was collected over a period of years and was ripped at different rates and it is apparent from looking at the info ("get info" in iTunes) that at least two different types or versions of tags for the songs / albums are being used. I have never had iTunes convert bitrates for my music.
The history of my problem is, roughly:
1. Some artwork was missing from my iPhone after having previously been OK. Tried to resync and got:
2. "Grayed out" or "phantom" songs. All the songs were listed on my phone in light gray font and could not be played. Recovered with delete and sync, after which:
3. I could play music again but even more artwork went missing, and incorrect artwork was displayed for most albums, so I deleted all music from my iPhone and resynced at which time:
4. All the artwork on my phone disappeared. Throughout all of this the artwork was visible and correctly associated for my music library on iTunes.
After reading through 13 pages of a discussion thread viewed over 100,000 times by others likely as frustrated as I have been, I think I understand the problem. Credit and thanks go to krs10 who pointed to a published resolution of a different problem with similar weird symptoms on 12/4/2012 and to PatNY who posted details about how to fix the problem on 12/5/2012, 12/10/2012 and 12/13/2010. In the interest of helping anyone suffering from these frustrating and seemingly disparate symptoms, this is an attempt to consolidate and repeat the good information I found.
Symptoms: Album artwork is fine in iTunes, but some or all album artwork is missing from iPhone; incorrect artwork isdisplayed for some albums; music is listed on iPhone but is "grayed out" and cannot be played.
Root cause: Corruption of database file, "MediaLibrary.sqlitedb" on the iPhone.
Solution: Rename or delete, "MediaLibrary.sqlitedb" to force iTunes to rebuild the database on the iPhone. (Note that merely deleting the music left the database file intact on my iPhone.) Some people have reported success deleting and resyncing their music but, having done it once with no luck, I made a point of examining the database file after I deleted all music and saw that it remained intact with information about all the music that had just been deleted; consequently I think that it must be removed to ensure the problem is fixed.
Step-by-Step Procedure:
1. Back up your iPhone to your PC using iTunes.
2. On your PC, download and install iFunBox, a free utility that will allow you to access the system files on your iDevice;
3. On your iPhone, go to Settings\General\Usage\Storage\Music and swipe and delete All Music. (I'm not sure this is necessary, but it worked for me.)
4. Turn off your iPhone, then restart it.
5. Put your iPhone in Airplane mode so it will not be disturbed while syncing.
6. Make sure iTunes is not set to start automatically when a device is connected and close it on your PC if open.
7. Run iFunBox and connect your iPhone via cable to your PC. Look for the "iFunBox Classic" tab and click on it.
8. Connect your iPhone via cable to your PC.
9. Your device will appear under "Connected Devices" in iFunBox.
10. Navigate to the file, "MediaLibrary.sqlitedb" in folder "Raw File System>iTunes_Control>iTunes."
11. Rename, "MediaLibrary.sqlitedb" to, "MediaLibrary.sqlitedb.backup." (Note: Do not rename or delete, "MediaLibrary.sqlitedb-shm" or, "MediaLibrary.sqlitedb-wal." Neither of these are the file you're after!)
12. When done, eject / dismount your iDevice from iFunBox, then disconnect the cable.
13. Close iFunBox. Reboot your device again by turning power off and back on. (Again, may not be necessary, but after spending weeks trying to get this problem fixed, I figured another two minutes wouldn't hurt.)
14. Start iTunes on your PC and reconnect your device to the sync cable.
15. Sync your device. When done, be sure to eject / dismount your iPhone from iTunes before disconnecting the cable.
16. Take your phone out of Airplane mode.
17. Check to see that your album artwork has returned.
Discussion: The basic problem appears to manifest itself in many different ways and appears to be aggravated by certain conditions, like, perhaps, having iTunes down-convert high bit-rate songs. I suspect that the database file is getting corrupted on a very wide scale and regenerating it as described here would fix a lot of problems I've read of. I don't know for sure how the file gets corrupted, but I plan on being diligent in ejecting / dismounting my device after connecting it to iTunes. In previous clumsy treatment, I very likely interrupted a sync and I think this is as likely a cause as any for database file corruption. FWIW, I don't think the problem is neccessarily associated with any particular device, version of device firmware nor version of iTunes. But if you had a bad DB, a change in device code or iTunes code seems likely to aggravate it. It looks to me like this has been happening to people for years now. What I don't understand is why Apple has not adequately responded to the issue and published steps to correct it.
I'm very pleased to have my long-standing artwork problem fixed: all the artwork on my device has never looked better! Thanks again to krs10 and to PatNY!!