Add full IPv6 support to RAOP and fix Bonjour discovery of RAOP service. Previously, what hostname Bonjour used to advertise a service was a bit of a mystery. If IPv6 was available , it could very well advertise an hostname resolving as IPv6 or use a link-local address. This cause the service to be visible on client (here iTunes), but it wouldn't have worked. We know listen on all local interfaces, IPv6 and IPv4. Also, do not advertise RAOP via Bonjour, if listening on the local interfaces failed

Add two network utility methods to ServerPool Add tryListeningPort and tryBindingPort ; those methods are used to bind/listen on all local interfaces, both IPv6 and IPv4. Add them to ServerPool class as they add functionality to it, but they do not change its functionality and how by default it binds on interfaces by looping individually through all of the. They will be use for local services that are discovered through Bonjour.

Almost complete rewrite of RAOP server Let me commend Mark Kendall for his previous implementation. As far as I could tell, his RAOP server was the only one implementing Airtunes v2 functionalities with a/v sync timestamps. The rewrite serves several purposes. Mainly, I wanted to take ownership of this area of the code, and there were things I couldn't figure out. Most likely because whatever Mark used for AirPort's technical documentation isn't what I got. Technical description of RAOP came mostly from: -http://git.zx2c4.com/Airtunes2/about-http://blog.technologeek.org/airtunes-v2

I found the later to be the most correct.

Main area of focus: -Audio Quality: Over slow or poor network connectivity (e.g. slow wireless) and with lots of packet drops: audio would have been corrupted (the system played audio packets in the order they were received, and not in the order they were supposed to be). For testing purposes, I simulated a 30% packet drop, and playback remained perfect. -A/V Sync: Achieving perfect A/V sync across all platforms and with all the different type of audio architecture is almost impossible. However, I believe the results achieved are very good. Playback will automatically adjust itself according to the network latency and the audio hardware latency.

New features: We now retrieve the media's metadata: Album name, artist name, song title and coverart. This only works when using iTunes. iOS device do not send metadata unless using FairPlay encryption. We only support RSA encryption. Currently, this information is only shown in the logs, but in the future we'll be able to nicely show them in mythfrontend.