Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
swiharta
Visitor

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

"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.
0 Kudos
renojim
Community Streaming Expert

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

"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
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
Lowcountry
Visitor

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

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!
0 Kudos
swiharta
Visitor

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

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/
0 Kudos
Lowcountry
Visitor

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

"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. 🙂
0 Kudos
renojim
Community Streaming Expert

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

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
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
swiharta
Visitor

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

"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...
0 Kudos
Lowcountry
Visitor

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

"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!
0 Kudos
swiharta
Visitor

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

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.
0 Kudos
swiharta
Visitor

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

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.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.