Topic: tv tuner

Hello
Have anyone tried a USB TV TUNNER with chumby ?

Re: tv tuner

You'd need the drivers, which are huge by themselves. Then you'd need a program to actually handle the input, and all the libraries needed to run said program. This whole mess alone would be too much for the chumby to handle, nevermind the MPEG decoding/encoding.

Re: tv tuner

What u could do is use a regular computer with a tv-card and stream over wifi (i like windows media encoder for that ). You ll need to run software like vlc (video lan client) compiled for arm to watch the stream. I think it is possible too to stream in the flash video format with software like Adobe Flash Media Server. And view this with any flash player (but i got to look into that option)

Re: tv tuner

If someone could get this working, it would be a very cool product feature.  I'm not aware of anything else out there that can do that.  I wish the thing could stream video/music from my home PC via the wifi network.

"We will find a way, or we will make one."

Re: tv tuner

RhythmGuru wrote:

If someone could get this working, it would be a very cool product feature.  I'm not aware of anything else out there that can do that.  I wish the thing could stream video/music from my home PC via the wifi network.

There's actually a hack that can stream music from your PC, if you happen to use SlimServer (which is free).  All you need to do is figure out the IP of the server, then use the "stream.mp3" interface.  From then on you can manage the music from a browser.

Basically, you'd create a USB flash drive with the following text in the file "debugchumby".

#!/bin/sh
btplay http://ip.of.your.server:9000/stream.mp3

Then boot your chumby with it.  I've done this a couple of times - it works pretty well.

Re: tv tuner

Very cool!  I will have to try that out.

"We will find a way, or we will make one."

7 (edited by RhythmGuru 2007-09-17 15:50:40)

Re: tv tuner

Duane, what extension should be used on that file?
I have slimserver running.  I have created a file called debugchumby.txt on a usb flash drive, with the code you listed above.
#!/bin/sh
btplay http://xxx.xxx.xx.x:9000/stream.mp3

The IP address is the IP of the laptop that slimserver is running on.  I then place the USB drive in the chumby and reboot.  Slimserver can't find the player.

Is this all correct?  If so, it's not working.

"We will find a way, or we will make one."

Re: tv tuner

Alright, Duane, I got it to work, but not using the USB drive.  I had to open SSHD on the Chumby, log in using Putty, and ran BTPLAY direct from there.  Then used slimserver.
Apparently, I'm not doing something correctly with the file on the USB drive.  I tried debugchumby.txt, debugchumby.exe, and just debugchumby with no extension.
Any advice?

"We will find a way, or we will make one."

Re: tv tuner

OK, one thing I guess I need to mention is that the file must have UNIX-style line endings (linefeeds, not carriage returns), so you can't use, say, Notepad on Windows to create the file.  I know it's a pain in the ass, but that's the way Linux works.  There are some Windows text editors out there that will do this right, and Mac users can simply use the normal TextEdit.

Also, the name of the file should be 'debugchumby' with no extension (ie no '.txt').

If you get it running, you'll find that the system will appear to stop the boot process and widgets won't play.  In order to have it continue after launching btplay, put an '&' at the end of that line, and the system should continue normally.

At that point, you can consider yourself a 1337 h4xx0r.

Re: tv tuner

ah, I used NOTEPAD
I'll find a good editor.
Thanks Man.

"We will find a way, or we will make one."

Re: tv tuner

It worked.
Woot

:-)

Seriously though, thanks a lot for taking time to help me out on this, it's an awesome "feature", plus, it makes me feel like I actually have control over the device.  Pretty cool.

"We will find a way, or we will make one."

Re: tv tuner

So - now write this up for the wiki on the tips and tricks page smile

Re: tv tuner

Done

"We will find a way, or we will make one."

Re: tv tuner

You can use btplay to play local mp3's also.  I think it would be a good trick to use this usb drive technique to play local files off the drive.  That way you could setup different music on different drives and just swap out the drive to change playlists.

I don't want to goto my computer everytime I want to turn music on/off or change a song.

Justin

Re: tv tuner

Here's another easter egg to help make that easier.

The chumby has a small program on it that can scan your USB dongle for MP3 files and output XML that can be used to build a playlist or some sort of Flash UI.

We don't talk about it much at the moment, mainly because in the current release (build 312) it has a small bug where the XML closing tag doesn't match the opening tag - so use at your own risk.

Effectively, issuing the command:

# mp3.x mp3://usb

..will output something like:

<mp3_masterlist generator="mp3.x" ver="0.19" dirs="0" files="1">
<mp3 artistname="Sonny Rhodes" songname="Firefly Main Theme" genre="12" track="PP" album="" comment="" year="0" size="786560">mp3://usb/alarm1.mp3</mp3>
</mp3_masterlst>

This particular USB dongle only has a single MP3 file, but you can see how this might be useful (and I'm sure you can see the XML bug if you look carefully).  A competent shell scripter could probably use this info to build a simple list of file paths that can be fed to btplay.

Re: tv tuner

If this was DIGG, I'd totally dig your post just for the Firefly reference.
And yeah, XML can't spell.

"We will find a way, or we will make one."

17 (edited by jgaither 2007-09-18 11:20:46)

Re: tv tuner

Duane,

  thanks for the tip!  what would I need to use to either display the XML or convert it to flash?


Justin

Re: tv tuner

Well, off the top of my head, I'd take advantage of the miniperl built into the chumby, and create a simple Perl program:

#!/usr/bin/perl
main();

sub main
{
 @lines = split(/\n/,`mp3.x mp3://usb`);
 foreach $line (@lines) {
  if ($line =~ '>mp3:\/\/(.*)<') {
    `btplay /mnt/$1`;
  }
 }
}

I'd put this in a file called "playmp3s.pl" and put it on my USB dongle

Then I'd make a 'debugchumby' file, with the contents:

#!/bin/sh
/mnt/usb/playmp3s.pl &

Then I'd stick some MP3 files on the dongle and boot with it.

But that's just me.

Re: tv tuner

Duane,
   thanks, yes I could do that, in fact I probably don't need the mp3.x file I could just parse the filenames.   I got excited when you talked about swf and xml because I thought it would display something on the screen.

You've sparked me up again to play with the chumby some more.  I got kinda bored with it since it wasn't doing the things I really wanted like play music.

Regards,

Justin

Re: tv tuner

jgaither wrote:

I got excited when you talked about swf and xml because I thought it would display something on the screen.

Ah - that's a bit more effort, and requires some knowledge of Flash authoring.  In general, you'd use the build in XML object to fetch the information about the MP3s using the same URL you'd pass to the command line tool.

You've sparked me up again to play with the chumby some more.  I got kinda bored with it since it wasn't doing the things I really wanted like play music.

The chumby is a *very* flexible device - you'll find you can do a lot of stuff with fairly simple scripts.  It helps to know Flash if you want to build full UIs, but even without that there's a lot of really cool hacks possible.

Re: tv tuner

I'm not a flash programmer.   I can write perl scripts.  I don't want to pay $700 for Flash Pro either.

I want a UI, but have no way to get it done.  I asked for someone to make a simple XML based(or text file) menu button to call scripts, but so far no takers.  I saw a bunch of this kinda stuff on Flashden, however, it appears I would need to compile them myself. (need $700 software).

This kinda put a halt to my hacking.  Cause I don't want to give up all the other nice features of chumby and replace with perl scripts and ssh.

Thanks,

Justin

Re: tv tuner

Well, there are alternatives. I'd take a look at ming for instance.  I could certainly see hooking up some Javascript interpreter (perhaps KJS or Spidermonkey) to ming and essentially create a text-based system to create Flash movies without needing the official Flash IDE.

About a year ago, I hooked up KJS to Cairo and a simple HTTP stack to create something I called "chumbyscript" - one could actually do some interesting things with it.  I built a few clocks and other things before we got buried with our mainstream development.

You could also follow what zachinme is doing, which is basically putting together some more conventional windowing systems.

Re: tv tuner

*Gasp*
I...I'm mentioned tongue
Yes, I've been working getting GTK+ working on it, so I can use applications that I normally use on my linux desktop. (Or at least lighter-weight builds of said apps)
VNC is fun to use. Although the delay, at least for me (I'm on the edge of our wireless network), is too great to use it with GIMP/Photoshop to draw. It is very similar, yet small...
I looked into Xfce, which is probably one of the nicest low-spec desktop enviorment (as seen in Xubuntu), and although the chumby should be able to run it, it would only run it just barely. You'd be able to run the DE, but no other programs tongue I might look into trying fluxbox, though.

Another project that I'm working on actually fits in great with this discussion. I'm basically making a radio program for the chumby. The frontend on the chumby is done in flash. It connects to my server which has a database of my music. It randomly picks a song based on ratings, then uses Ming to wrap the .mp3 in a .swf, which the chumby loads and plays.
Its not something that I'm going to upload to chumby.com and make public, simply because it is too hard to implement on the end-user's end. They would have to set up the server and whatnot.

I will, release the source. However, I'm using Python as my server backend, and python is fairly obscure when it comes to servers.


Duane, that KJS/Cairo chumbyscript seems interesting. I've never used Cairo, I might look into that.

Re: tv tuner

zachninme wrote:

Duane, that KJS/Cairo chumbyscript seems interesting. I've never used Cairo, I might look into that.

The biggest downside to Cairo in this case is that it's so floating-point intensive which makes it a poor performer on embedded devices like ours that don't support floating-point in hardware.  As I recall, things like radial gradients were particularly painful.

I think there are other nice vector graphic libraries that are integer-only, but I haven't looked into it recently.

KJS was pretty easy to graft onto.  Another interesting choice would be lua, which is designed for this sort of thing, plus has the benefit of having already having been ported to chumby, however, it's not as widely known.

Re: tv tuner

About a year ago, I hooked up KJS to Cairo and a simple HTTP stack to create something I called "chumbyscript" - one could actually do some interesting things with it.  I built a few clocks and other things before we got buried with our mainstream development.

Hahaha, that's actually really funny.. I've been working on almost the exact same thing (JavaScriptCore + Cairo + JSON). I've actually been working on a little networking protocol too called GizmoNotify that would allow you to send JSON objects to different machines and have them playback in the "GizmoEnvironment". The beauty of it is that JSON is so much easier to parse than XML and uses less bandwidth (my json interpreter in Glib-C is about 100kb and is only necessary when you don't have a Javascript interpreter, libXML is about a meg). I bolted libnotify's daemon to send the messages to the server on the Chumby and have it draw them back through Cairo. I had sparkling eyed dreams of possibly making an even lighter-weight JSON interpreter and using it over radio networks so you could do things like a programmable Ambient-Orb.

I've been poking around the insides of Growl to see if I can make Growl send Gizmo-packets, but I haven't actually been able to do that so far, Objective-C is a lot harder to read than I thought. I've also thought about just making a Growl server that reads Growl packets and resends them as Gizmo packets, but that's also something I haven't done, I like libnotify and D-Bus better and spend most of my time on Linux these days. But at least it's fun to play with when I have downtime. I haven't bothered with GTK+ either since it's a lot higher level than just a Javascript-Cairo canvas, but I've gotten GTK+ and DirectFB all built for ARM, but I haven't tried it out on Chumby yet.