Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Play AAC Files with TiVo Desktop 1.9 via fast LAME UNIX
After digging around to learn more about TiVo Desktop 1.9 for Mac OS X, I learned about an interesting hidden feature: you can play back AAC files on your TiVo by using a transcoding feature. On the TiVo Community Forum thread about version 1.9, a user describes how you can use LAME to transcode unprotected AAC files. This doesn't get you iTunes Music Store DRMed AAC playback, but if you've ripped many other CDs in AAC (like I have), you'll be quite happy about this. The basic idea is this:
  1. Install the lame command line program in /usr/local/bin/lame. Or do fink install lame and then ln -s /sw/bin/lame /usr/local/bin/lame if you have Fink installed.
  2. Stop and restart TiVo Desktop via the Preference Pane
  3. Enjoy
On my dual-800 G4 powermac, the Fink version of lame used about 80% of one processor to do the real-time AAC to MP3 conversion. I was hoping to speed up the AAC-to-MP3 transcoding by compiling LAME on my own. This turned out to be very easy and gave quite an impressive performance improvement. Read the rest of the hint for the how-to...

Here are the steps on the command line for a G4 (from the blacktree forum). Note that the multi-line commands should be entered on one line.

$ cd ~ 
$ mkdir tmp 
$ cd tmp 
$ curl http://internap.dl.sourceforge.net/sourceforge/lame/lame-3.96.1.tar.gz\
 -o lame-3.96.1.tar.gz 
$ tar xvzf lame-3.96.1.tar.gz 
$ cd lame-3.96.1 
$ ./configure CFLAGS="-O3 -falign-loops-max-skip=15 -falign-jumps-max-skip=15 \
 -falign-loops=16 -falign-jumps=16 -falign-functions=16 -malign-natural -ffast-math \
 -fstrict-aliasing -funroll-loops -floop-transpose -mpowerpc-gpopt -fsched-interblock \
 --param max-gcse-passes=3 -fno-gcse-sm -mcpu=G4 -mtune=G4" 
$ make 
$ sudo make install 
$ cd ~ 
$ rm -rf tmp
After compiling, I compared the resulting binary program in /usr/local/bin/lame to the Fink-compiled lame, and found that the optimized version was 3.6x faster (7 versus 25 seconds) at compressing an MP3 with the default options. This optimization reduced my processor usage while transcoding with TiVo from 80% to 25%.
    •    
  • Currently 2.00 / 5
  You rated: 2 / 5 (4 votes cast)
 
[35,446 views]  

Play AAC Files with TiVo Desktop 1.9 via fast LAME | 11 comments | Create New Account
Click here to return to the 'Play AAC Files with TiVo Desktop 1.9 via fast LAME' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Play AAC Files with TiVo Desktop 1.9 via fast LAME
Authored by: gidds on Feb 23, '05 09:12:51AM
Good hint.  But you should be aware that transcoding like this will lose quality.  Not only won't you end up with sound as good as AAC, but you won't even end up with sound as good as if you'd ripped it to MP3 directly.

Of course, the difference probably won't be that great.  lame is about the best encoder, and (especially if you choose one of the VBR modes) does the best it can.  You may well find you can't hear the difference, or that it's not enough to bother you.  But it's worth bearing in mind.

---
Andy/

[ Reply to This | # ]

Play AAC Files with TiVo Desktop 1.9 via fast LAME
Authored by: c15zyx on Feb 23, '05 09:23:28AM

No need for all those optimization flags, assuming you're using an Apple GCC compiler, just specifiy "-fast" or "-fast -mcpu=7450", these flags include the above switches and more, and is documented by apple to produce faster running code.



[ Reply to This | # ]
Play AAC Files with TiVo Desktop 1.9 via fast LAME
Authored by: c15zyx on Feb 23, '05 09:26:58AM

Oh yeah, and it's not that compiling LAME this way is very fast, it's that the binary available through Fink is very very slow, less than half the speed it should run at.



[ Reply to This | # ]
Play AAC Files with TiVo Desktop 1.9 via fast LAME
Authored by: alanb1979 on Feb 23, '05 09:53:14AM

I wonder if it would be worth submitting a suggestion to the fink maintainer so that the default is to compile with the -fast flag at least.

FYI, I was using the latest fink build from the unstable branch (lame version 3.93.1-11) and having fink compile that instead of using fink's binary.

---
hiedy hoo



[ Reply to This | # ]
Play AAC Files with TiVo Desktop 1.9 via fast LAME
Authored by: c15zyx on Feb 23, '05 11:23:43AM

If you had Fink build from source and it's still slow, then it's likely that Fink is using it's own safer flags. Someone on the Fink boards asked why the packages aren't built using -fast or other aggressive optimizations, but the developers replied that it was more important to have reliable binaries (some optimizations can lead to buggy code). Also, -fast makes certain assumptions, and for a lot of programs (including LAME) it works great. However, sometimes it causes major problems (ie. try using an xvid+altivec library compiled with -fast)



[ Reply to This | # ]
Play AAC Files with TiVo Desktop 1.9 via fast LAME
Authored by: c15zyx on Feb 23, '05 11:26:35AM

Aargh why can we not edit posts on MOSXHints? Also, there is a very large speed increase between newer versions of LAME, for example, using --alt-preset standard on 3.96 is twice as fast as 3.90.3. While the Fink unstable is 3.93, I believe there were also some major speedups from 3.95 and upwards.



[ Reply to This | # ]
-fast doesn't work
Authored by: alanb1979 on Feb 24, '05 12:47:58AM

I've tried compiling using "-fast" alone or "-fast -mcpu=G4" and both of them fail to build. Not sure what the problem is ...

---
hiedy hoo



[ Reply to This | # ]
Play AAC Files with TiVo Desktop 1.9 via fast LAME
Authored by: ecovelli on Feb 24, '05 06:42:22PM

Thank You!! This was one of the biggest disappointments with the TiVo desktop software.

I downloaded lame and couldn't compile using just -fast, but with all of your parameters, it worked perfectly.

I have a PowerBook G4 1.5MHz and the lame encoder uses less than 10% of my cpu.

If only the rumor that Apple is going to buy TiVo were true...



[ Reply to This | # ]
Play AAC Files with TiVo Desktop 1.9 via fast LAME
Authored by: c15zyx on Feb 24, '05 06:54:01PM

Hehe forgot to mention "-fast" makes some assumptions about code type, so you'll have to use
./configure --enable-static --disable-shared CFLAGS="-fast"
(or CFLAGS="-fast -mcpu=7450" on a G4)
For coders who really want a dynamic version of the lame libs, you can build with "-fast -fPIC"



[ Reply to This | # ]
"-fast -mcpu=7450" works on G4
Authored by: alanb1979 on Mar 03, '05 09:18:07AM

On my G4, I was sucessfully able to use
./configure CFLAGS="-fast -mcpu=7450"
This version performed just as well (~20% processor usage while transcoding) as the one with all of the flags I mentioned in my original post.

What do you mean about building a "dynamic version" of the lame libraries by using "-fPIC"? Apple's documentation mentioned that this will build the shared libraries with -fast, but I don't really understand.

For reference, I've included the following excerpt from documentation for the "-fast" compiler option taken from Apple's gcc optimization page. This explains why I wasn't able to use "-fast" alone on my G4 because it assumes a G5. However, I don't quite understand what it says about "-fPIC" -- why do we want "position independent code" for shared libraries?

-fast

Optimize for maximum performance. -fast changes the overall optimization strategy of GCC in order to produce the fastest possible running code for PPC7450 and G5 architectures. By default, -fast optimizes for G5. Programs optimized for G5 will not run on PPC7450. To optimize for PPC7450, add -mcpu=7450 on command line.

-fast currently enables the following optimization flags (for G5 and PPC7450). These flags may change in the future. You cannot override any of these options if you use -fast except by setting -mcpu=7450. Note that -ffast-math, -fstrict-aliasing and -malign-natural are unsafe in some situations. To build shared libraries with -fast, specify -fPIC on command line.

-O3
-funroll-loops
-fstrict-aliasing
-fsched-interblock
-falign-loops=16
-falign-jumps=16
-falign-functions=16
-falign-jumps-max-skip=15
-falign-loops-max-skip=15
-malign-natural
-ffast-math
-mdynamic-no-pic
-mpowerpc-gpopt
-force_cpusubtype_ALL
-fstrict-aliasing
-mtune=G5
-mcpu=G5
-mpowerpc64

---
hiedy hoo

[ Reply to This | # ]

Play AAC Files with TiVo Desktop 1.9 via fast LAME
Authored by: j-beda on Dec 18, '08 06:10:00PM
I was at http://raoli.com/2007/06/07/adding-itunes-support-to-tivo/ - there were instructions on how to hack TiVoDesktop to play iTunes Plus songs which previously even with lame were not showing up.

I found a Mac OS X prepackaged version of the lame 3.97 .dmg installer here:
http://www.macupdate.com/info.php/id/18882

More importantly, when I updated to TiVoDesktop_1.94_055.dmg directly from Tivo at http://www.tivo.com/buytivo/tivogear/software/tivodesktopmac.html I found that my purchased ACC tunes without copy protection now seem to play without any further modifications necessary - with the prepackaged "lame" one doesn't even need the developers tools.




[ Reply to This | # ]