LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 04-29-2005, 11:39 PM   #1
crxssi
Member
 
Registered: Apr 2005
Location: USA
Distribution: Mageia
Posts: 84

Rep: Reputation: 15
Apple ipod Shuffle works!


I actually won a free iPod Shuffle from CompUSA!

So I am like "no way this will work with Linux". Unpack it and plug it into my laptop. Mandrake|driva 10.2 immediately identified it correctly and mounted it automatically to /mnt/IPOD. I was still skeptical. Ran gtkpod, told it to create the directory structure, loaded some music, synced, unmounted, and pressed play. Wow- it works!! Sounds great! This thing is so tiny it is silly.

It is the size of a large USB key with built-in Li battery that charges from USB. Congrats to Apple for a nice design- it is a standard USB Mass Storage device and can be used under Linux like any other USB key. It comes from the factory completely blank with a single FAT32 partition. Gtkpod will create all the dir's needed, and the itunes database. You can place any other files (like pictures or whatever) anywhere you like.

I did have a problem with my other computer when talking to it... I think I have a bad cable. It copied for a while OK and then LOTS of these:
=========
Apr 29 23:11:06 kram kernel: SCSI error : <4 0 0 0> return code = 0x70000
Apr 29 23:11:06 kram kernel: end_request: I/O error, dev sda, sector 510468
Apr 29 23:11:06 kram kernel: Buffer I/O error on device sda1, logical block 510428
Apr 29 23:11:06 kram kernel: lost page write due to I/O error on sda1
=========
Yikes! Well, I just power cycled it, and reformatted it with "mkdosfs -F32 /dev/hda1" and resynced with gtkpod. Stored the info OK, but the Shuffle was upset. I later took a wild a** guess that it really cared what the volume name was. I further guessed it was probably "IPOD" since that was what it was mounting it as. So I added a "-n IPOD" to the mkdosfs and tried again. Bingo! Back to normal.



For the curious, this is what it looks like:
=========
Apr 29 22:53:49 kram kernel: usb 4-6: new high speed USB device using ehci_hcd and address 5
Apr 29 22:53:49 kram kernel: usb 4-6: configuration #1 chosen from 2 choices
Apr 29 22:53:49 kram kernel: scsi4 : SCSI emulation for USB Mass Storage devices
Apr 29 22:53:49 kram usb.agent[23018]: Keeping default configuration with /sys//devices/pci0000:00/0000:00:10.3/usb
4/4-6
Apr 29 22:53:54 kram kernel: Vendor: Apple Model: iPod Rev: 2.70
Apr 29 22:53:54 kram kernel: Type: Direct-Access ANSI SCSI revision: 04
Apr 29 22:53:54 kram kernel: SCSI device sda: 2032640 512-byte hdwr sectors (1041 MB)
Apr 29 22:53:54 kram kernel: sda: Write Protect is off
Apr 29 22:53:54 kram kernel: sda: assuming drive cache: write through
Apr 29 22:53:54 kram kernel: SCSI device sda: 2032640 512-byte hdwr sectors (1041 MB)
Apr 29 22:53:54 kram kernel: sda: Write Protect is off
Apr 29 22:53:54 kram kernel: sda: assuming drive cache: write through
Apr 29 22:53:54 kram kernel: /dev/scsi/host4/bus0/target0/lun0: p1
Apr 29 22:53:54 kram kernel: Attached scsi removable disk sda at scsi4, channel 0, id 0, lun 0
Apr 29 22:53:54 kram kernel: Attached scsi generic sg3 at scsi4, channel 0, id 0, lun 0, type 0
Apr 29 22:53:54 kram scsi.agent[23090]: disk at /devices/pci0000:00/0000:00:10.3/usb4/4-6/4-6:1.0/host4/target4:0:0
/4:0:0:0
Apr 29 22:53:54 kram fstab-sync[23125]: added mount point /mnt/IPOD for /dev/sda1
==========
 
Old 05-01-2005, 10:53 AM   #2
pld
Member
 
Registered: Jun 2003
Location: Southern US
Distribution: Ubuntu 5.10
Posts: 206

Rep: Reputation: 30
i got mine to work a few weeks ago, but instead of using the darn itunes software on my work box, or having to install gtkpod (i just wanna drag and drop music, and have it work darnit!) I found this project and it has worked incredibly!

http://shuffle-db.sourceforge.net/

might wanna check it out!
 
Old 05-01-2005, 12:24 PM   #3
crxssi
Member
 
Registered: Apr 2005
Location: USA
Distribution: Mageia
Posts: 84

Original Poster
Rep: Reputation: 15
Thanks for the info- sounds like a neat project. Also, I got word back from the gtkpod developers, they are planning to add more comprehensive Shuffle support, too.

Also, I wrote this script to help choose songs randomly from a source directory and place just the right amount in a directory that can then be used to populate the Shuffle. I would attach the file, but that is not an option on this site.
------------------------------------
#!/bin/bash
#
# A program to randomly grab a set size group of mp3 files for the purpose
# of filling an iPod Shuffle with gtkpod (or other type of flash player).
#
# Version 1.0, Mark A. Davis
#
# Warnings: Has not been tested with filenames containing spaces or the "~"
# symbol. Does not work with files not named "*.mp3". Is not a fast
# nor pretty program, but does work for me, and that is why I made it.
# It is set right now for a 1GB player- change variable if different.
# No doubt, this would be much more elegant and easy with python or perl.

# Location of source music directory tree held in $MUSIC
# You must set this variable for your system!!!
# Directory should contain many mp3 files (more than size of ipod Shuffle)
MUSIC="/music"
if ! test -d $MUSIC
then echo "ERROR- specified music source directory does not exist"
exit 1
fi

# Size of your iPod Shuffle in megabytes. But subtract about 20-30 MB
# so there is room for the itunes stuff. This is important!
# If you have a problem at the end of the gtkpod sync with writing the
# itunes database, then you need to leave more empty space.
PODSIZE="980"

#-----------------------------------------------------------------
# wipe the contents of $HOME/shuffle, if there are any
rm -rf $HOME/shuffle
mkdir $HOME/shuffle


# detect if there is already a master list
REBUILD="no"
if test -s $HOME/.shuffle
then echo "Do you want to rebuild the master song list? (y/n) default n"
echo "It is only necessary if you have added, changed, or removed music."
read RE
if test $RE -a $RE = "y"
then REBUILD="yes"
fi
else
REBUILD="yes"
fi

# Create a special, numbered master list of all music in the source dir tree.
if test $REBUILD = "yes"
then
# Wipe out the previously saved song list
> $HOME/.shuffle
cd $MUSIC
COUNT=-1
echo "Scanning music source directory to build list..."
for FILE in `find . -iname *.mp3`
do COUNT=`expr $COUNT + 1`
echo "+"$COUNT"~"$FILE >> $HOME/.shuffle
done
fi #For rebuilding master list


# Now the hard part, keep looping through the list, selecting random
# numbers, seeing if the number has been used before, if not then
# match it to a song and copying files until we reach our target dir size
SONGS=`wc -l $HOME/.shuffle | awk '{ print $1}'`
echo $SONGS" songs found for randomization. Selecting now..."

cd $HOME/shuffle
> /tmp/shuffle.tmp
COUNTER=0
until test `du -sm | awk '{ print $1 }'` -gt $PODSIZE
do RSONG=`expr $RANDOM \* $SONGS / 32767`
if ! grep "+"$RSONG"~" /tmp/shuffle.tmp > /dev/null
then cd $MUSIC
FILENAME=`grep "+"$RSONG"~" $HOME/.shuffle | awk -F "~" '{ print $2 }'` > /dev/null
echo $FILENAME
cp "$FILENAME" $HOME/shuffle
echo "+"$RSONG"~" >> /tmp/shuffle.tmp
fi
cd $HOME/shuffle
done
rm /tmp/shuffle.tmp
echo
echo "Process complete. "`ls $HOME/shuffle | wc -l`" random songs, "`du -sh $HOME/shuffle`
echo "You can now use HOME/shuffle as a directory to fill your iPod Shuffle."
echo "When done, you can wipe the contents of HOME/shuffle, if you like."

# end of program, shuffle
 
Old 05-01-2005, 03:12 PM   #4
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
You might want to consider submitting this as a Linux Answer, I'm pretty sure it would be of a pretty fair amount of interest -- J.W.
 
Old 05-01-2005, 11:10 PM   #5
pld
Member
 
Registered: Jun 2003
Location: Southern US
Distribution: Ubuntu 5.10
Posts: 206

Rep: Reputation: 30
i was actually working on a similar script, but using the id3 comment fields and genre fields to help me really "feel" out what i wanted to hear.

to wit:

lets me choose all "Jazz" genre music, but only with a comment field entry listing it as "group 1". This may be music I am intimately familiar with, and know very well. As opposed to group 2-9, with 9 being completely new stuff to me.

This is because I have a large collection of albums (~100gigs worth), and though there are a few artists I like, often there are only a few songs from any given album that I am familiar with or like. In this way, I am not randomly grabbing anything from the collection, but rather something more tuned in to what I am in the mood for (but still sort of random).

I guess another nice option would be to pass optional parameters such as # of songs, and re-encoding on the fly to 128/44.1 mp3's (alot of mine are vbr at high quality).
 
Old 05-07-2005, 07:07 PM   #6
Angelo
Member
 
Registered: Mar 2003
Location: Connecticut
Distribution: Slackware, OpenBSD
Posts: 60

Rep: Reputation: 15
Quote:
Originally posted by pld
i got mine to work a few weeks ago, but instead of using the darn itunes software on my work box, or having to install gtkpod (i just wanna drag and drop music, and have it work darnit!) I found this project and it has worked incredibly!

http://shuffle-db.sourceforge.net/

might wanna check it out!
I agree. This program simply rocks. Just leave it in the root directory of your shuffle and
run it when you make any changes.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a Apple shuffle and Gtkpod bentwompracing Linux - Newbie 3 08-15-2005 09:37 PM
Ipod Shuffle using GTKPod notregistered Linux - General 4 08-12-2005 09:19 AM
ipod shuffle speel *BSD 2 06-10-2005 06:09 PM
ipod shuffle, again. JoeUser11 Linux - Newbie 8 05-17-2005 07:58 PM
ipod/ipod shuffle woes (lack of permissions to edit files) Lechium Linux - Software 1 04-13-2005 03:14 PM


All times are GMT -5. The time now is 03:40 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration