Ticket #421 (reopened enhancement)

Opened 3 years ago

Last modified 10 months ago

emulated AirPort Express as audio source

Reported by: albert Owned by: lennart
Milestone: Component: daemon
Keywords: Cc: bugs-pulseaudio@…

Description

Emulate an AirPort? Express base station (and distribute it via Avahi). The received audio stream can be used as a audio source in PulseAudio.

Change History

Changed 3 years ago by albert

This is somehow the opposite of ticket #69.

Changed 3 years ago by albert

I would love to develop on this by myself, but I know barely nothing about the AirPort? Express and only less about the PulseAudio internals.

If anybody could help me a bit out here, give a rough overview where to start and what to do, that would be nice.

For example: 1. How can I distribute the server as an AirPort? Express base station via Avahi? 2. Good starting point for the emulation itself? (I assume that I would have to listen on some UDP port and then decode the stream, which is coded as Apple Lossless audio as far as I know. I would try to get the needed information about the protocol from the raop-play project.)

Changed 3 years ago by coling

Hi Albert,

As the person who has done most of the work on #69 I can say that the opposite, while very attractive, is very much harder.

For one AFAIK the encryption key that would allow us to emulate an airtunes device has not been cracked and thus it's pretty much impossible.

We are able to do #69 (and raop-play etc.) due to the fact that the encryption key for an older version of iTunes on PPC was cracked and we essentially emulate it. That's the only reason the airport devices will speak to us.

Another important factor is that the Airtunes devices are capable of AAC/ALAC decoding and other fanciness. I'd be a little reticent of adding this support into pulse directly but there is not real reason not to.. it just seems a little higher level than pulse's usual stuff. That said, if the keys were known, I think it would be a fun project, even if it's not part of pulse directly.

So as far as I know, this is pretty much impossible until the keys are known.

(I'd be happy to be corrected here)

Changed 3 years ago by albert

Hi Coling,

Thank you very much for pointing that out. That is really a pity.

To point it out more clearly, we basically have to get the private RSA key which belongs to this public RSA key:

152 	static int rsa_encrypt(uint8_t *text, int len, uint8_t *res) {
153 	    const char n[] =
154 	        "59dE8qLieItsH1WgjrcFRKj6eUWqi+bGLOX1HL3U3GhC/j0Qg90u3sG/1CUtwC"
155 	        "5vOYvfDmFI6oSFXi5ELabWJmT2dKHzBJKa3k9ok+8t9ucRqMd6DZHJ2YCCLlDR"
156 	        "KSKv6kDqnw4UwPdpOMXziC/AMj3Z/lUVX1G7WSHCAWKf1zNS1eLvqr+boEjXuB"
157 	        "OitnZ/bDzPHrTOZz0Dew0uowxf/+sG+NCK3eQJVxqcaJ/vEHKIVd2M+5qL71yJ"
158 	        "Q+87X6oV3eaYvt3zWZYD6z5vYTcrtij2VZ9Zmni/UAaHqn9JdsBWLUEpVviYnh"
159 	        "imNVvYFZeCXg/IdTQ+x4IRdiXNv5hEew==";
160 	    const char e[] = "AQAB";
...

(code from http://www.pulseaudio.org/browser/src/modules/raop/raop_client.c)

The private key should be stored somewhere on the AirPort? Express and is used to decrypt the message (as I have seen from the code, this RSA encryption is only used to transfer the AES key, whereby that does not really matter for the problem).

I sadly don't own an Airport Express myself, but for somebody who has access to one, wouldn't it be possible somehow to read the key from the device? (I guess that the key is not stored in any of their firmware updates, which would be a bit easier to read (or is it?).)

Changed 3 years ago by coling

  • status changed from new to closed
  • resolution set to wontfix

Well I'm not a crypto-ninja but my basic understanding is that yes, we need to work out the private key equiv of the above. I'm not sure how many keys are used in the airtunes devices, not sure if it's actually got several public key/private key pairs or just the one.

There is good info here: http://www.cocoadev.com/index.pl?AirTunes

In the absence of any amazing breakthrough, I may as well close this bug :(

FWIW, if someone worked on native fake-sound card devices for OSX and Windows for pulse, the need to use this facility would be more or less removed.... We just need passionate OSX and Windows devs to take up the challenge.

Feel free to join in more discussion on the PA mailing list if you think you can step up to the plate ;)

Changed 10 months ago by mourad

  • cc bugs-pulseaudio@… added
  • status changed from closed to reopened
  • resolution wontfix deleted

Now that the private key has been reverse-engineered and is in the open, maybe it's time to revisit this ticket.

It would be a nice feature, considering "AirPlay?" (RAOP) is still used a lot for quite a lot of devices (iTunes, iOS, appletv, etc).

shairport

Note: See TracTickets for help on using tickets.