Your Digital Media Has Never Looked So Good

 
swiharta
Posts: 12
Joined: Sun Jun 19, 2011 6:00 pm

Re: My Media - Your Music and Video on the Roku DVP

Wed Jun 22, 2011 12:55 am

renojim wrote:
The only thing I can think of is the possibility that you've mixed the old and new version of the server. Did you copy the new files over the old files? If so, make sure you delete all the .pyc files in all the subdirectories. If there's any chance that they're mixed you may want to try a fresh install into its own directory.


I unzipped the source files into separate folders. But I will go ahead and re-download and install from scratch to be extra sure. Is anything special to do on the Roku client other than just reinstalling?

renojim wrote:
The only thing I can think of is that you can't use a root directory. You mentioned a "videos" folder on Z:, but don't mention a folder on V:. Is it that the videos don't show up, or they show up but won't play? It's always a good idea to try just using the browser interface to the server (http://localhost:8001/feed) to test things. You should be able to at least save the "media" link to a file. As always, check the output of the Python window and the my_media_log.txt file for any messages that might be helpful.


I think you are going to be right on this one, it was indeed a root directory! The videos all showed up but they wouldn't play. I have been using the browser to test things since my first post where I linked to the .xml files.

renojim wrote:
I know that the different poster images used aren't the right size. It's one of the things I'll be fixing in the near future. I believe that it used to work just fine with those images and an update to the firmware has made it slower, but there's really no way to prove that now. If you have PIL installed, it should make the issue better. With properly sized poster images the navigation is much better. I prefer the high contrast theme and it's the one I use in my personal version of the channel. I'll have to compare the two and see if I notice a difference, but it seems pretty snappy to me.


Yeah I have PIL installed using the Windows installer package.

One thing I hadn't thought of before, which probably doesn't matter but nonetheless, I am using Python 2.7 instead of 2.6.

With regards to my MP3 issues, almost certainly the code is fine since no one else seems to have the same issue. If nothing else this is a nice little Python exercise for me to try and figure out what the problem is with my setup.
 
renojim
** Valued Community Member **
Posts: 3490
Joined: Mon Feb 15, 2010 1:35 pm

Re: My Media - Your Music and Video on the Roku DVP

Wed Jun 22, 2011 10:10 am

swiharta wrote:
Is anything special to do on the Roku client other than just reinstalling?

If you've switched to the default theme anyway, you don't have to sideload the client anymore. Just add the private channel: https://owner.roku.com/add/mymedia. If you do want to use the high contrast theme then you'll have to install the client as you've been doing. There isn't anything special you have to do, but the springboard.py installer needlessly adds a lot of images that never get used. I may create an additional private channel that uses the high contrast theme since I prefer that one. (It's all about Jim! :mrgreen: )

swiharta wrote:
I think you are going to be right on this one, it was indeed a root directory!

One for me, finally!

swiharta wrote:
One thing I hadn't thought of before, which probably doesn't matter but nonetheless, I am using Python 2.7 instead of 2.6.

There we go! Python 2.7 doesn't really work. It appears to work and some things work just fine. However, I was never able to play any music under 2.7. I didn't spend any time looking into it. I should have thought of that as soon as you said music wouldn't play.

-JT
 
Lowcountry
Posts: 4
Joined: Thu Jan 13, 2011 2:06 pm

Re: My Media - Your Music and Video on the Roku DVP

Wed Jun 22, 2011 10:57 am

Sorry, I've tried to search for this, but maybe I'm using the wrong keywords...
I has mymedia setup on a NSLU2, but after 6 good years, it it done :(
Now, I'm using an old computer running a command line debian.

I've got everything set up and everything works fine--except when I reboot the server.

Once I reboot, I have to enter:

cd /home/server
python mymedia.py

to get things going again.

How can I automate this?
Thanks!
 
swiharta
Posts: 12
Joined: Sun Jun 19, 2011 6:00 pm

Re: My Media - Your Music and Video on the Roku DVP

Wed Jun 22, 2011 11:23 am

Cool, thanks a lot renojim! I might just noodle around a bit more and see if I can't figure out what's wrong. I didn't think there were major changes between 2.6 and 2.7, but I really have no idea, guess I'll start here.

Lowcountry wrote:
Once I reboot, I have to enter:

cd /home/server
python mymedia.py

to get things going again.

How can I automate this?


Kind of a surprise question coming from someone running from the command line, but does a guide like this help?

http://embraceubuntu.com/2005/09/07/add ... at-bootup/
 
Lowcountry
Posts: 4
Joined: Thu Jan 13, 2011 2:06 pm

Re: My Media - Your Music and Video on the Roku DVP

Wed Jun 22, 2011 11:32 am

swiharta wrote:
Cool, thanks a lot renojim! I might just noodle around a bit more and see if I can't figure out what's wrong. I didn't think there were major changes between 2.6 and 2.7, but I really have no idea, guess I'll start here.

Lowcountry wrote:
Once I reboot, I have to enter:

cd /home/server
python mymedia.py

to get things going again.

How can I automate this?


Kind of a surprise question coming from someone running from the command line, but does a guide like this help?

http://embraceubuntu.com/2005/09/07/add ... at-bootup/


Sorry, that doesn't help. I don't know how it worked before. I never said I was good at this. :)
 
renojim
** Valued Community Member **
Posts: 3490
Joined: Mon Feb 15, 2010 1:35 pm

Re: My Media - Your Music and Video on the Roku DVP

Wed Jun 22, 2011 1:44 pm

I'm no Linux expert, but you have to create a script to start the server and then get the script to run at start up. The simplest script would be
#!/bin/sh
cd /home/server
python mymedia.py &
Use your favorite text editor to put those lines in a file named mymedia and put the file in the /etc/init.d directory. Make sure you run:
chmod +x mymedia
to make it executable. According to the link swiharta gave, you have to run:
update-rc.d mymedia defaults
to get it to run at boot time.

You may have to run the chmod and update-rc.d commands as root (put sudo before the command). I just tried it on my Ubuntu 10.04 test setup and it seemed to work.

Good luck! If this doesn't work, I'd suggest searching for "Debian startup scripts" or try to look at the man page for update-rc.d. Hopefully someone more knowledgeable than me will point out any glaring errors.

-JT
 
swiharta
Posts: 12
Joined: Sun Jun 19, 2011 6:00 pm

Re: My Media - Your Music and Video on the Roku DVP

Wed Jun 22, 2011 2:16 pm

Lowcountry wrote:
Sorry, that doesn't help. I don't know how it worked before. I never said I was good at this. :)


Why do you say it doesn't help? The page I linked, among countless others if you try Google as renojim said, will show how to "automate" starting the server on reboot, exactly as you asked, using a startup script. You can lead a horse to water...
Last edited by swiharta on Wed Jun 22, 2011 3:53 pm, edited 3 times in total.
 
Lowcountry
Posts: 4
Joined: Thu Jan 13, 2011 2:06 pm

Re: My Media - Your Music and Video on the Roku DVP

Wed Jun 22, 2011 2:24 pm

renojim wrote:
I'm no Linux expert, but you have to create a script to start the server and then get the script to run at start up. The simplest script would be
#!/bin/sh
cd /home/server
python mymedia.py &
Use your favorite text editor to put those lines in a file named mymedia and put the file in the /etc/init.d directory. Make sure you run:
chmod +x mymedia
to make it executable. According to the link swiharta gave, you have to run:
update-rc.d mymedia defaults
to get it to run at boot time.

You may have to run the chmod and update-rc.d commands as root (put sudo before the command). I just tried it on my Ubuntu 10.04 test setup and it seemed to work.

Good luck! If this doesn't work, I'd suggest searching for "Debian startup scripts" or try to look at the man page for update-rc.d. Hopefully someone more knowledgeable than me will point out any glaring errors.

-JT

That worked great. Thank you so much for the help!
 
swiharta
Posts: 12
Joined: Sun Jun 19, 2011 6:00 pm

Re: My Media - Your Music and Video on the Roku DVP

Wed Jun 22, 2011 3:09 pm

I found the reason MP3 files weren't getting parsed out, heads up on this if you use Python 2.7! It only requires changing one line of code. First, here's what's going on...

Example:
fileName = "Z:\mp3\Art Blakey - Orgy In Rhythm\03 Toffi.mp3"

# fileName actually provided by navigating into a folder containing mp3s, which are processed
# in a "for" loop in mymedia.py, getdoc(), which calls the getart() and file2item() functions,
# which both ultimately instantiate the Mp3AudioFile class below


In eyeD3 module, tag.py:
def isMp3File(fileName):
   (type, enc) = mimetypes.guess_type(fileName)
   return type == "audio/mpeg"

...
...
...

class Mp3AudioFile(TagFile):
   def __init__(self, fileName, ... )
      ...
      if not isMp3File(fileName):
         raise InvalidAudioFormatException("File is not mp3")


In the Python 2.7 shell...
>>> import mimetypes
>>> mimetypes.guess_type("Z:\mp3\Art Blakey - Orgy In Rhythm\03 Toffi.mp3")
('audio/x-mpg', None)


mimetypes.guess_type() documentation

All you have to do is replace return type == "audio/mpeg" with return type == "audio/mpeg" or "audio/x-mpg" (line 1709 in tag.py). According to this, 'audio/x-mpg' is actually just an alias for 'audio/mpeg', the proper mp3 mimetype. Not sure why Python 2.7 returns this alias, causing isMp3File(fileName) to return false.

I notice someone else made this change to eyeD3 tag.py here, for the same issue. Actually, a few other changes were made to purportedly make eyeD3 play better with Python 2.7.

So, I have to assume mimetypes.guess_type() will return ("audio/mpeg", None) in the Python 2.6 interpreter, which is a more appropriate result I think. When I get a chance I'll try confirming this on another computer.
 
swiharta
Posts: 12
Joined: Sun Jun 19, 2011 6:00 pm

Re: My Media - Your Music and Video on the Roku DVP

Wed Jun 22, 2011 5:39 pm

Seems like there is no fast-forward / rewind for music? Would also be nice to be able to go skip through tracks when using "Shuffle All". Just making sure I'm not missing these things if they're there.

BTW, my videos are working fine now that I selected the same larger folder which had given me problems, but made it a subdirectory of the share rather than the root. I was able to see the videos fine before, they just wouldn't play. It kind of smells like it would be an easy "bug" to patch, no? I'll take a look if I have time.
 
renojim
** Valued Community Member **
Posts: 3490
Joined: Mon Feb 15, 2010 1:35 pm

Re: My Media - Your Music and Video on the Roku DVP

Wed Jun 22, 2011 11:42 pm

swiharta wrote:
I found the reason MP3 files weren't getting parsed out, heads up on this if you use Python 2.7! It only requires changing one line of code.

Good work! I guess the question is whether there's any other potential problems and whether there's any benefit to going to 2.7.

swiharta wrote:
So, I have to assume mimetypes.guess_type() will return ("audio/mpeg", None) in the Python 2.6 interpreter, which is a more appropriate result I think. When I get a chance I'll try confirming this on another computer.

That's what I get on my computer with 2.6.

-JT
Last edited by renojim on Thu Jun 23, 2011 12:03 am, edited 1 time in total.
 
renojim
** Valued Community Member **
Posts: 3490
Joined: Mon Feb 15, 2010 1:35 pm

Re: My Media - Your Music and Video on the Roku DVP

Wed Jun 22, 2011 11:59 pm

swiharta wrote:
Seems like there is no fast-forward / rewind for music? Would also be nice to be able to go skip through tracks when using "Shuffle All". Just making sure I'm not missing these things if they're there.

The hardware/firmware doesn't support FF/Rew for MP3s. My understanding is that to FF through a variable rate MP3 you have to decode it to see where you are. I guess Roku doesn't feel it's a necessary feature.

You can skip to a new song during shuffle mode using the right arrow button as long as you keep the Springboard screen (the screen with the song info) open. The left arrow also gets you a new song, but it should really go to the beginning of the current song and then go to the previous song(s), but that would require keeping a record of all the songs played and I didn't think it was worth the trouble. I may keep a record of the last N songs played and/or implement returning to the beginning of the current song when the left arrow button is pressed.

swiharta wrote:
BTW, my videos are working fine now that I selected the same larger folder which had given me problems, but made it a subdirectory of the share rather than the root. I was able to see the videos fine before, they just wouldn't play. It kind of smells like it would be an easy "bug" to patch, no? I'll take a look if I have time.

I'm surprised you can see the videos. If I remember correctly, not allowing a root directory was intentional to prevent someone from inadvertently exposing their entire C drive, for example. There's another check in the code to make sure no shenanigans like requests with ../../filename are allowed. Admittedly, these checks aren't necessary on a local network, but there were some ideas of using the server for other purposes.

-JT
 
swiharta
Posts: 12
Joined: Sun Jun 19, 2011 6:00 pm

Re: My Media - Your Music and Video on the Roku DVP

Thu Jun 23, 2011 3:01 am

renojim wrote:
I guess the question is whether there's any other potential problems and whether there's any benefit to going to 2.7.

I don't think it's a big deal to install multiple versions of Python if needed, they just go to their own "C:\PythonXX" folders, but I haven't encountered any other issues in my brief testing with 2.7 so far. I agree I doubt there is any benefit to using 2.7, but I already had it installed for doing Django development.

Of course, if you do install multiple versions, only one version's folder should be set as a PATH in system environment variables, so their's no confusion as to what "python" does at the command line. This app I think always refers to "C:\Python26\python.exe" (for Windows folks), so you shouldn't need to mess with environment variables at all if you follow the directions provided (something I didn't do 100%!).
 
jdtangney
Posts: 7
Joined: Thu Feb 11, 2010 9:23 pm

Re: My Media - Your Music and Video on the Roku DVP

Sun Jun 26, 2011 10:12 am

Just a quick note to say THANKS for a fantastic tool!

I have been wanting to stream vids and music from iTunes forever, and My Media absolutely rocks. Installation both on my Mac and my (1st gen) Roku were trivial. Config was dead simple. Operation is flawless.

Thank you, thank you, thank you!

--johnt
 
jamchavez
Posts: 1
Joined: Sun Jun 26, 2011 10:38 pm

Re: My Media - Your Music and Video on the Roku DVP

Sun Jun 26, 2011 10:40 pm

Got the server installed and running, the channel is coming up no problem, but when i attempt to open any folder it tells me it's empty, even though there are many, many files in each one. What am I doing wrong??

Thanks,
James

Who is online

Users browsing this forum: No registered users and 24 guests