Encoding Audio on ARM CPU Devices

Discussion in 'SBC, ARM, Home Automation' started by drmike, Jun 8, 2014.

  1. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,709
    May 13, 2013
    Anyone here using any ARM-based CPUs for doing audio encoding?   Can be something in a datacenter or it can be something on your desk.

    Interested in MP3 encoding mostly and LAME based.   Looking to see what anyone is squeezing out of ARM platform on performance, especially with the multi core boards.

    Tried earlier ARM based single cores and have been very underwhelmed.  Was lucky to achieve 1-1 ratio of playtime of the recording vs. time to re-encode the audio.  Since it takes 100% CPU, isn't feasible in any way.

    Looking to leverage ARM solution due to power consumption and flexibility there, plus ability to run silent / fanless in a small form factor.

    Anyone?
     
  2. Awmusic12635

    Awmusic12635 Active Member Verified Provider

    327
    92
    May 3, 2013
    Have you considered using one of the newer intel atoms? They have pretty decent CPU power in a lower power setup.
     
    Last edited by a moderator: Jun 8, 2014
    drmike likes this.
  3. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,709
    May 13, 2013
    I have considered the new release Atoms.  Problem is form factor and power.  Smallest board with those is a mini itx (which is big for my application and embedding).

    Performance per watt is good on those, but constant power draw minimum is too high.

    Intending on running these off grid via solar and battery, so watts matter in an annoying degree.  Thus the ARM platform selection.
     
  4. Deleted

    Deleted Jail

    125
    94
    Aug 26, 2013
    ARM lacks certain instructions like XMM so it's doing software based encoding which is an order of magnitude slower. Atoms are x86, ARM doesn't have a lot of ins that x86 has to do multimedia. 
     
    drmike likes this.
  5. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,709
    May 13, 2013
    No doubt about it @.  Considering the impressive performance on many Android devices involving media (set-top boxes, tablets, phones, etc.) something must be accelerating the decoding.  Ideally something out there with hardware support for MP3 or other competing audio codecs for the encode and decode sides.

    Performance doesn't need to be stellar.  Not expecting say 40-to-1 ratio on time.   Something say 10-to-1 I'd think is doable with the multi-cores.

    Turns out LAME is notoriously slow on ARM gear.  Others have bemoaned this elsewhere.  Partial solution is to move to another older codec more based upon the original MP3 spec.  That however is really only suitable for high bitrate encoding.  In this instance I actually need to degrade the audio down to a low bit rate (32k ~ or in line with mono AM radio signal).

    Bandwidth / internet in this solution isn't really reliable or available depending.  So I can ship file to remote, re-encode and get the file back - reliably.
     
  6. willie

    willie New Member

    760
    207
    May 24, 2013
    ARM has the Neon multimedia extensions, same general idea as XMM though the details differ.  Might also be possible to encode with a GPU.  It sounds to me like LAME hasn't been optimized for the ARM, rather than that something is wrong with the ARM processor itself. 

    What are you trying to do, that requires solar-powered off-grid encoding of mp3's?

    The new Minnowboard (Atom board) is smaller than mini itx, if that matters.

    http://www.minnowboard.org/meet-minnowboard-max/
     
  7. Deleted

    Deleted Jail

    125
    94
    Aug 26, 2013
    LAME is slow because it has #ifdefs for instructions (if I remember correctly, havent looked at the sourcecode in years) and then it can only do some/most/all of them in software, which makes it slow; In a nutshell,LAME has to emulate instructions in userland, which makes it dogshit slow. 

    ARM is nice for lowpower, but sucks for complex things like encoding. I would avoid it if you have to use it for things like 
     
  8. ihatetonyy

    ihatetonyy New Member

    91
    45
    May 15, 2013
    I tried my hand at using a Raspberry Pi for encoding a police scanner stream - the raw point wasn't encoding, which was actually OK, but was the audio capture.. which was pretty shit.

    With the new Wolfson card you may find yourself in a better position; for that matter, one of the new-fangled boards like the ODROID should run circles around the Pi and have better USB support to boot.
     
    drmike likes this.
  9. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,709
    May 13, 2013
    Offloading to GPU sounds interesting.  Unsure if anything really supports it.  LAME in general is just retarded.  Still doesn't support multiple cores.  There is a Windows derivative someone has made multithreaded, but I don't do Windows.

    As for the project, it is a bunch of stuff.  Generic top view, it's wifi based network with tiny nodes out there on poles, on roofs, etc.  Each site is bundled with a set of gear - solar panel, battery, charge controller, antennas,  general computing platform, wifi, SDR for various spectrum tinkering and needs, perhaps transmitters depending.

    On said network there is to be a storage node the ends can communicate with / will feed and take in data.  Re-encoding will happen there as needed and on end nodes live time from various sources (i.e. existing radio signals transmitted by others).

    Right now it is a proof of concept to see where I can take the ends at distance with reliability and work on reliable throughput.  So a platform play.  Down the road special use cases to be defined.

    The re-encoding stuff shows up a lot in my world feeding signals from broadcast up and out (AM/FM mainly).  Environments where the source materials exist + bandwidth + accessibility for such often is random.  Not everyone happily plugs at their mixing console.   Some stuff we pull off radio spectrum remotely, re-encode, then blast up to online servers.  Historically, limitations with gear, full sized desktops, big expense, etc.

    There are custom solutions out there for this stuff - like Barix, but the devices are expensive and non hackable.
     
    Last edited by a moderator: Jun 8, 2014
  10. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,709
    May 13, 2013
    So... amazing to me that in mainline Linux there doesn't appear to have been much improvement or development of MP3 encoding in past few years.

    OGG and others - open are getting platform attention.  Considering testing their codecs to see how encoding time and quality are.

    Offloading to GPU for MP3 encoding, perhaps someone does it, but isn't something over the weekend one glues together.  Sadly. 

    Back to the drawing board for me.   I thought performance was in ARM by now and the software for encoding would have been improved :(

    Interesting board.  I looked up the CPU Mark though and went blah about it.  It comes in on the dual core model under what the dual core Atom 330 does performance wise.    Somewhere between the 220 and 330 on performance.

    More performance than a N270 but less than a N570.
     
  11. wlanboy

    wlanboy Content Contributer

    2,125
    1,169
    May 16, 2013
    Nice topic.

    If you look at following page http://www.mp3-tech.org/programmer/encoding.html

    you will find:

    Second last on the list.

    Another entry point is the Helix community https://datatype.helixcommunity.org/Mp3dec

     
    drmike likes this.
  12. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,709
    May 13, 2013
    I found or rather refound the shine port of LAME right after posting this.   It's ancient.  Talking late 1990's I do believe.  It's meh unless dealing with high bitrate (which I am not in this instance).  But, it's roughly 2-3x faster than recent LAME on ARM platforms.

    Helix I stumbled into.  The decoder seems fine, no problem there though with other out of box stuff currently.  Still looking for Helix encoder :)  Unclear if such a thing exists.   There had been something in the past, but unsure if related and if Linux dev'd too.

    I am underwhelmed by the options and general head hit wall many run into on this.  Heck as common as this is, you'd think there would be a market for cheap hardware based encoder that you could tether to whatever to offload. (probably is something like this availble, but very exotic, niche, overpriced).

    A few chips I've ran into just for this sort of purpose.  Finding gear packaging such, haven't found.
     
  13. willie

    willie New Member

    760
    207
    May 24, 2013
    There are hardware mp3 encoder chips that use very little power.  They're really just DSP's with special firmware of course.  They are used in consumer audio recorders, so they can't be too expensive, at least in quantity.  I don't know if there's something comparable for Vorbis.  Did you try the regular Vorbis encoder on your ARM?
     
    drmike likes this.
  14. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,709
    May 13, 2013
    I'd try an out of case mp3 encoder chip solution in a hearbeat if I could identify a reasonably low cost unit with docs for Linux.

    Vorbis I haven't tried yet.  It appears to have same default floating point dependencies it seems.  But it's on my list to experiment with since it is under current development, open source, etc.
     
  15. willie

    willie New Member

    760
    207
    May 24, 2013
    ARMs have floating point: the A8 etc. have the Neon coprocessor and the Cortex M4 has 32-bit ieee floats and DSP extensions. 
     
    drmike likes this.
  16. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,709
    May 13, 2013
    Good to know / realize.

    Most of the new ARM stuff I am considering are A8's or newer.

    I am going to have to hunt their communities looking for folks to run some tests to see how said gear does on the encoding.

    Turns out the Raspberry Pi DOES have a floating point co-processor.  But, unsure if Debian and current Raspbian ship with proper config to utilize these (stuff in prior years hadn't).  Whole other bunch of searching for this, as I have Pi's here on workbench already.
     
  17. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,709
    May 13, 2013
    ... and the Raspberry Pi floating point works if you run Raspbian OS.  Off to check what I have running there (probably Debian).