maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2007 / Maemo 3 / Bora (https://talk.maemo.org/forumdisplay.php?f=23)
-   -   XM Radio on N800? (https://talk.maemo.org/showthread.php?t=15773)

wsiebert 2008-07-07 02:29

Re: XM Radio on N800?
 
I've looked at the XM site. Go here: http://tabletschool.blogspot.com/200...net-radio.html
and save the $9.95/month.

grydrgn 2008-07-07 02:34

Re: XM Radio on N800?
 
Hummm not sure what would be different. It's the first thing I did after I flashed to Diablo. Once you were logged in and picked the station did you click on the musical note in the upper right hand corner? When I do that it launches mplayer and starts streaming. Previous to Diablo this timed out for me 99% of the time.

combatdoc 2008-07-07 03:31

Re: XM Radio on N800?
 
You don't even need to load xmradio.com Even under Diablo the site itself is a little sluggish. I have just run a nice little script in Xterm since I got my n810. Less overhead, seems to work better.

Anyway, if anyone is interested here's the script. I built it for my own use, so its not very sophisticated. It will take any channel for input, I just listed my commonly used ones for my own edification.

You need mplayer to get it to work as it just basically passes variables to an mplayer command:

Code:

#!/bin/sh

USER=user@email.account
PASS=password

echo "XM Radio Player Script (^C Exits)"
echo "XM Radio Favorites"
echo "42 - XM Liquid Metal"
echo "43 - XMU"
echo "44 - Fred"
echo "45 - Starbucks Cafe"
echo "47 - Ethel"
echo "48 - Squizz"
echo "52 - The Verge"
echo "53 - Fungus"
echo "54 - Lucy"
echo  "XM Radio Channel?"
read REPLY

echo "Speed/Quality? <low, high>"
read SPEED
                               
if ["$REPLY" ==""]; then
echo "I need a Channel to listen to."
exit

else
mplayer -vo null -cache 256 -playlist "http://www.xstreamxm.com/mobile/stream.asx?email=$USER&pass=$PASS&chan=$REPLY&speed=$SPEED"
fi
exit


possessedskier 2008-07-08 19:21

Re: XM Radio on N800?
 
Thanks combatdoc! The script works great.

possessedskier 2008-07-10 03:06

Re: XM Radio on N800?
 
Quote:

Originally Posted by grydrgn (Post 200055)
Hummm not sure what would be different. It's the first thing I did after I flashed to Diablo. Once you were logged in and picked the station did you click on the musical note in the upper right hand corner? When I do that it launches mplayer and starts streaming. Previous to Diablo this timed out for me 99% of the time.


I uninstalled the mplayer plugin again and tried clicking on the musical note. It opened and played in media player. Thanks for the help.

jhdeval 2008-07-10 04:59

Re: XM Radio on N800?
 
Code:

#!/bin/python
from subprocess import Popen,PIPE
import string

USER = "username"
PASS = "password"

print "XM Radio Player Script (^C Exits)"
print "XM Radio Favorites"

print "202 - The Virus XL"
print "48 - Squizz"
print "83 - Chrome"
print "150 - XM Comedy XL"

REPLY = raw_input("XM Radio Channel? ")

SPEED = raw_input("Speed/Quality? (low or high): ")

if REPLY == "":
        print "I need a Channel to listen to."
else:
        cmd = 'mplayer '
        cmd = cmd + '-vo null '
        cmd = cmd + '-cache 256 '
        cmd = cmd + '-playlist "http://www.xstreamxm.com/mobile/stream.asx?'
        cmd = cmd + 'email=' + USER + '&'
        cmd = cmd + 'pass=' + PASS + '&'
        cmd = cmd + 'chan=' + REPLY + '&'
        cmd = cmd + 'speed=' + SPEED + '"'
        print "Opening channel " + REPLY
        p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
        out = string.join(p.stdout.readlines())
        outerr = string.join(p.stderr.readlines())
        print out
        print outerr

This may seem silly but I could not get the shell script to run so I went ahead and rewrote his script in python. It is a little messy but it makes it easier to read.

combatdoc 2008-07-10 16:52

Re: XM Radio on N800?
 
I'll have to give that one a try.

BTW, I assume you ran it via sh? ie "sh xm.sh"
It is a shell script afterall.

jhdeval 2008-07-10 19:06

Re: XM Radio on N800?
 
Yeah I saw it was a shell script and ran it as such. It would fail
Code:

if ["$REPLY" ==""]; then
on the then for some reason. I tried it several times and could not get it to run. I want to write a Hildon interface with a database that includes all the channels.

possessedskier 2008-07-10 19:11

Re: XM Radio on N800?
 
Quote:

Originally Posted by jhdeval (Post 201423)
Yeah I saw it was a shell script and ran it as such. It would fail
Code:

if ["$REPLY" ==""]; then
on the then for some reason. I tried it several times and could not get it to run.

I had this problem until I edited the script to add my username and password.

jhdeval 2008-07-10 21:33

Re: XM Radio on N800?
 
I decided to rewrite it in python. I had my username and password in there as well. My plan is actually to include a full channel list and add a hildon interface as well. I think combatdoc had a great idea but I want to make it easier. Possibly submit it to maemo.org as well.


All times are GMT. The time now is 12:04.

vBulletin® Version 3.8.8