steebono / airplayreceiver Goto Github PK
View Code? Open in Web Editor NEWOpen source implementation of AirPlay 2 Mirroring / Audio protocol.
License: MIT License
Open source implementation of AirPlay 2 Mirroring / Audio protocol.
License: MIT License
Hello, why is the mirror projection connection slow
Can anyone provide a example of how to play the raw pcm data stream using NAudio or something similar?
@SteeBono: Hello, I have sent a second mail, have you received?
Please reply in private.
Thanks in advance.
I have managed to successfully compile this software and dependencies, and I have been able to connect my device to this software. How would I view the incoming video/audio?
OnH264DataReceived: frameType=5, length=5076, pts=0
OnH264DataReceived: frameType=1, length=250, pts=0
OnH264DataReceived: frameType=1, length=384, pts=0
OnH264DataReceived: frameType=1, length=2393, pts=0
OnH264DataReceived: frameType=1, length=3616, pts=0
OnH264DataReceived: frameType=1, length=3747, pts=0
mirroringlistener->OnRawReceivedAsync
when the condition if (stream.DataAvailable) not satisfied,we need to wait for one milsec
I follow your step carefully, I successfully built AAC Codec, but failed to build ALAC codec. I'm having below error, not sure you have any clue? Thank you.
$ make
make all-recursive
make[1]: Entering directory '/home/Jing/alac'
Making all in codec
make[2]: Entering directory '/home/Jing/alac/codec'
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -Wno-multichar -g -O2 -MT libalac_la-LibALAC.lo -MD -MP -MF .deps/libalac_la-LibALAC.Tpo -c -o libalac_la-LibALAC.lo `test -f 'LibALAC.cpp' || echo './'`LibALAC.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -Wno-multichar -g -O2 -MT libalac_la-LibALAC.lo -MD -MP -MF .deps/libalac_la-LibALAC.Tpo -c LibALAC.cpp -DDLL_EXPORT -DPIC -o .libs/libalac_la-LibALAC.o
LibALAC.cpp:10:1: warning: 'typedef' was ignored in this declaration
10 | typedef struct EncoderInfo
| ^~~~~~~
LibALAC.cpp:17:1: warning: 'typedef' was ignored in this declaration
17 | typedef struct DecoderInfo
| ^~~~~~~
LibALAC.cpp:42:7: warning: 'void* InitializeEncoder(int, int, int, int, bool)' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
42 | void* InitializeEncoder(int sampleRate, int channels, int bitsPerSample, int framesPerPacket, bool useFastMode)
| ^~~~~~~~~~~~~~~~~
LibALAC.cpp: In function 'void* InitializeEncoder(int, int, int, int, bool)':
LibALAC.cpp:54:48: error: 'calloc' was not declared in this scope
54 | EncoderInfo * encoder = (EncoderInfo *)calloc(sizeof(EncoderInfo), 1);
| ^~~~~~
LibALAC.cpp: At global scope:
LibALAC.cpp:91:5: warning: 'int GetMagicCookieSize(void*)' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
91 | int GetMagicCookieSize(void* encoder)
| ^~~~~~~~~~~~~~~~~~
LibALAC.cpp:98:5: warning: 'int GetMagicCookie(void*, unsigned char*)' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
98 | int GetMagicCookie(void* encoder, unsigned char * outCookie)
| ^~~~~~~~~~~~~~
LibALAC.cpp:107:5: warning: 'int Encode(void*, unsigned char*, unsigned char*, int*)' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
107 | int Encode(void* encoder, unsigned char * inBuffer, unsigned char * outBuffer, int * ioNumBytes)
| ^~~~~~
LibALAC.cpp:114:5: warning: 'int FinishEncoder(void*)' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
114 | int FinishEncoder(void* encoder)
| ^~~~~~~~~~~~~
LibALAC.cpp: In function 'int FinishEncoder(void*)':
LibALAC.cpp:120:9: error: 'free' was not declared in this scope
120 | free(encoder);
| ^~~~
LibALAC.cpp:9:1: note: 'free' is defined in header '<cstdlib>'; did you forget to '#include <cstdlib>'?
8 | #include "EndianPortable.h"
+++ |+#include <cstdlib>
9 |
LibALAC.cpp: At global scope:
LibALAC.cpp:124:7: warning: 'void* InitializeDecoder(int, int, int, int)' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
124 | void* InitializeDecoder(int sampleRate, int channels, int bitsPerSample, int framesPerPacket)
| ^~~~~~~~~~~~~~~~~
LibALAC.cpp: In function 'void* InitializeDecoder(int, int, int, int)':
LibALAC.cpp:136:48: error: 'calloc' was not declared in this scope
136 | DecoderInfo * decoder = (DecoderInfo *)calloc(sizeof(DecoderInfo), 1);
| ^~~~~~
LibALAC.cpp:163:9: error: 'free' was not declared in this scope
163 | free(theMagicCookie);
| ^~~~
LibALAC.cpp:163:9: note: 'free' is defined in header '<cstdlib>'; did you forget to '#include <cstdlib>'?
LibALAC.cpp: At global scope:
LibALAC.cpp:167:7: warning: 'void* InitializeDecoderWithCookie(void*, int)' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
167 | void* InitializeDecoderWithCookie(void * inMagicCookie, int inMagicCookieSize)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
LibALAC.cpp: In function 'void* InitializeDecoderWithCookie(void*, int)':
LibALAC.cpp:181:48: error: 'calloc' was not declared in this scope
181 | DecoderInfo * decoder = (DecoderInfo *)calloc(sizeof(DecoderInfo), 1);
| ^~~~~~
LibALAC.cpp: At global scope:
LibALAC.cpp:190:5: warning: 'int Decode(void*, unsigned char*, unsigned char*, int*)' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
190 | int Decode(void* decoder, unsigned char * inBuffer, unsigned char * outBuffer, int * ioNumBytes)
| ^~~~~~
LibALAC.cpp:202:5: warning: 'int FinishDecoder(void*)' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
202 | int FinishDecoder(void* decoder)
| ^~~~~~~~~~~~~
LibALAC.cpp: In function 'int FinishDecoder(void*)':
LibALAC.cpp:207:9: error: 'free' was not declared in this scope
207 | free(decoder);
| ^~~~
LibALAC.cpp:207:9: note: 'free' is defined in header '<cstdlib>'; did you forget to '#include <cstdlib>'?
LibALAC.cpp: At global scope:
LibALAC.cpp:211:5: warning: 'int ParseMagicCookie(void*, int, int*, int*, int*, int*)' redeclared without dllimport attribute after being referenced with dll linkage
211 | int ParseMagicCookie(void * inMagicCookie, int inMagicCookieSize, int * outSampleRate, int * outChannels, int * outBitsPerSample, int * outFramesPerPacket)
| ^~~~~~~~~~~~~~~~
make[2]: *** [Makefile:602: libalac_la-LibALAC.lo] Error 1
make[2]: Leaving directory '/home/Jing/alac/codec'
make[1]: *** [Makefile:404: all-recursive] Error 1
make[1]: Leaving directory '/home/Jing/alac'
make: *** [Makefile:336: all] Error 2
I hit below error for some reason when connecting from my mobile.
Do you have any clue? Nuget seems restore the Curve25519 lib successfully.
I ran in windows 10 using VS2022.
IP address fe80::2d6d:601:da5:809c%5
IP address 192.168.9.99
NIC 'Internet1'
Client connected: 192.168.9.152:53603
System.TypeLoadException: Could not load type 'org.whispersystems.curve25519.Curve25519' from assembly 'Curve25519, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null'.
at AirPlay.Listeners.AirTunesListener.OnDataReceivedAsync(Request request, Response response, CancellationToken cancellationToken)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at AirPlay.Listeners.AirTunesListener.OnDataReceivedAsync(Request request, Response response, CancellationToken cancellationToken)
at AirPlay.Listeners.BaseTcpListener.ReadFormattedAsync(TcpClient client, NetworkStream stream, CancellationToken cancellationToken) in D:\Source\airplayreceiver\AirPlay\Listeners\Bases\BaseTcpListener.cs:line 174
at AirPlay.Listeners.BaseTcpListener.HandleClientAsync(TcpClient client, CancellationToken cancellationToken) in D:\Source\airplayreceiver\AirPlay\Listeners\Bases\BaseTcpListener.cs:line 89
Hello. First of all, let me congratulate your for this amazing work.
I was messing a little bit with this library when I sew that video requests are not handled.
These requests are sent when you share a video in safari browser using airplay.
Do you have any information about them?
How to programmatically play the video packets received in byte array through VLC or Media Element? I captured the 10-minute feed and later played it manually through the VLC player but the video saved was only 2 mins in very fast forwarding mode and some parts missing. So how to resolve it?
I've got the code running and dumping out screen mirrored frames but I'm not sure how to look at these.
Can I concatenate these into a file viewable with Quicktime or something? Do I need to create a header?
Hi Stefano,
your project looks interesting, but there are no clues given about how to build it.
(or I couldn't find them). I am using OpenSuse 15.3 but could also use Ubuntu 20.04 if needed.
I am not familiar with C#, but have managed to install Microsoft dotnet sdk 5.0.0, mono-complete 6.12.0 and
monodevelop 7.8.4 on OpenSuse 15.3 which I suppose provides the C# development tools on linux..
But I have absolutely no idea what to actually do to build your app. (building the aac library seems clear, but the editing of alac makefiles is not (do you mean "edit" (changing them with an editor), or simple "replacement" with GiteKat's files).
Also, where should these AAC and ALAC libraries be built (which location relative to the airplayreceiver directory tree?, or should "sudo make install" be used).
You need to give full and absolutely-explicit recipe-style build instructions (for at least one Linux distribution such as ubuntu) for people to try out your app.
If you give me enough clues to how to build your app, and I succeed, I can write up clear instructions for e.g. ubuntu 20.04 and leave them as a Pull Request for your README.md.
I would like to see how well your app works. I have been maintaining the Linux/macOS UxPlay GStreamer-based airplay-mirror server http://github.com/FDH2/UxPlay (which has the history shairplay -> RPiPlay -> UxPlay ) and have been trying (struggling) to add back the ALAC support in the RAOP audio which was present in Shairplay (and still works there, but seems to be using the older airplay protocol) , but was cut out when the mirror-protocol-only RPiPlay was derived from it..
If your app works great, I might just leave off further development of UxPlay, and recommend your app, or at least I might be able to see if your code gives any clue to what I am not doing right in UxPlay for ALAC (AAC-ELD is working fine, and I haven't been able to test "legacy" AAC (AAC-LC) because my iPads only stream either AAC-ELD (with airplay-mirror protocol) or ALAC with (airplay only protocol).
Hello, I am referencing your code recently. Could you provide the license of your repository? I found that your repository does not add any license. Thank you.
Stephano, you have a "cut-and-paste" error in the Wiki document in the Air Tunes Audio Data Setup response section.
You repeated (by cut-and-paste?) the eventPort/timingPort port response from the first setup request.
After the "streams" request for type 96, the response should be dataPort/controlPort/96
(like the dataPort/110 "streams" response for type 110).
because DUMP feature is depending on your environment. For me, /Users/steebono
is not exists.
airplayreceiver/AirPlay/Program.cs
Lines 66 to 82 in a7634c4
Error message:
System.UnauthorizedAccessException: Access to the path '/Users/steebono/Desktop/dump/' is denied. ---> System.IO.IOException: Permission denied
The video general in portrait mode.
But when I fullscreen the playing video and rotate the iPhone, the video change to landscape mode.
Currently, how to know the video in landscape mode and need to rotate the decode frame?
Any flag can distinguish this requirement?
Dear developer, I have a question. During the process of image projection, opening the iPhone Video playback software video will interrupt the current projection operation. What is the reason, or do you have relevant information. Thank you very much.
Natively, I can make the Pro the 2nd monitor for the Air, but the Air lacks power and I get laggs and disconnects to the Pro.
Thanks!
Manny
Nice Work @SteeBono . Could you outline steps on how to mirror an iPhone?
How do I get the image after the projection connection?
Hello. Can you help me create client for your server? I can pay for help.
it seems the loop will never break;
in this method AudioListener->OnRawDSocketAsync->
while ((audiobuf = RaopBufferDequeue(_raopBuffer, ref audiobuflen, ref timestamp, no_resend)) != null)
Hi SteeBono,
Currently I can use the Width, Height, WidthSource and HeightSource to determine iPhone is default in Portrait mode or in Landscape (rotate 90 degree) mode.
But I don't know how to determine iPhone left or right rotate and than I can only rotate my video correctly in left rotate mode but up side down video in right rotate mode.
Have you know how to find the flag that indicate iPhone in left or right rotate mode?
Thank you.
0x40000: ALAC (96 AppleLossless, 96 352 0 16 40 10 14 2 255 0 0 44100)
I'm trying to make a GStreamer pipeline for playing decrypted ALAC format audio received by
by a linux-based AirPlay server http://github.com/FDH2/UxPlay that currently only does AAC_ELD audio.
I guess I know what the 96 and 44100 mean; do you have any idea what the other entries (352.... ) above mean?
How to receive audio session successfully?
I can only receive type 110 to start MirroringListener.
But never receive type 96 to start AudioListener.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.