FD- / RPiPlay

An open-source AirPlay mirroring server for the Raspberry Pi. Supports iOS 9 and up.
GNU General Public License v3.0
4.94k stars 353 forks source link

Cannot establish connection if using rpi renderer #324

Open jens-auer opened 2 years ago

jens-auer commented 2 years ago

Hi,

i have a new Raspberry Zero 2 W with a fresh installation of Raspbian (Buster) Lite. After installing dependencies and building rpiplay I am unable to connect for screen mirroring if I chose the rpi renderer. Everything works as expected when I start rpiplay with the dummy renderer:

pi@Arrakis:~ $ rpiplay -vr dummy -ar dummy -n Arrakis
Initialized server socket(s)
*** WARNING *** The program 'rpiplay' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
Accepted IPv4 client on socket 14
Local: 192.168.178.46
Remote: 192.168.178.34
Connection closed for socket 14
Destroying connection
Accepted IPv4 client on socket 14
Local: 192.168.178.46
Remote: 192.168.178.45
Accepted IPv4 client on socket 16
Local: 192.168.178.46
Remote: 192.168.178.45
raop_rtp_mirror starting mirroring
^CStopping...
Removing connection for socket 14
Destroying connection
Removing connection for socket 16
Destroying connection

But when I want to use the rpi video renderer I can see the mirroring device on my Mac hardware (Iphone 12 and Mac Book Pro 13" with latest software), but no connection is established:

pi@Arrakis:~ $ rpiplay  -d -ar dummy -n Arrakis
Initialized server socket(s)
*** WARNING *** The program 'rpiplay' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
Accepted IPv4 client on socket 15
Local: 192.168.178.46
Remote: 192.168.178.34
httpd receiving on socket 15
Connection closed for socket 15
Destroying connection

Additionally, I cannot exit rpiplay with CTRL-C, instead I have to CTRL-Z and kill it with a kill -9.

To make sure that the OMX renderer works I installed omxplayer and successfully played a video without any issues.

I am a bit puzzled because I do not see much information in the log despite using "-d". Since the connection can be established with dummy renderers I would rule out network issues. Is there a way to enable additional logging? I also attached gdb to a process after trying to stop rpiplay with CTRL-C but it just showed that main is stuck in sleep.

pallas commented 2 years ago

Have you tried running the process as root?

jens-auer commented 2 years ago

Yes, same behavior if started as root

pi@Arrakis:~ $ sudo su -
root@Arrakis:~# cd /home/pi/
root@Arrakis:/home/pi# ls
bigbuckbunny_30sclip.mp4  RPiPlay
root@Arrakis:/home/pi# cd RPiPlay/
root@Arrakis:/home/pi/RPiPlay# cd build/
root@Arrakis:/home/pi/RPiPlay/build# ./rpiplay -n Arrakis -d
> stream info: channel = 2      sample_rate = 44100     frame_size = 480        aot = 39        bitrate = 0
Initialized server socket(s)
*** WARNING *** The program 'rpiplay' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
Accepted IPv4 client on socket 16
Local: 192.168.178.46
Remote: 192.168.178.34
httpd receiving on socket 16
Connection closed for socket 16
Destroying connection
^CStopping

No connection possible and I have to kill -9 the process. No problem with dummy renderers:

root@Arrakis:/home/pi/RPiPlay/build# ./rpiplay -n Arrakis -d -ar dummy -vr dummy
Initialized server socket(s)
*** WARNING *** The program 'rpiplay' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
Accepted IPv4 client on socket 15
Local: 192.168.178.46
Remote: 192.168.178.34
httpd receiving on socket 15
Connection closed for socket 15
Destroying connection
Accepted IPv4 client on socket 15
Local: 192.168.178.46
Remote: 192.168.178.39
httpd receiving on socket 15
conn_request
Handling request GET with URL /info
INFO len = 1985792228
httpd receiving on socket 15
conn_request
Handling request POST with URL /pair-setup
httpd receiving on socket 15
conn_request
Handling request POST with URL /pair-verify
httpd receiving on socket 15
conn_request
Handling request POST with URL /pair-verify
httpd receiving on socket 15
conn_request
Handling request POST with URL /fp-setup
httpd receiving on socket 15
conn_request
Handling request POST with URL /fp-setup
httpd receiving on socket 15
conn_request
Handling request SETUP with URL rtsp://192.168.178.46/13757449704852637094
DACP-ID: BD764597FDE5675
Active-Remote: 2928885834
Transport: null
SETUP 1
eiv_len = 16
ekey_len = 72
fairplay_decrypt ret = 0
timing_rport = 51161
raop_ntp parse remote ip = 192.168.178.39
raop_ntp starting time
raop_rtp parse remote ip = 192.168.178.39
raop_rtp_mirror parse remote ip = 192.168.178.39
eport = 44257, tport = 37430
raop_ntp send_len = 32
raop_ntp receive time type_t packetlen = 32
raop_ntp sync correction = -1645740630612396
Accepted IPv4 client on socket 17
Local: 192.168.178.46
Remote: 192.168.178.39
httpd receiving on socket 15
conn_request
Handling request GET with URL /info
INFO len = 1985792228
httpd receiving on socket 15
conn_request
Handling request GET_PARAMETER with URL rtsp://192.168.178.46/13757449704852637094
httpd receiving on socket 15
conn_request
Handling request RECORD with URL rtsp://192.168.178.46/13757449704852637094
raop_handler_record
httpd receiving on socket 15
conn_request
Handling request SET_PARAMETER with URL rtsp://192.168.178.46/13757449704852637094
httpd receiving on socket 15
conn_request
Handling request SETUP with URL rtsp://192.168.178.46/13757449704852637094
DACP-ID: BD764597FDE5675
Active-Remote: 2928885834
Transport: null
type = 110
streamConnectionID = 15460769616358490276
raop_rtp_mirror starting mirroring
Mirroring initialized successfully
raop_rtp_mirror accepting client
raop_rtp_mirror width_source = 450.000000 height_source = 972.000000 width = 470.000000 height = 1016.000000
raop_rtp_mirror sps size = 17
raop_rtp_mirror pps size = 4
raop_rtp_mirror video ntp = 1645897812992558, now = 1645897812922352, latency = -70206
raop_rtp_mirror video ntp = 1645897813009237, now = 1645897812923940, latency = -85297
raop_rtp_mirror video ntp = 1645897813042595, now = 1645897813025703, latency = -16892
raop_rtp_mirror video ntp = 1645897813059274, now = 1645897813026484, latency = -32790
raop_rtp_mirror video ntp = 1645897813075954, now = 1645897813027577, latency = -48377
raop_rtp_mirror video ntp = 1645897813092633, now = 1645897813032234, latency = -60399
raop_rtp_mirror video ntp = 1645897813109312, now = 1645897813035153, latency = -74159
raop_rtp_mirror video ntp = 1645897813125991, now = 1645897813036255, latency = -89736
raop_rtp_mirror video ntp = 1645897813142670, now = 1645897813045916, latency = -96754
raop_rtp_mirror video ntp = 1645897813159349, now = 1645897813057175, latency = -102174
raop_rtp_mirror video ntp = 1645897813176028, now = 1645897813072910, latency = -103118
raop_rtp_mirror video ntp = 1645897813192708, now = 1645897813091997, latency = -100711
raop_rtp_mirror video ntp = 1645897813209387, now = 1645897813110070, latency = -99317
raop_rtp_mirror video ntp = 1645897813226066, now = 1645897813125454, latency = -100612
raop_rtp_mirror video ntp = 1645897813242745, now = 1645897813143358, latency = -99387
raop_rtp_mirror video ntp = 1645897813259424, now = 1645897813156899, latency = -102525
raop_rtp_mirror video ntp = 1645897813276104, now = 1645897813173121, latency = -102983
raop_rtp_mirror video ntp = 1645897813292783, now = 1645897813192043, latency = -100740
raop_rtp_mirror video ntp = 1645897813309462, now = 1645897813209317, latency = -100145
raop_rtp_mirror video ntp = 1645897813326141, now = 1645897813222558, latency = -103583
raop_rtp_mirror video ntp = 1645897813342808, now = 1645897813273584, latency = -69224
raop_rtp_mirror video ntp = 1645897813359474, now = 1645897813288687, latency = -70787
raop_rtp_mirror video ntp = 1645897813376141, now = 1645897813305537, latency = -70604
httpd receiving on socket 15
conn_request
Handling request POST with URL /feedback
raop_handler_feedback
raop_rtp_mirror video ntp = 1645897814944016, now = 1645897814850610, latency = -93406
raop_rtp_mirror video ntp = 1645897814960683, now = 1645897814898419, latency = -62264
raop_rtp_mirror video ntp = 1645897814977350, now = 1645897814914067, latency = -63283
raop_rtp_mirror video ntp = 1645897814994016, now = 1645897814931356, latency = -62660
raop_ntp send_len = 32
raop_ntp receive time type_t packetlen = 32
raop_ntp sync correction = 0
^CStopping
Removing connection for socket 15
Destroying connection
raop_ntp stopping time thread
raop_ntp exiting thread
raop_ntp stopped time thread
raop_rtp_mirror exiting TCP thread
Removing connection for socket 17
Destroying connection
Exiting HTTP thread