# Play MP3s on TiVo



## mikerr

Found this tivoweb module, and made a few minor edits (it didn't work for me initially) and also got the mp3 player to downsample so it now plays without stuttering on my 3 tivos. The poor old 50Mhz processor still struggles, but just about manages.

Installation:

Copy madplay and ps to /var/hack/bin
Copy libm.so to /lib
Copy mp3.itcl to tivoweb modules directory.

Make a directory /var/mp3 and put a few mp3s in there

Restart tivoweb.

You should now have an MP3 menu in tivoweb top menu.

Click play to play selected mp3, stop to stop it etc

[edit] forum doesn't like attachments >100k so full package is here (264k)
[edit] Small update - no longer needs "ls" installed


----------



## Raisltin Majere

Looks cool, I'l try it out. Thank you.

One (possibly quite stupid) question if I may:

If I change the line set mp3dir "/var/mp3" so that it points to my NAS, would it work?


----------



## BrianHughes

Interesting. So, does it play on your pc or through the telly?


----------



## mikerr

BrianHughes: It plays through the TV - the tivo is doing all the work.

Raisltin: If you have your NAS mounted within the tivo filesystem with NFS or Samba, then yes.. but you probably haven't


----------



## martink0646

Works great. Took a little while to track down Madplay & libm (lots of dead links) but eventually found them & it works well...as long as there is no load on the processor!

Cheers,

Martin


----------



## Raisltin Majere

mikerr said:


> Raisltin: If you have your NAS mounted within the tivo filesystem with NFS or Samba, then yes.. but you probably haven't


  you're absolutely right. Do you know of a link that will explain this to me, please?


----------



## mikerr

It's at the other place: http://www.d***d*******.com/forum/showpost.php?p=57999&postcount=12

[edit] Just done this so thought I'd do a quick quide (see here)


----------



## Raisltin Majere

mikerr said:


> It's at the other place: http://www.d***d*******.com/forum/showpost.php?p=57999&postcount=12


Thanks!


----------



## fearby

At least not on the version I am running..........
 

v1.3.1 that is


----------



## martink0646

fearby said:


> At least not on the version I am running..........
> 
> 
> v1.3.1 that is


It works fine with TivoWebPlus 2

Martin


----------



## randap

fearby said:


> At least not on the version I am running..........
> 
> 
> v1.3.1 that is


I'm running v1.3.1 and all that happens on clicking "Play" is that you are taken to the TiVo menu as though you have just pressed the TiVo button on the remote. "Stop" doesn't appear at all......

EDIT: Ahh - fixed it. For some reasons the paths were not working, so I set the paths for "ps" and "madplay" to /var/hack/bin and all's well... Wicked!!

EDIT2: Now I've lost my "bongs" on remote key press, although live TV sound is OK.........


----------



## martink0646

randap said:


> I'm running v1.3.1 and all that happens on clicking "Play" is that you are taken to the TiVo menu as though you have just pressed the TiVo button on the remote. "Stop" doesn't appear at all......
> 
> EDIT: Ahh - fixed it. For some reasons the paths were not working, so I set the paths for "ps" and "madplay" to /var/hack/bin and all's well... Wicked!!
> 
> EDIT2: Now I've lost my "bongs" on remote key press, although live TV sound is OK.........


I lost my bongs as well but it just needs a reboot & all is well.

Martin


----------



## fearby

randap said:


> For some reasons the paths were not working, so I set the paths for "ps" and "madplay" to /var/hack/bin and all's well... Wicked!!


Can I ask how to set the paths like you describe?


----------



## mikerr

Just re-download the module in the first post

I've uploaded a newer version which is now hardcoded to /var/hack/bin,
previously it required them to be in your unix path.

I don't think the "bong issue" is curable without a new version of madplay (and I didn't compile that). I have them turned off anyway.


----------



## fearby

It works!


----------



## mikerr

Attached is a standalone version *running in the tivo GUI* - much more useful than the tivoweb module 









Install:

Make sure you have newtext2osd installed in /var/hack/bin

Copy madplay and ps to /var/hack/bin
Copy libm.so to /lib
run ./mp3.tcl

Make a directory /var/mp3 and put a few mp3s in there

Usage:

Press 7 on the remote when in now-playing to bring up the menu
PageUp & 
PageDown to scroll the list
Press 1 2 or 3 to play each song
Press 7 to stop playing, or press live-tv

Automatically stops when you enter live-tv or play a recording

It does need the MWSTATE bug fix installed - just run the attached script
(ONLY run that fix on UK Tivo !)

forum doesn't like attachments >100k so full package inc madplay can be downloaded here (264k)


----------



## martink0646

This is great. I installed it, tested & remarked to my wife "Is there anything TiVo can't do!" to which she rolled her eyes & asked me why I wanted to play MP3's on TiVo when I have a home brew, networked HTPC & a Philips Streamium, both within 2 feet of the Tivo. Cue some backtracking as to my previous justifications on the outlay for those items in the past. It also shot down any chances of my bidding for the 'is it or isn't it' TiVo off ebay earlier.

Martin


----------



## ColinYounger

Isn't it amazing that SWMBO always has that clarity of thought?


----------



## martink0646

If I'm honest it's why we have a house at all rather than a pile of gadgets in a lock up somewhere.

MIKERR: I have placed 4 mp3's in the directory as suggested & only one shows up on the menu. Is there a reason for this. Possibly file name length or format. Can you have a think about this please?

Thanks again for a great app.

Martin


----------



## mikerr

I've changed the code for reading filenames now, I think it was choking on certian charactrs in filenames - have another go.


----------



## Pugwash

I've got all of my CDs copied onto a 1.5TB NAS, playing through XBMC. I don't think they'd all fit on my TiVo!


----------



## mrtickle

Have you read page one of this thread? They don't need to fit on your TiVo.


----------



## mpnash

mikerr said:


> Found this tivoweb module, and made a few minor edits (it didn't work for me initially) and also got the mp3 player to downsample so it now plays without stuttering on my 3 tivos. The poor old 50Mhz processor still struggles, but just about manages.


Nice module!

I've had no luck getting rid of the stutter. I saw your --downsample and --no-dither flags for madplay (what is the latter for?). I wonder what else I can try to get rid of stutter...? I've tried to unload the processor as much as poss...


----------



## mikerr

> -downsample : Reduce the decoded sampling frequency 2:1. This also *reduces the computational overhead of the decoder. *


The full options are here:
http://www.linuxmanpages.com/man1/madplay.1.php

adding -1 or -m for mono output might help a bit more.

You could also try using setpri

The tivo madplay binary is from version 0.14.1 beta .. which is quite old:
http://olympus.het.brown.edu/cgi-bin/dwww?type=file&location=/usr/share/doc/madplay/changelog.gz
More recent version have more configurable sample rates and resampling which would help too (I don't have a cross compiler setup for tivo though)


----------



## mpnash

Thanks for the link and tips. What exactly do you think I should try for setpri? (eg. I'm unsure of appropriate priority values).

The -1 and -m options turned U2 into chipmunks - quite a laugh!

Some other observations so far...

I tried with and without --downsample option and it made no real difference to the jumpyness. In fact the madplay command line output suggests this (I think), ie.



Code:


[TiVo [p2] /tmp]# madplay --downsample --no-dither U2-BeautifulDay.mp3
<snip>
output: sample frequency 22050 Hz not available; closest 32000 Hz
output: resampling 22050 Hz to 32000 Hz
[TiVo [p2] /tmp]# madplay --no-dither U2-BeautifulDay.mp3
<snip>
output: sample frequency 44100 Hz not available; closest 32000 Hz
output: resampling 44100 Hz to 32000 Hz

...so I'm guessing in both cased there is resampling going on (extra work with linear interpolation perhaps?) to 32000 Hz - or I may be way off base here.

I also tried with and without --no-dither (I've no real idea what this does - even after reading the manpage). Again no difference - still jumpy. And i've tried different tracks/artists.

A shame really, coz the jumpyness limits it's appeal. I'd love to use the series 1 to play my iTunes library - I've mounted it over NFS for use with OHM (although the tests above were done with a local file in case NFS was the issue).


----------



## mpnash

Further to above, I wondered whether reducing the quality of the mp3 encoding would help reduce the jumpyness...? (I don't know what to expect theoretically)

I took the same track and encoded at as 128 kbps (instead of 160 kbps), ie.



Code:


[TiVo [p2] /hack/ohm]# madplay --downsample --no-dither -v U2-BeautifulDay_128.mp3
<snip>
output: using output sample frequency 22050 Hz
output: sample frequency 22050 Hz not available; closest 32000 Hz
output: resampling 22050 Hz to 32000 Hz
 00:00:10 Layer III, 128 kbps, 44100 Hz, joint stereo (MS), no CRC
[TiVo [p2] /hack/ohm]# madplay --downsample --no-dither -v U2-BeautifulDay_160.mp3
<snip>
output: using output sample frequency 22050 Hz
output: sample frequency 22050 Hz not available; closest 32000 Hz
output: resampling 22050 Hz to 32000 Hz
 00:00:10 Layer III, 160 kbps, 44100 Hz, joint stereo (MS), no CRC

Having played these files each several times, I haven't noticed any consistent reduction in jumpyness.

I did a similar thing for output sampling rate (setting it to 32000 Hz before encoding). Again, no marked difference...

Should the quality and/or out rate be expected to help with the jump issue?


----------



## cwaring

mikerr said:


>


Sorry to go OT, but that's an iteresting screen-shot mike, and one I don't understand at all 

Firstly, either the dates are all wrong or you have stuff from January on your Tivo that hasn't been deleted automatically yet! 
Secondly, "Click" isn't on at that time! 
Finally, is that the episode titles within the "Roswell" and "Star Trek" entries? I assume that's a hack of some sort?

Just curious


----------



## TCM2007

cwaring said:


> Sorry to go OT, but that's an iteresting screen-shot mike, and one I don't understand at all
> 
> Firstly, either the dates are all wrong or you have stuff from January on your Tivo that hasn't been deleted automatically yet!
> Secondly, "Click" isn't on at that time!
> Finally, is that the episode titles within the "Roswell" and "Star Trek" entries? I assume that's a hack of some sort?
> 
> Just curious


It's the "Sort Now Playing Alphabetically" hack - there's a thread on it round here somewhere.


----------



## cwaring

You sure? They're already in date order on Tivo, and that doesn't explain either of the other two oddities


----------



## mikerr

Yes, the sort now showing hack works by pre-sorting titles and then setting dates in ascending order.

In the screenshot above, the shows are in alphabetical order (apart from the one still recording)

Have a look:
http://www.tivocommunity.com/tivo-vb/showthread.php?t=367247
..and it also adds episode titles if you choose.


----------



## TCM2007

They are in alphabetical order; the way the hack works is to change the dates so that they are dsiaplayed in the right order. The same hack also adds episode names into the titles. 

I thought you read all the threads Carl!


----------



## mrtickle

cwaring said:


> Sorry to go OT, but that's an iteresting screen-shot mike, and one I don't understand at all


Going OT at a different angle, my reaction was how empty, odd and nasty the screen looks without the channel logos!


----------



## cwaring

Ahh, right. Too weird for me  Still doesn't explain "Click" on a Thursday


----------



## TCM2007

cwaring said:


> Ahh, right. Too weird for me  Still doesn't explain "Click" on a Thursday


Er, yes it does!


----------



## cwaring

Er... okay. Don't think it's ever been on on a Thursday, but I suppose it must have been.


----------



## martink0646

The dates are changed so Thursday is not the actual day of the recording. The hack assigns dates to the recordings to allow it to sort alphabetically (I think).

Martin


----------



## TCM2007

cwaring said:


> Er... okay. Don't think it's ever been on on a Thursday, but I suppose it must have been.


Like I said, the hack sorts into alphabetical order by changing the recording date. keep up at the back!


----------



## cwaring

How odd. I missed a couple of the explanatory posts  Dunno how that happened


----------



## mrtickle

You didn't miss anything. You actually dismissed TCM2007's explanatory post with the reply "Ahh, right. Too weird for me".


----------



## cwaring

No. Actually, I missed both mikerr's and TCM's posts. Again; not sure how  Apologies all round!


----------



## mikerr

Just thought I'd expand on my post #7 in this thread as I've just redone this on my other tivo:

If you want to store all your MP3s on a windows PC and play them though tivo:

How to setup NFS on tivo & windows:
------------------------------------------------

Free NFS server for windows here:
http://www.labf.com/download/nfsaxe.html
goto export / add directory
select that directory, then click add user access, and press ok

Download nfs for tivo from the other place, http://www.d***d*******.com/forum/showpost.php?p=57999&postcount=12
extract/copy nfs-tivo25.o to your tivo

On tivo:


Code:


insmod /path/to/nfs-tivo25.o
mkdir /var/mp3
mount -t nfs 192.168.2.4:/c/music /var/mp3

That assumes you have an NFS share on c:/music

Skip the windows stage if you have a NAS box that supports NFS.

Unfortunately having the MP3s on NFS increases the cpu load, so stuttering is more likely...I get no stuttering when MP3s are on tivo itself (though you can't use tivo menus much), but accessing them over NFS causes a glitch every 30 seconds or so.


----------



## mpnash

mikerr said:


> If you want to store all your MP3s on a windows PC and play them though tivo:
> 
> <snip>
> 
> Unfortunately having the MP3s on NFS increases the cpu load, so stuttering is more likely...I get no stuttering when MP3s are on tivo itself (though you can't use tivo menus much), but accessing them over NFS causes a glitch every 30 seconds or so.


Playing mp3s using Other Home Media (OHM) for series 1 gets around the tivo menus problem by putting the unit into standby mode. Some info on OHM can be found on "oztivo spot net" (spot=dot: this forum won't yet let me post a URL) under FAQ -> CanTiVoPlayMp3s (has links back to the "other site" for OHM, plus a script for creating OHM playlists for albums in an itunes library).


----------



## dvdfever

cwaring said:


> You sure? They're already in date order on Tivo, and that doesn't explain either of the other two oddities


He recorded Click from BBC World? (It's on a Thursday but it's not on News 24 until Sat & Sun)


----------



## rickynumber18

mikerr said:


> Copy madplay and ps to /var/hack/bin
> Copy libm.so to /lib
> run ./mp3.tcl


Does anyone know where the ./mp3.tcl file should be copied to? mikerr doesn't say where to FTP it to and it can't be run straight from the desktop. Many thanks.


----------



## dvdfever

Taken from the readme file, it's listed below. However, after trying this I didn't go back to it as the mp3 files stuttered through mine, and as I've got my PC in the same room I kept that for playing MP3 files on. If I could stop the stuttering it would be cool.

"This is a MP3 player module for Tivo Web. 
In order to use this module, you'll need mbm's madplay and libm.so
as well as the unix command "ps" 

INSTALLATION
Copy madplay and ps to /var/hack/bin (or somewhere in your path)
and copy libm.so into your /lib directory. 

Next copy mp3.itcl to the modules subdirectory of TivoWeb 

OPERATION

MP3 files should be stored in /var/mp3 by default

After restrating TivoWebyou should now have an MP3 menu from the main menu. 
Once in the MP3 menu, it should be fairly self explanatory. 

Click on "Play" next to a given MP3 and it will start playing. 
To stop it you can either click "Stop" next to the "Currently Playing" mp3,
or click play next to another mp3 to start that one instead."


----------



## rickynumber18

Many thanks dvdfever, however I'm not trying to install the TivoWeb version but the sister-software that can be operated directly from TiVo (see post #16). The author of the software, mikerr, says "run ./mp3.tcl" but doesn't indicate where to put the file on TiVo via FTP. I can't run it from my PC so I need to know where to transfer the file to.


----------



## dvdfever

rickynumber18 said:


> Many thanks dvdfever, however I'm not trying to install the TivoWeb version but the sister-software that can be operated directly from TiVo (see post #16). The author of the software, mikerr, says "run ./mp3.tcl" but doesn't indicate where to put the file on TiVo via FTP. I can't run it from my PC so I need to know where to transfer the file to.


AIUI, it's a TiVoweb module so will require TiVoweb in order to run it, since you can play it direct from TiVoweb.


----------



## rickynumber18

dvdfever, you are correct, but there are two versions. Please read post #16.


----------



## Raisltin Majere

I think it can go anywhere.


----------



## djb2002

mikerr said:


> Copy madplay and ps to /var/hack/bin
> Copy libm.so to /lib
> Copy mp3.itcl to tivoweb modules directory.


The problem I have is that /var/hack/bin is inaccessible on my TiVo (Permission Denied), and I have a /var/hacks directory instead. I have tried creating a bin directory within this and copying those files - this was OK.

I cannot copy the libm.so file to /lib as the directory is read only.

Any ideas ??

Thanks
Daniel


----------



## rickynumber18

You'll need to "unlock" TiVo first. From the # bash prompt type: mount -o rw -o remount / and to relock: mount -o ro -o remount /


----------



## djb2002

rickynumber18 said:


> You'll need to "unlock" TiVo first. From the # bash prompt type: mount -o rw -o remount / and to relock: mount -o ro -o remount /


Tried that, but when I try again I still get:

550 Directory change failed; permission denied.

when trying to get into the /var/hack/bin directory.

Any ideas ?

Thanks


----------



## TCM2007

telnet into TiVo and type:

chmod -R 755 /var/hack


----------



## djb2002

Thanks - That resolved the problems.

However, although I can now see the mp3 option listed in tivoweb, clicking on it brings back a 404 Not Found.

Any ideas ?

Thanks


----------

