Topic: Howto: Poor man's iPod Shuffle for the Chumby

1. Save the following to a file on your USB flash drive (i.e. playmp3s.pl):

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

sub main {
 @lines = split(/\n/,`mp3.x mp3://usb`);
 fisher_yates_shuffle(\@lines);

 foreach $line (@lines) {
  if($line =~ '>mp3:\/\/(.*)<') {
    `btplay /mnt/$1`;
  }
 }
}

sub fisher_yates_shuffle {
    my $array = shift;
    my $i;
    for ($i = @$array; --$i; ) {
        my $j = int rand ($i+1);
        next if $i == $j;
        @$array[$i,$j] = @$array[$j,$i];
    }
}

2. Make a debugchumby file (no extension) on the flash drive with the following:

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

3. Put a bunch of mp3s on the flash drive and boot with the flash drive plugged in.

It will play them in a different order on each boot.

(Thanks to Duane for everything but the shuffle code. Shuffle code from http://community.livejournal.com/perl/101830.html)

Re: Howto: Poor man's iPod Shuffle for the Chumby

Nice!

This makes me think that it may be possible to make a USB stick LOOK like an iPod so that the libpod in use by the chumby can use it.  Hmmm... time to crank up teh perl!

3 (edited by skada 2007-11-21 04:59:28)

Re: Howto: Poor man's iPod Shuffle for the Chumby

Thanks. Yeah, I was thinking about trying that out too.

Re: Howto: Poor man's iPod Shuffle for the Chumby

Cool, I will try it too

Re: Howto: Poor man's iPod Shuffle for the Chumby

Didn't work for me. Iam not sure what I did wrong.Iam using notepad to create these files

Re: Howto: Poor man's iPod Shuffle for the Chumby

No go for me either.

7 (edited by skada 2007-11-21 13:31:32)

Re: Howto: Poor man's iPod Shuffle for the Chumby

If you're using Windows, you need to have Unix linebreaks (just LF). You can use EditPadPro to do this.

http://www.editpadpro.com/ and choose "Convert --> To Unix (LF only)".

Also, some USB sticks don't work - PNY brand is known not to work, for example.

Re: Howto: Poor man's iPod Shuffle for the Chumby

Thanks. I tried it. Still no luck. Will it automatically play on boot up or do I have to go thru Music?

9 (edited by skada 2007-11-21 19:17:10)

Re: Howto: Poor man's iPod Shuffle for the Chumby

It will automatically play - it starts playing for me as it's downloading the control panel.

But, I just took my USB stick out and added more music to it, and put it back in, and for some reason, it wouldn't work if it's just plugged in from the start (no LED lights on the stick and no music playing) - I had to unplug it and plug it back in as it's booting up - then it works fine. And then if I restart again, it's fine.

Another thing to try to remove the bootup process as a variable is to plug the stick in after the bootup process, then open an SSH session, and type "/mnt/usb/playmp3s.pl &" This part has never failed for me.

EDIT: actually, it seems pretty temperamental now, whether it wants to recognize the USB drive on startup or not. It's really frustrating.

Re: Howto: Poor man's iPod Shuffle for the Chumby

Ok, Thanks. I will try again

Re: Howto: Poor man's iPod Shuffle for the Chumby

Opening an ssh session worked!! Thanks!!! Maybe the dbugchumby is not in the right format

Re: Howto: Poor man's iPod Shuffle for the Chumby

It just played only one song though

13 (edited by skada 2007-11-22 19:21:30)

Re: Howto: Poor man's iPod Shuffle for the Chumby

Run a straight "mp3.x mp3://usb" from SSH and see if the output is picking up all your songs.

Also, it's"debugchumby", not "dbugchumby", though I'm sure that may have just been a forum typo.

Re: Howto: Poor man's iPod Shuffle for the Chumby

Thanks. It was a typo, I realized just after I posted

Re: Howto: Poor man's iPod Shuffle for the Chumby

Here is another Poor Man's iPod shuffle:
1) Get your hands on a real iPod shuffle, and a USB drive the same or larger than the shuffle
2) Copy all the files, including the hidden ones, from the onto the USB drive
3) You now can plug it in and use it with the music interface in the control panel.

OPTIONAL:
get a copy (it's free) of yamipod and stick it on the USB drive.  This will allow you to add and remove songs without iTunes

I don't know if this would work with other ipods, but if you want to send me one, I'll let you know if it works!

wayn3w

Re: Howto: Poor man's iPod Shuffle for the Chumby

Cool, my friend has a Shuffle and a 2nd gen iPod (I think) - I've got to try that out.

Re: Howto: Poor man's iPod Shuffle for the Chumby

I'm trying to put together an "iPod Shuffle" on my USB flash drive. I downloaded the following program that update the db, and contains all the iPod Shuffle files:

http://agoraphobeus.free.fr/iShuffle/index.html

But the Chumby doesn't recognize it. I've reverted back to the regular control panel form the beta, btw. Anyone have any ideas?

Re: Howto: Poor man's iPod Shuffle for the Chumby

skada wrote:

I'm trying to put together an "iPod Shuffle" on my USB flash drive. I downloaded the following program that update the db, and contains all the iPod Shuffle files:

http://agoraphobeus.free.fr/iShuffle/index.html

But the Chumby doesn't recognize it. I've reverted back to the regular control panel form the beta, btw. Anyone have any ideas?

Are you saying it works with the regular control panel but not with the new one?  or the other way around?

Re: Howto: Poor man's iPod Shuffle for the Chumby

wayn3w wrote:
skada wrote:

I'm trying to put together an "iPod Shuffle" on my USB flash drive. I downloaded the following program that update the db, and contains all the iPod Shuffle files:

http://agoraphobeus.free.fr/iShuffle/index.html

But the Chumby doesn't recognize it. I've reverted back to the regular control panel form the beta, btw. Anyone have any ideas?

Are you saying it works with the regular control panel but not with the new one?  or the other way around?

Not sure. I know it was supposed to work with the old control panel, and I don't see any iPod info in the beta control panel, so I just reverted to the old one to reduce the amount of variables...

FYI, here's some good info on the iPod Shuffle directory structure:

http://aplus.co.yu/ipod/ipod-shuffle-file-structure/

I added F00-F02 folders and reinitialized the database, but the Chumby still doesn't like it.

WinAmp thinks it's an iPod now, though :-) It's got a little iPod icon and everything, but I think WinAmp isn't too picky...

Re: Howto: Poor man's iPod Shuffle for the Chumby

When I was playing around with cloning my ipod shuffle onto a memory stick, I got it working.  However, sometimes there was difficulty getting either device mounted.  Sometimes it just takes a little while.

I recommend, if you get a chance, to get the sshd daemon operational and see if you see the usb drive mounted in /mnt.  Once it is, the iPod-clone (pseudoiPod?) should be detected.

wayne

Re: Howto: Poor man's iPod Shuffle for the Chumby

There's a progream called "mountmon" which detects that an ipod has been attached, and launches a daemon called "chumbipodd".  A USB memory stick with a copy of an iPod's files may not be enough to trigger the daemon.

Once you've mounted such a device, you could manually start chumbipodd and the Control Panel will then recognize it.