08
Jan
Scratcheddisk

If you're an audio perfectionist, you've surely stumbled onto flac, an audio compression format designed to deliver lossless recordings. The file sizes are considerably larger than your average MP3, but the sound quality is unparalleled by lossy compression algorithms. It's not hard to see why audiophiles drift towards flac as their preferred storage medium. Now imagine the latest version of Android is causing stuttering, cracks, pops, and static in the otherwise perfect playback of flac.

1148-38795-s6o6DG7F4zEWJyD-upload

Symptoms

Audio players on Android 4.4 through 4.4.2 will produce snaps, crackles, pops (heheh), and various other imperfections during the playback of .flac files. The timing of these disruptions is pretty random and seems to get worse over time. Some devices are more prone to demonstrate this behavior than others. For example, I could barely identify any problems on a Nexus 5, but it was easy to hear on a Nexus 4 and 2012 Nexus 7. Under the hood, the CPU usage will also go up substantially, which can cause some mild warming of the device and faster battery drain.

The Cause

The issue appears to have been caused by migrating to Clang and turning on a feature called ftrapv, which is used to capture integer overflows and reduce the potential for unexpected errors. It's not entirely clear how this change caused the bug, but it may simply add too much overhead for the hardware to maintain a steady playback.

A Fix Is Coming

Unlike so many posts in this series, a fix was found and published by the Android team within days of the first report. However, the timing was a little unfortunate. While the patch was merged into the master branch on November 26th, it was not included in the Android 4.4.2 OTA that rolled out 2 weeks later. It's likely that the fixes originally scheduled for that OTA had already been chosen and put into final testing before this bug was identified. The fix is now part of the master branch, so it will definitely appear in an upcoming update, whenever that is.

Workarounds

Since the problem exists in Android's native flac codec, which is used by most of the music players available, finding an alternative app with its own custom implementation will easily solve the issue. One of the options mentioned is the beta version of VLC for Android. Those in the United States can get an apk to sideload from the VideoLAN nightlies page (and optionally join the beta program) while international users can download it directly from the Play Store.

Update: Neutron has also been recommended. It should be more stable and won't require those in the US to go through the extra steps. Thanks, Arthur Brownlee IV.

Another option might be custom ROMs built from AOSP. It's likely that groups like OmniROM and CyanogenMod have already incorporated the aforementioned patch some time ago. Of course, if you're not already using a 3rd-party rom, this probably isn't a good enough reason to start.

Wrap-Up

Overall, this is pretty good news for audiophiles. A fix is coming and there are perfectly serviceable alternative players that will work in the meantime. The OTA for Android 4.4.2 shipped just about a month ago, so we might even see a fix in the near future.

Thanks, bubbleguuum

Sources: AOSP Issue Tracker, Reddit

Cody Toombs
Cody is a Software Engineer and Writer with a mildly overwhelming obsession with smartphones and the mobile world. If he’s been pulled away from the computer for any length of time, you might find him talking about cocktails and movies, sometimes resulting in the consumption of both.

  • Jonathan Jin

    lol'd at the "rice crispies" tag

    • http://www.androidpolice.com/author/cody-toombs/ Cody Toombs

      Good catch! People don't usually notice when I hide a joke in the tags :)

      • Cheeseball

        Unfortunately, it's spot on with what my FLAC albums sound like on my Nexus 5. :(

        • Jonathan Jin

          Me too. For the longest time I thought there was a piece of earwax or something stuck to the drivers that was causing the buzzing...

          (I know, gross.)

          • Karen Mitchell

            саrօlіոe.­&nbspі­&nbspаgree­&nbsptհаt­&nbspFred`s­&nbspаrtісle­&nbspіs ­&nbspіmрressіve,­&nbspі­&nbspjսst­&nbspgօt­&nbspа­&nbsptօр­&nbspօf ­&nbsptհe­&nbsprаոge­&nbspMаzdа­&nbspаfter­&nbspհаvіոg­&nbspmаde ­&nbsp$9701­&nbsptհіs-lаst/4­&nbspweeks­&nbspаոd­&nbspіո­&nbspexсess­&nbspօf­&nbspteո-grаոd­&nbsplаst­&nbspmօոtհ.­&nbspіt's­&nbspасtսаly­&nbsptհe­&nbsp mօst-сօmfօrtаble­&nbspjօb­&nbspі've­&nbspever­&nbspհаd.­&nbspі­&nbsp stаrted­&nbsptհіs­&nbsp4­&nbspmօոtհs­&nbspаgօ­&nbspаոd­&nbsp іmmedіаtely­&nbspbegаո­&nbsptօ­&nbspbrіոg­&nbspіո­&nbspmօre­&nbsp tհаո­&nbsp$83...­&nbspрer-հr.­&nbspі­&nbspfօllօw­&nbsptհe­&nbspdetаіls­&nbspօո­&nbsptհіs­&nbsp strаіgհtfօrwаrd­&nbspwebsіte,...&nbspWW&#x57&#46Googleproject2014activitybusinessgetnowactivitybusiness&#46&#113&#x72&#46&#x6E&#101&#x74&#x2F&#109&#x4Bl&#106/

            ✦✦✦ ✦✦✦✦✦ ✦ﴪ✦✦ ✦✦✦✦ ✦𐄱✦✦People can barely hear me. I got a second nexus but the problem persisted so i think it is a software one

  • nickS

    about time it brakes my nerves everytime i listen music

  • Raloc

    workaround: use 320kbps mp3s instead and quit being a huge audio nerd thinking that flacs provide any sort of demonstrable difference in practical use

    • Guest123

      your hearing must suck ass if you can't tell the difference. or you have shit headphones/speakers.

      • lljktechnogeek

        Try running it through a double-blind test one of these days. You'd be surprised how much the expectation of quality plays into the perception thereof.

        • Arthur Tyler Shaw

          You're wrong. I've heard the same Kid Cudi album on in AAC and one in FLAC. The highs are more piercing in half the tracks on the album. Otherwise I could only tell the difference on about half the tracks.

          • lljktechnogeek

            Was this a double-blind comparison? Because you didn't specify, and that was kind of the point of my comment.

    • https://plus.google.com/108596272537415356460/posts Jason Farrell

      FLAC *does* make a difference, assuming you have the good ears and the cans to appreciate it. But yeah - if you're over 40-ish and/or use crappy earbuds, stick with 320kbps mp3. :)

      • Guillaume ‘XpLoDWilD’

        I recommend DT770 Pro, and no Beats """""studio""""" :-P

        • https://plus.google.com/108596272537415356460/posts Jason Farrell

          Wearing my 1-year-old pair of DT880 Pros as we speak :). Awesome neutral sound. Had some Sennheiser-HD-something before that.

          • Arthur Tyler Shaw

            I got DT880 600 ohm premiums. I can tell the difference between FLAC and .mp3 compression. These people need to grow better ears.

      • Thomas Kunert

        Have you ever verified this by doing a blind test? The audiophiles at http://wiki.hydrogenaudio.org/ have given up on testing the quality of 128kbps because hardly anybody would notice any difference as compared to lossless. And this is under optimal conditions, using optimal equipment. I'm pretty sure there are very few people on the planet who could tell a mp3 with 192kbps from lossless, assuming a recent encoder of course. The only reason to store audio recordings losslessly would be if you plan some kind of post-processing or recompression. Even 320 kbps is overkill if you just want to listen to it.

        • ithehappy

          You have earned the biggest facepalm from Mr.Norris.

          • lljktechnogeek

            Why?

        • XDAMM

          No, just no. Do yourself a favor and listen to Machine Head's "Halo" on 128 kbps and then listen to it on 320 kbps. The difference is immediately noticeable.

          • lljktechnogeek

            You've primed yourself to expect a difference, so of course you're going to see one.

            (You're also inserting different numbers than Thomas did -- he said 192, you're saying 128. But really, the priming effect is going to be far more significant.)

          • Thomas Kunert

            Why would I? You are the one claiming there is a difference, so you either can keep up an unconfirmed claim, or you can confirm this by doing a double blind listening test. I have done this stuff for years, and yes, with a high-end combination of ears (not mine), equipment, and audio track people can tell a difference at 128. But the result was far too sparse to be statistically meaningful. Audio encoders have come a long way in the last 20 years.
            Besides, I don't have that CD around, and of course you have to start lossless when doing listening tests.

        • andy_o

          Have you ever verified this by doing a blind test?

          I'm betting no.

          Doing a double blind (ABX) test is very easy with something like foobar2000. There are some very rare samples that can be detected even at 320kbps and almost all of them, if not all, are from hard metal or industrial music, pretty much the opposite of what audiophiles claim (that classical music is the best to do so). Never seen a classical sample that has been detected.

          • Adrian

            See the following link

            http://www.music.mcgill.ca/~hockman/documents/Pras_presentation2009.pdf

            It concludes that a few expert listeners can diferentientae between mp3/320 and CD and some trained listeners can discern 160kbps from uncompressed.

            It only takes one person to be able to consitently detect the difference to prove your assertion incorrect.

          • andy_o

            First of all, that was not an ABX test. It was a preference test. But I'll take it at face value just for the sake of argument.

            Secondly, and more importantly, can you quote anything in those slides that contradicts what I wrote?

        • Mike Reid

          I believe those blind tests are true. Under their ideal conditions.

          I'm as far away from an audiophile as it gets; $100 speakers are fine by me.

          But there are technical pluses to lossless audio files. You have less worries about using decoders with defects for example.

          There are many stages in modern high end smartphone audio chains. Each one of these can munge things up, doing various forms of audio processing.

          Too many processing stages in a row is much worse than just one. An inaudible defect can become audible.

          IMO we have enough bandwidth, CPU/audio processing power and storage space these days that the additional sizes shouldn't matter too much. Though I do understand that some people have very large collections and insufficient space or bandwidth.

      • shonangreg

        I've made comparisons at varying bitrates for LAME mp3's, using medium-quality headphones. 128 to 160 was obvious. Room ambiance and fingerprint ridges moving over the guitar strings was distinct. 160 to 192 was much harder to distinguish. I could hear a difference in the sound of foot taps on a wooden deck (raised stage). I couldn't hear any differences beyond 192. I figured with better hardware, maybe 224 would be the ideal encoding choice. Classical music had been shared at 256, which I saw as the upper limit.

        Seeing 320kbps mp3's now just makes no sense to me. The files are needlessly large.

        I'd say encode 224 to 256. If you want higher, flac is the obvious choice.

    • JosephHindy

      Lol love how these other people are all like "all you need is a decent pair of cans" like a decent pair of cans doesn't cost $800 or anything. Super expensive habit being an audiophile. Most normal people can get by on 320kbps mp3.

    • ithehappy

      You see why I really hate idiots? and fanboys?

  • baza58

    I have this issue with mp3 files too. It's really annoying.

  • Primalxconvoy

    Just another reason why Google simply can't make good audio software. Their android media scanner is awful (no folder playback support) and now this.

    The best way for me to enjoy my Android is to avoid things that rely on it, do I'm glad that I use a third party music player.

    • Guillaume ‘XpLoDWilD’

      What's the link between mediascanner, and playing back a folder?

      • Primalxconvoy

        From what I gathered from emails from devs, an app that uses android's internal media scanner for music couldn't show music playback in "folder view". It could only show artists, albums, etc. It would also scan only the folders it wanted to and not ones designated by the user.

        Third party music apps circumvented this by using their own media scanners for their apps, which then solved these problems.

        • Guillaume ‘XpLoDWilD’

          I can't tell you the exact procedure right now, but there's a way to gather the paths of objects read by MediaScanner and then use regular external storage access to read the directory (thus avoid running your own media scanner). That's hack-ish, but you got to admit most of us sort our tracks in folder-per-album or folder-per-artist, or do playlists instead of moving around tracks in folders :) (I'd be curious to hear other use cases however)

          • Primalxconvoy

            I think a large enough amount of users use this. That's why there is the feature in many music players.

          • Deep

            Dude, not a related topic but I saw you have managed to boot Kitkat on a mt6589 device which is just huge; can you give us more details like is that a manageable daily driver or what sort of problems you need to fix to release a build.

          • Guillaume ‘XpLoDWilD’

            It's indeed off-topic, but to reply simply, it's months away from being stable.

  • John Smith

    multimedia bugs suck big-time. I'm still hoping that Samsung eventually fixes their *massive* Visualizer bug ! How this can remain broken for so long is mind-boggling :

    http://developer.samsung.com/forum/board/thread/view.do?boardName=GeneralB&messageId=238327&frm=7&tagValue=S4&curPage=1

    it seems like they're dragging their feet - or don't care to fix it.

  • Ron

    What about the low sound during calls?

    People can barely hear me. I got a second nexus but the problem persisted so i think it is a software one

  • Severo Rivera

    Finally, I thought I was the only one hearing this.

  • Joshua Hill

    I've had this issue for over 2 years on my galaxy S2. Ever since Android 2.3 but only on some flacs, they work perfectly on multiple other devices so it's not the files.

  • deltatux

    Similar problem is occurring when playing AAC files too, so it seems like this problem is not only a FLAC issue. MP3 has no issues though.

    • b0b

      It's a different problem. Do not associate all your audio problems to the one discussed here which is specific to how the FLAC decoder was compiled on KitKat.

      • deltatux

        Even though it exhibits the same symptoms? could be that libaac was also compiled with similar methods.

  • Alex James Simon

    I just use the Google Play All-Access 320kb streams with my amp and my Sennheiser HD558s sounds great to me.

  • lljktechnogeek

    I am laughing at all the audiophiles in this thread who don't understand or flat-out reject the concept of double-blind testing. It's like watching a bunch of people over what color crystals are best for past life regression therapy.

    • CrazyManDan

      I can't tell the difference between a 1.2Mbps FLAC and a 320Kbps MP3 file of the same track through my $20 headset, but it's not necessarily just about audio quality. The simple fact is that that data exists for a reason; it may not be a difference your ears can hear, nor may it be a difference your setup will allow you to hear, but if you're purchasing digital music from a market where MP3s and FLACs are the same price - or if you're ripping physical discs manually - I cannot fathom the logic behind actively choosing a lossy file with 2/3rds of the data missing.

      You can always down-convert to a lower bitrate file if you want to stuff more tracks onto a device, but you can never get back the data you don't have. You can always buy a more expensive set of cans or a player with a better DAC, but that won't mean a thing if the file you're piping through it isn't all there.

      • lljktechnogeek

        There's nothing wrong with stuff like "keep a FLAC copy for archival, stick 320k MP3s onto the portable device". It may be overkill unless you change preferred audio formats very often, but it's hardly a bad thing.

        My problem is more with the "I can hear every single difference between the FLAC and the MP3 no matter what the double-blind testing claims, and that's why i'm spending five grand on an old PlayStation 1 with magic rocks glued to it" crowd. Basically, if you think "ABX-free" is a good thing, you're pretty much automatically a moron.

        • CrazyManDan

          Having never owned a headset more expensive than $50, that world is foreign to me. However, there are definitely things I can hear that other people cannot, so if someone says they can tell the difference, I have no direct proof to refute that; we're all built differently. If however someone argues they can hear differences while staunchly refusing to even attempt any sort of blind testing, then they're probably just in the placebo bubble and afraid to burst it.

          Personally, I like to listen to the music, not the file. My insistence upon the maintenance of a FLAC library comes mainly from being something of a digital hoarder.

          • lljktechnogeek

            "I can hear it even if you can't" is pretty much the perfect situation for a double-blind test. If you can still pick out which file is which under such circumstances, that's certainly a pretty strong bit of evidence for the claim. And if you can't, then that's a pretty good refutation right there.

            But it seems like we're in agreement on that topic anyway.

    • TheOnionOfTwickenham

      Nonsense. The most basic premise of good audio is "garbage in, garbage out" but you need the equipment to realize that your source is garbage.

      I have a recording of Wagner overtures recorded at 320K MP3 on my Samsung phone. It sounds perfectly OK when I listen to it through the cheap supplied earbuds.

      I then tried listening to the same recording playing through my Cambridge Audio Sound Magic 6, into my Roksan Caspian M3 pre/power amp and out through my Monitor Audio RS8's - a system worth about $10K. It was so dreadfully compressed and dire that I had to stop it after about 5 seconds - and no, I wasn't thinking about whether it might sound awful when I started playing it.

      By contrast the 96K 24-bit FLAC recordings I play through through the same system present a beautiful sound stage and sound natural. There is nothing in the least subjective about it.

      • lljktechnogeek

        So did you ever bother trying to set up a double-blind or not?

        Because just because you're not actively thinking about how it might sound doesn't matter. Merely knowing that one is an MP3 and one is FLAC can be enough to color your perceptions if you've already been made to believe that the latter typically sounds better than the former.

        • Arthur Tyler Shaw

          I'm sorry technogeek but I have to agree with him on this one. It truly depends on your hardware to appreciate FLAC files. If you lack the hardware necessary to play them back (a decent DAC) and an amplifier you may as not well collect FLAC and just listen to your 320kbps files and crap earbuds. It's not our fault we like to hear music the way it was supposed to sound without artifacts. Technogeek go invest yourself a setup that is worthy of lossless audio then come back before you tell everyone to ABX if you have no clue of what benefits lossless audio provides.

          • lljktechnogeek

            Thanks, but I'd rather not risk wasting thousands of dollars on a placebo.

          • Arthur Tyler Shaw

            A placebo? There are real technical advantages that FLAC has over .mp3. Without the proper hardware to decode lossless files there's no point in simply using your Realtek AC97 motherboard DAC to try and find a difference. I know you like to be the devil's advocate but even recording engineers will tell you that compression will make artifacts noticeable when comparing the .mp3 track to the .WAV 24-bit studio mastering. You can't argue against science this isn't a placebo and should be evaluated using THD software and graphs to present these differences in dynamic range.

          • lljktechnogeek

            Yes or no: have you attempted any double-blind testing whatsoever?

          • Arthur Tyler Shaw

            I haven't conducted one officially. But I will make a video on youtube for you just to prove my point right. There is a perceivable difference if you have the hardware for it. To those who can't tell the difference there really isn't any point to having FLAC tracks if you aren't planning on using the right tools. It's like trying to play golf with broken clubs.

          • http://the-jade-domain.com Jaime J. Denizard

            Let's please @lljktechnogeek:disqus, shall we? Make an mp3 from a FLAC, grab whoever's next to you right now and have them play them both to you a couple of times and see if you can pick out the FLAC one reliably.

          • Arthur Tyler Shaw

            Before I make this video, I really do think you should consider that FLACs simply sound better than .mp3 files. People will look back on .mp3 just like people will at 1080p when video moves to 4K. Well anyways give me some time but I will have my friend over who isn't an audiophile but appreciates the difference my Beyerdynamic DT880s have made on his perception of music.

          • http://the-jade-domain.com Jaime J. Denizard

            I don't believe @lljktechnogeek:disqus is saying FLAC doesn't offer advantages over mp3, I think he's just saying that for him (or anyone else), the perceived difference in quality of spending more money on a sound system and choosing FLAC over mp3 is just a placebo effect, until the person decides to do an ABX and actually confirm that they can tell the difference.

          • TheOnionOfTwickenham

            Ah. So you don't need to listen to confirm your opinions but everyone else does, and when someone says "well actually, yes, I can clearly hear a difference" you say that they are engaging in self deception? I don't know how to reply to that, sorry.

            As for "listening to the music" at least perhaps we can agree that this is the objective. The single best recording I have is a vinyl pressing of Joni Mitchell's album "Blue" recorded over 40 years ago. It is warm, immediate and above all it is musically electrifying and utterly engaging. Would it sound OK on MP3? I don't know. But I know that the huge dynamic range of Wagner is too much for MP3 as was clearly demonstrated to me by the horrendous compression I menmention above.

            I'd also have to say (like some other people here) that compression is sometimes not about the format but about the recording. I remember many years ago buying a CD album by "Lighthouse Family". It sounded fine on my car radio but when I played the CD on my system it was just a noise, compressed to an inch of its life. But presumably that was just all in my mind and it actually sounded great?

          • lljktechnogeek

            Yes or no: have you attempted any double-blind testing whatsoever?

  • Stanley Chan

    KK 4.4.4? Wow cabalistic number?

  • jurrabi

    In my personal opinion, flac is a waste for anything other that an advance dedicated sound system (something in the 4 zeros price-range).
    Using them with an android device as source, with their poor sound hardware is just a waste.

    That being said (sorry couldn't keep it) I'm really pissed as how much Android is regressing in very basic functions since 4.3. At least for my personal experince with my HTC One X.

    I have had issues with headset volume adjust, Bluetooth sound quality and stability, now this flac stuff... And I've tested a great bunch of roms: stable, nighties, Senses, AOSP, CM... no-one is good enough.

    Because I use my phone a lot as an audio source (music, podcasts) at work, car, home I had to revert to a stable 4.2.2 senses roms that simply gets the basic done right.

    Now I can do stupid stuff like:
    Receiving calls in the car and listen through Bluetooth EVERY TIME.
    Fast and stable connection for Bluetooth audio.
    After a call phone call phone goes back to what I was doing, and doesn't stay in the phone app I didn't open.

    And lot of stupid stuff that is mundane but neglected by google and/or ROM assemblers...

    So nowadays I'm not in a hurry to upgrade anymore.

  • Magneira

    Not a problem with .flac stored on google play music, I´ve had no issues on my Nexus 5 or Nexus 7, and my friend too does not have any issues with his nexus 4. Maybe this is only for local files or google does something with .flac audios when you pin then for offline usage.

    • uniquename72

      It's local files. When you store a FLAC on GPM, it doesn't play back a FLAC for you; it transcodes your files to 320kbps MP3s.

  • Michael

    Also, on the Nexus 4, HTC One, and Nexus 5 (probably others), you'll hear popping sounds in the middle of songs on Play Music. If I downgrade to Android 4.1 on any of these phones, the popping stops.

    Also, in Minecraft Pocket Edition, whenever you break or place wood, it pops. This is also on all of these phones, and only on 4.2+. Not on 4.1.

    • Michael

      Doesn't happen on the Nexus 7 2012 though. I haven't tried on the Nexus 7 2013.

  • milden

    little offtopic but if i close an app on my nexus 5 with the back key it sometimes opens an app which i opend a few hours ago. is this a bug?

    • http://the-jade-domain.com Jaime J. Denizard

      I think so. That's been happening to me too lately on my Nexus 4. I thought the issue maybe was the Cover app I recently installed but maybe it's just the latest KitKat OTA that is responsible.

  • abdio

    My audio is not working on my galaxy s3 4.4.2 gummy ROM