FDH2 / UxPlay

AirPlay Unix mirroring server
GNU General Public License v3.0
1.35k stars 72 forks source link

Only audio working #44

Closed kofm closed 2 years ago

kofm commented 2 years ago

Hi, thanks for this amazing project

I'm trying to make it work on my machine but I get audio only, no video shows up. I installed both AUR packages, then tried to compile myself without gstreamer-vaapi Tried also both "-vs ximagesink" and "-vs xvimagesink"

I can't see anything wrong in debug logs except for a raop_ntp receive timeout; however, after compiling from source I don't get that timeout message anymore

Here is part of my logs, please tell me which part could be useful because are very large

httpd receiving on socket 28
conn_request

POST /feedback RTSP/1.0
CSeq: 61
DACP-ID: EAB6CE19D67DEC4D
Active-Remote: 2416368236
User-Agent: AirPlay/545.22.21

Handling request POST with URL /feedback
raop_handler_feedback

RTSP/1.0 200 OK 
CSeq: 61 
Server: AirTunes/220.68 

raop_ntp send_len = 32
raop_ntp receive time type_t packetlen = 32
raop_ntp sync correction = 0
httpd receiving on socket 28
conn_request
fduncanh commented 2 years ago

This is what a correct startup should look like (-p is used because a firewall is running)

$ uxplay -p
using network ports UDP 7011 6001 6000 TCP 7100 7000 7001
using system MAC address xx:xx:xx:xx:xx:xx
Initialized server socket(s)
Accepted IPv4 client on socket 30
Local: 192.168.1.3
Remote: 192.168.1.35
Open connections: 1
Client identified as User-Agent: AirPlay/600.8.1
Accepted IPv4 client on socket 32
Local: 192.168.1.3
Remote: 192.168.1.35
Open connections: 2
raop_rtp_mirror starting mirroring
ct=8 spf=480 usingScreen=1 isMedia=1  audioFormat=0x1000000
start audio connection, format AAC-ELD 44100/2
raop_rtp starting audio
ct=8 spf=480 usingScreen=1 isMedia=1  audioFormat=0x1000000
raop_rtp starting audio

This (below) is what the uxplay -d debug output shows after all the setup is successfully finished

raop_rtp_mirror accepting client                                                                                                                                                                                  
raop_rtp type_c 0x54, packetlen = 20                                                                                                                                                                              
raop_rtp sync: ntp=228207842706, local ntp: 1641277672982257, rtp=3930228331, rtp_next=3930246853                                                                                                                 
raop_rtp sync correction=-1641188552158425                                                                                                                                                                        
raop_rtp_mirror width_source = 1440.000000 height_source = 1080.000000 width = 1440.000000 height =1080.000000                                                                                                   |
raop_rtp_mirror sps size = 18                                                                                                                                                                                     
raop_rtp_mirror pps size = 4                                                                                                                                                                                      
raop_rtp_mirror video ntp = 1641277673101117, now = 1641277673048926, latency = -52191                                                                                                                            
raop_rtp_mirror video ntp = 1641277673151073, now = 1641277673054071, latency = -97002                                                                                                                            
raop_rtp audio: ntp = 1641277673584320, now = 1641277673078366, latency=-505954, rtp=3930254882                                                                                                                   
raop_rtp audio: ntp = 1641277673584320, now = 1641277673078374, latency=-505946, rtp=3930254882    

If you get this but no video, its probably a GStreamer problem (missing plugin probably)

In that case, (assuming you have an X11 window Linux system), try

export GST_DEBUG=2 uxplay -vs ximagesink

for even more info, use GST_DEBUG=4 This should give a clue as to what is wrong with your GStreamer setup, and why video is not working.]

here is a full debug output of a normal start for you to compare with: uxplay_debug_output.txt

fduncanh commented 2 years ago

@kofm if you solve your problem, please post what the solution was!

kofm commented 2 years ago

Thank you so much for the prompt response! I also suspect a GStreamer issue but unfortuately installing gstreamer-bad on my arch machine turned out to be a pain the a**

I'll give it another try asap, sorry for the delay

fduncanh commented 2 years ago

gstreamer-plugins-bad supplies the video h264 codec needed for video

thiccaxe commented 2 years ago

For future reference, I found that several streaming apps (such as YouTube) do not send over the video (only audio)- instead, try screen mirroring, for example through the photos app. While there may be some GStreamer related issues, video may not be showing up simply because it's not being sent.

fduncanh commented 2 years ago

@thiccaxe youtube videos (at least the free ones I've tried) stream fine (video + audio).

apple tv (the app not the box) doesnt sent the video, I assumed because of DRM encryption. ( the surrounding frame shows, but with a black interior)

Can you give a specific example/link for the YouTube problem so it can be tested to see exactly what is happening? Is it some YouTube service one needs to subscribe too>?

thiccaxe commented 2 years ago

@fduncanh Huh, I thought there was some issue with the youtube app. I saw that in the plist the client sends over, with the youtube app, the <key>isScreenMirroringSession</key><true/> is not present; in a simple photos air play, it is. I sent the previous message thinking that if you tried some other form of screen cast / mirror, the video might play (as of course, in the youtube case, the video isn't sent!)

At anyrate, here is the log for airplaying a photo from the photos app: photos_app_airplay_photo.txt

Additionally, here is the youtube log: youtube_app_airplay_video.txt

I used this video in Anonymous mode in the app. *Audio plays, but no video.

Finally, to clarify, are you clicking the rectangle with a wifi symbol, then AirPlay & Bluetooth devices to use airplay in the youtube app?

To clarify, the above method does not send over video, whereas a regular screen cast (throgh control center) and then opening the youtube app is sending both A & V. (apps like netflix only show a black screen, presumable DRM, whereas YT shows video - which made me a little confused as to why youtube's in - app air play wasn't sending video)

fduncanh commented 2 years ago

@thiccaxe

The video https://www.youtube.com/watch?v=60ItHLz5WEA plays perfectly for me on UxPlay..... (from an iPad running i current PadOS 15.2) (What is "Anonymous mode" in the app? I am using firefox to open the video on the iPad, and mirroring the screen to UxPlay, maybe you are doing something different)

Are you getting any video at all from UxPlay? (please test on web pages shown in a browser on iPad or iPhone, not on photos.app)

I'll look into your report about photos_app,

fduncanh commented 2 years ago

@thiccaxe

I installed the Youtube app on an iPad, , ignored the prompts for signing in, etc, (which I guess is "anonymous mode")

I Searched for your video, which seems to be the music video

Faded #AlanWalker #EDM

Alan Walker - Faded 3,209,983,268 views Dec 4, 2015

It played perfectly on UxPlay, using the YouTube app; both audio and video so I don't understand what problem you seem to be reporting with it.

thiccaxe commented 2 years ago

It played perfectly on UxPlay, using the YouTube app; both audio and video so I don't understand what problem you seem to be reporting with it.

When using the app, are you using this button? image

If I use that button, then only audio works. Otherwise, both audio and video work through UxPlay.

fduncanh commented 2 years ago

@thiccaxe

I see what you are doing: you are only streaming audio (in Apple lossless ALAC mode) using the Airplay audio-only protocol.

There are two buttons you can use . Look for the Mirror button (two rounded rectangles overlapping) for mirror video + compressed AAC-ELD audio. You used the audio only one, in the top right corner.

fduncanh commented 2 years ago

Tap Screen Mirroring .https://support.apple.com/library/content/dam/edam/applecare/images/en_US/appletv/ios12-2-screen-mirror-icon.png

thiccaxe commented 2 years ago

Thanks. Yeah, the image I posted is from inside the youtube app. the "two rectangles" button is in the control center and works as expected for screen mirroring. I suppose it's an issue with youtube then.

fduncanh commented 2 years ago

UxPlay is not a full emulation of Apple TV, In particular it doesn't let the client run a http server on the server, which is probably what the YouTube app wants to do.

fduncanh commented 2 years ago

The photos app seems to work correctly, from within it, runs slideshows etc