My first idea was to use bluetooth.
I had a hard time to set this up and finally succeeded to make an audio sink from iPhone using bluez(http://www.bluez.org/).
I could listen music with desktop speaker via bluetooth, but it was not so easy to make it running every time I want.
So I bought a bluetooth receiver.
(http://www.belkin.com/IWCatProductPage.process?Product_Id=508754)
This was very compatible and easy to use.
It automatically turned on only when it pairs with my iphone.
But I have not been using this because I was disappointed its sound quality.
Finally, I could do this with Apple's Airplay (http://www.apple.com/itunes/airplay/).
ShAirPort (https://github.com/albertz/shairport) can make Ubuntu to emulate airplay speaker.
It seems to me that ShAirPort was implemented to use Apple's private key(http://en.wikipedia.org/wiki/AirPlay#Reverse_engineering_AirTunes_and_AirPlay), so please use this at your own risk.
Also note that this instruction is from INSTALL.md in ShAirPort source.
1. download source of ShAirPort
https://github.com/albertz/shairport
Just click 'ZIP' icon, then you can download all source files in one zip archive.
*UPDATE*
I confirmed new version of shairport does not work with my fresh ubuntu 12.04.
I am not sure what has been changed, but old version of shairport still works on my fresh ubuntu 12.04.
If you don't mind, you may download old version of shairport below.
<http://www.mediafire.com/file/9pvazneb15hgxbm/albertz-shairport-83c1b71.zip>
You may compile and run it as described below.
2. unzip
Open terminal, go to the directory where you stored the source file and unzip.
$ cd Downloads$ unzip albertz-shairport-83c1b71.zip$ cd albertz-shairport-83c1b71
3. Install followings
$ sudo apt-get install build-essential libssl-dev libcrypt-openssl-rsa-perl libao-dev libio-socket-inet6-perl libwww-perl avahi-utils pkg-config
4. Compile
$ make
Make sure that you have no error.
5. Run
$ ./shairport.pl
That's it.
Now see your iPhone and make sure that you have ios version 5 or later.
You may play it with iPad, iPod and iTunes also.
You should see a new icon when you play a music,
just select new speaker in that menu.
Pros :
- All you need is just local network between iPhone and Ubuntu
- No quality loss
- Easy to configure
- Only few resource consumption
Cons :
- Consumes wireless bandwidth (802.11n is recommended)