Archive

Android Media File Madness on the Nexus 4

February 10th, 2014 No comments
This entry is part 4 of 4 in the series Nexus 4

Background

A few weeks after getting my Nexus 4, I noticed strange behavior with ringtones, notification sounds, and Google Music player. The symptoms of the problem were an odd combination of three basic issues:

  1. Ringtone and notification sound files started appearing in my Google Music player.
  2. The phone would lose custom ringtone and notification sounds after a reboot.
  3. The “Media Browser” wouldn’t see my custom ringtone or notification sound files when I tried to restore them.

The really annoying part of this problem was that it constantly changed and was impossible to recreate with any regularity. By this I mean that if I lost my phone sounds I could sometimes go and restore them via media browser. But other times the files wouldn’t appear in the list. Then if I moved the files from one directory to another they would start to work again, but get lost after a reboot. Then, at times, only some of my notification sounds appeared in lists and others didn’t, even though all the files were in the same directory!

I spent the better part of three hours searching forum posts all over the web and found many similar complaints going all the way back to the Gingerbread days. There were all kinds of conflicting suggestions. For example:

  • Some posts insisted that custom ringtones be put in a /Ringtones directory in the root of the internal SD card (typically /storage/emulated/0/Ringtones). Similarly, they suggested a /Notifications directory for notification sounds.
  • Other posts insisted that the files had to be in a /media/audio/ringtones (or notifications) directory on the SD card.
  • Other posts suggested that one needed a rooted phone and that the files should be dropped in the /system/media/audio/ringtones (or notifications) directory with the stock sound files.
  • As for preventing Google Music Player from indexing the sounds, there was some insistence that a .nomedia file needed to be placed in the ringtones and notifications directories.

What was really killing me is that all of this advice worked and yet none of it did. For example, my files were in the /system/media/audio directories to begin with, when they stopped working properly. I copied them to the /Ringtones and /Notifications directories and they suddenly appeared in my media browser list so I could set them as rings and sounds. But then they started appearing in my Google Music player. So i added a .nomedia file to the directories and most (but not all) of the files disappeared from Google Music (two remained visible) but all disappeared from my custom sound selections and could not be added back by normal means. Then I moved the files back to /media/audio/ringtones or notifications and suddenly they again appeared in the list of available notifications and ringtones, but they also appeared back in Google Music player. I was ready to chuck my phone out of the window.

As is so often the case, forums for Android issues (and for most other technology to be fair) are full of half-baked ideas, wild theories, speculation, and downright wrong advice. After all the conflicting advice I did finally fix my problem. Here’s how.

My Environment

Because all phones and versions of Android are different, your mileage may vary, but unlike most posts I will at least tell you how my phone is configured so you can judge for yourself if it’s similar enough for you to try.

Hardware: Nexus 4, 16GB

OS: Stock KitKat 4.4.2 (KOT49H)

Kernel: Franco 3.4.0 (5 January 2014)

Root: Yes. SuperSU.

The Problem

After all the investigation I concluded that the problem had something to do with the Android media scanner. It was clear that it was scanning after reboots since the files were appearing and disappearing, but something was causing it to no longer follow the rules. Like not indexing files in the ringtones directories for Google Music player. I tried several apps from the Play Store to trigger the scanner but none of the first four I tried worked in KitKat. Some did absolutely nothing. One was so slow it would have taken days to index my phone.

So I decided to start over. That meant wiping the existing data and re-indexing. Here’s how I did it.

The Solution

  1. Decide where you want your files. I don’t think it matters, but since my files were in the /system/media/audio path I left them there.
  2. Wipe out the existing media scanner information by going to: Settings/Apps/All/Media Storage. Click Clear Data.

    ClearMediaCache

    Clear Media Cache

  3. Trigger re-scan of the device. You could just do this by rebooting and waiting for it to finish, but I found an app that works: SD Scanner by Jeremy Erickson worked brilliantly. It’s simple, free, there are no ads, and he makes his source available. He’s my new best friend. Plus it has a progress bar so you know it’s working. Exactly what a simple and great app should be.

    SD Scanner Really Works

    SD Scanner Really Works

And what do you know? It seems to be working. No crap in my Google Music app and my ringtones and notification sounds persist after a reboot (actually several). What a royal pain in the ass, but in the end, not too hard to fix. Good luck. I hope this helps you.

Categories: Technology Tags: ,

New Nexus 4 – Day 2

January 17th, 2014 No comments
This entry is part 3 of 4 in the series Nexus 4

Yesterday I received my new phone, wiped it, updated the OS to Android 4.4.2 Kit Kat, rooted it, and installed a custom recovery (TWRP).

This morning I dropped by my local T-Mobile store on the way to work and completed the process of getting my phone working. The first step today was to get a SIM card that actually fit in the phone. I probably could have bought a cheap cutter on EBay and cut my own card down to size, but it’s actually hard to find a mini to micro SIM cutter. There are plenty of full-size to micro cutters, but few, if any, mini to micro cutters. I also figured that a trip to T-Mobile was in order so they could verify that my IMEI was truly clean, and that my old data plan actually supported LTE.

The young woman at T-Mobile was both totally competent and extremely efficient. I walked in, told her I wanted to activate a new phone and needed a SIM, and she had me walking out with a working phone in less than 10 minutes. Oh, and they didn’t charge me a thing. I’ve been a T-Mobile customer for close to 10 years and I have honestly never had a bad customer service experience.

I walked out of the store with 4 bars of “H” or HSPA+ service. My next task was to add a hybrid radio to enable LTE. Again, although one could flash hybrid rmodems the old fashioned way, someone has already built a toolkit to automate the process. It worked pretty well, but I did discover a very slight bug in the toolkit which prevented the flashing of the most recent hybrid modem version. The toolkit developer fixed that bug within hours thought and released a new version to the Play Store.

So after the flash, I saw the “4G” icon on my screen and I was able to do a speed test, which gave me 20 Mbps up and down. Not bad, but certainly nothing close to the advertised LTE speeds. But – there are several different modem revisions to try and one of them may perform better. Plus this test was done at 10:30 in the morning in downtown Boston where there were likely a lot of users sharing bandwidth. And finally, even though this phone has an LTE radio, people believe that because it wasn’t intended to be activated, the antenna wasn’t made in the most efficient fashion. So it might never perform as well as a phone designed with LTE in mind.

But nonetheless, I bought a used phone on EBay for $200. The phone was as clean as advertised and was able to be rooted without issue. I added a custom recovery and some hacks to enable a crippled LTE radio. And what I have is a very well built, high- quality Android phone with LTE speeds and the latest Kit Kat software for $203.50. That’s not bad at all.

Categories: Technology Tags: ,

New Nexus 4 Experiment – Day 1

January 17th, 2014 No comments
This entry is part 2 of 4 in the series Nexus 4

The package arrived today. So far, everything looks good. Buying a phone from EBay always seems like taking a chance, but so far, this seems like a bargain. This phone is in near perfect condition – there’s not a mark on it. I plugged it in and let it charge for about an hour which restored about 25% battery. It fired right up to the default Android JellyBean screen. It had clearly been factory reset, but I reset it just in case, taking the phone back to 4.2.2.

I added my Wi-Fi password and it connected without problems. Then within 5 minutes it alerted me that an OTA update was available, which I installed without an issue. A few minutes later I received another OTA update offering the 4.3 update which also installed perfectly. Finally, in another few minutes the OTA icon offered the 4.4 KitKat update which installed flawlessly. So, within 30 minutes out of the package I’m running the latest Android OS available. So far, so good.

One of the reasons I bought a Nexus 4 for cheap instead of a Nexus 5 was that I know LTE can be enabled on the Nexus 4 with a variety of hacks. But to do that you need root access, so rooting the phone was step #2.

I’ve had lots of fun rooting devices using Fastboot commands in the past. If you’ve never done it, I recommend rooting the old fashioned way (see http://forum.xda-developers.com/showthread.php?t=2018179 for instructions) at least once, since you do get an idea of what actually needs to be done to accomplish it. But frankly I’ve had enough command line fun for one lifetime so when a decent toolkit exists to get the job done I’ll use it.

There appears to be two main toolkits competing for attention on XDA Developers at the moment: one created by a developer called “WugFresh” at http://forum.xda-developers.com/showthread.php?t=2517778 and one created by “mskip” located at http://forum.xda-developers.com/showthread.php?t=1995688. After reading the full threads I chose WugFresh’s toolkit. Why? Well at the time I write this, mskip’s toolkit only worked with KitKat 4.4.2 if it auto-updated to the latest version, and the only way to enable that was to pay a fee (a “donation”) and get a key from the dev. Only based on this post and this post, some users had waited more than 5 days and still hadn’t received their key and the developer was nowhere to be found in the thread. No way I was chancing that. So WugFresh wins the day.

I watched the instructional video at http://www.wugfresh.com/nrt/wiki/ and followed it as closely as possible (the screens for installing the drivers are different in the newer version of the toolkit, but easier to use so no big deal). Short version of the story – it worked absolutely flawlessly. Seriously, no issues whatsoever. A few button clicks and I have a phone with SuperSU root access, BusyBox installed, TWRP custom recovery, and still running 4.4.2 KitKat. What more could I want?

Next step – tomorrow I get a new LTE-enabled micro-sim card (I only have a mini sim in my current phone) and install a new radio to turn LTE on. We’ll see how it goes.

Categories: Technology Tags: , ,

A New Android Chapter

January 12th, 2014 No comments
This entry is part 1 of 4 in the series Nexus 4

I hate the iPhone. There, I said it. I really, really do. It’s not a particularly good smartphone, regardless of the generation. iOS is an incredible inflexible operating system (widgets? Hell no!) and the phone itself is loaded with proprietary connectors (can you say Thunderbolt) and processors the same as everyone else. Nope – I’m an Android person, plain and simple.

A couple of years ago I smashed my old T-Mobile G2 because the dying GPS finally got to me and replaced it with an HTC Amaze 4G. The battery life was terrible as I wrote here, but after a while the phone settled down (after I rooted it and installed a real ROM) and has been my daily driver for more or less two years. The short version is that the main problems had nothing to do with the hardware and little to do with Android. As usual, they were software problems introduced when a phone manufacturer wants to try and be Apple. Almost no one offers a true Android phone these days. Most manufacturers take stock Android and load it up with all kinds of extra junk. HTC has their “Sense UI.” Samsung has “TouchWiz.” Both of these and all similar “improvements” do nothing more in my opinion than take a perfectly good Android device, slow it down, reduce battery life, and generally make it hard to manage a device because they add so many proprietary settings and hide so many stock ones that I might as well buy an iPhone. I hate them all. I hate my wife’s Galaxy S3, I hate my friend’s HTC One, and I couldn’t stand the Sense UI crap on my Amaze so I finally rooted it and installed Cyanogenmod 10.1 as my daily driver ROM. I’ve never looked back. From now on it’s stock Android (or at least close to it) for me. Which leads me to my new adventure …

New Phone Needed

One main problem with the HTC Amaze is that it wasn’t popular. The Samsung Galaxy S and later S3 stole the thunder from the Amaze and this device signalled the beginning of HTC’s downfall. What a shame because I have always liked HTC devices. For as long as I’ve had smartphones I’ve used HTC devices. I’ve had:

  • an HTC Herald (T-Mobile Wing) Windows Mobile phone
  • an HTC Maple (T-Mobile Dash 3G) Windows Mobile phone
  • an HTC Desire Z (T-Mobile G2)
  • an HTC Ruby (T-Mobile Amaze 4G)

The problem with a phone that isn’t popular is that aftermarket developers don’t do a lot of work on it. Custom ROMs can be hard to find, as can quick and simple tools for rooting etc. I won’t make that mistake again, which means that I probably won’t be buying an HTC phone again any time soon. So what does that leave? Well, in the Android world, if you want something that gives the purest Android experience, you buy one of the Nexus devices that Google markets itself.These phones run stock Android. I like them a lot. But I don’t like the current $350 price for the 16GB Nexus 5. That’s a tad too much for me.

The good news is, Nexus devices are popular with the kinds of people who develop custom ROMs for phones, so there is always support for older generations of Nexus devices. Meaning that enterprising people already have Kit Kat running on the previous generation Nexus 4. So that is what I am going to do … but a used Nexus 4 and bring it to life as a full-featured daily-driver with all the bells and whistles. I’ve found what looks like a good one on EBay and I won the auction last night for $203.50 including shipping. The phone should be here this week.

In a nutshell, here were my criteria:

  1. Google Nexus device.
  2. Either carrier unlocked or already on the T-Mobile network.
  3. Clean IMEI.
  4. Close to new condition.

Having found all that I believe that with some work I can root and install Cyanogenmod (or another ROM) and patch the radio in the phone to work on the T-Mobile LTE network and end up with a phone that performs as well as any brand new off-the-shelf phone for under $250. Plus have a lot of rooting fun along the way.

So, look for some upcoming posts about my progress. And hopefully I will have a new phone by next Monday.

Categories: Technology Tags: , ,