Menu:

Sponsor

Discover Master of Alchemy, our first iPad/iPhone and iPod touch game!

Follow Me

 

Forum's topics

Latest Files

Archives

Top Rated

Categories

Photo Gallery


Alessandro Crugnola on March 29, 2008 in general

iPhone & Ubuntu notes...

IMG_0025.JPGNo Flash stuff this time :)
During my last trip to New York city I finally decided to buy an iPhone for me too (I think I have everything from Apple right now.. except a mac :) ).
The most annoying thing for a linux user like me is obviously the fact that the iPhone syncronization should pass from iTunes, which is not available for linux...
Ok, there are some ways indeed to copy music like this: http://help.ubuntu.com/community/PortableDevices/iPhone, but as you can see is not so smart.

Sync your address book isn't easy too. The AddressBook sqlite can be easily browse using an SQLite browser such as SQLite Database Browser http://sqlitebrowser.sourceforge.net/, just get the AddressBook.sqlitedb (it's into  /private/var/mobile/Library/AddressBook/)  from the iphone via sftp (just remember to install BSD Subsystem and OpenSSH) and call a simple query like this:

SELECT t1.First, t1.Last, t2.value from ABPerson as t1, ABMultiValue as t2 WHERE t2.record_id = t1.ROWID 

For a full AddressBook sync you can read more here: http://www.estamos.de/blog/...the-making-of/

Another tip I just discovered is how to upload into the iPhone my own Ringtones.
First convert the mp3 file into an M4R file using this command line script:

mplayer -ao pcm input_file.mp3 -ao pcm:file="~temp.wav"
faac ~temp.wav -o output_file.m4r -w
rm ~temp.wav

then using sftp put the output_file.m4r into /Library/Ringtones directory. A sample workflow can be this one:

alessandro@alessandro-u-laptop:~/iphone/Ringtones$ mplayer -ao pcm The_Spell.mp3 -ao pcm:file="~temp.wav"
MPlayer 1.0rc2-4.2.3 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Core(TM)2 CPU         T7600  @ 2.33GHz (Family: 6, Model: 15, Stepping: 6)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing The_Spell.mp3.
Audio file file format detected.
Clip info:
 Title: The Spell
 Artist: Lunatica
 Album: Fables & Dreams
 Year: 2004
 Comment:  00001A75 000016D0 00004374 
 Track: 6
 Genre: Other
==========================================================================
Forced audio codec: mad
Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)
==========================================================================
[AO PCM] File: ~temp.wav (WAVE)
PCM: Samplerate: 44100Hz Channels: Stereo Format s16le
[AO PCM] Info: Faster dumping is achieved with -vc null -vo null -ao pcm:fast
[AO PCM] Info: To write WAVE files use -ao pcm:waveheader (default).
AO: [pcm] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
Cannot sync MAD frame 538.0 (08:58.0)  0.8% 
Cannot sync MAD frame
Cannot sync MAD frame
Cannot sync MAD frame 538.0 (08:58.0)  0.8% 
A: 288.3 (04:48.2) of 538.0 (08:58.0)  0.8% 

Exiting... (End of file)
alessandro@alessandro-u-laptop:~/iphone/Ringtones$ faac ~temp.wav -o The_Spell.m4r
Freeware Advanced Audio Coder
FAAC 1.26.1 (Jan 22 2008) UNSTABLE

Quantization quality: 100
Bandwidth: 16000 Hz
Object type: Low Complexity(MPEG-2) + M/S
Container format: Transport Stream (ADTS)
Encoding ~temp.wav to The_Spell.m4r
   frame          | bitrate | elapsed/estim | play/CPU | ETA
12388/12388 (100%)|  137.8  |   12.5/12.5   |   22.95x | 0.0  

alessandro@alessandro-u-laptop:~/iphone/Ringtones$ sftp root@192.168.1.203
Connecting to 192.168.1.203...
root@192.168.1.203's password: 
sftp> cd /Library/Ringtones
sftp> put The_Spell.m4r

 

 

Bookmark and Share

 

Tags: iphone , ubuntu 

 

2 comments
i've written a sample script, using korn shell, to write a vcard record to the iphone's addressbook. details are at http://pwp.att.net/p/PWP-logic010001
Hello nice work on the ringtone script i'm gonna work it into a nautilus script asap. I'm currently playing with a script to convert the sqlite into .mab files for thunderbird, but no luck yet. Have you had any luck with getting photos onto the iphone (and to appear in the albums)?


Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Type the characters you see in the picture above.