homeworkc / lazycast

A Simple Wireless Display Receiver
GNU General Public License v3.0
688 stars 89 forks source link

Switching displays breaks functionality (maybe) #104

Closed JpTiger closed 2 years ago

JpTiger commented 2 years ago

I used Lazycast successfully with a widescreen monitor on a Raspberry Pi Zero W. I used the exact same pi and configuration but unplugged the old monitor and plugged in an old 4:3 Dell Ultrasharp. The pi works fine with the display, and I can establish a remote connection with Lazycast, but I just get an Unnamed Window with a black screen upon connecting. The serving computer seems to think all is well, and will allow me theoretically to change resolutions, but Windows defaults to and recommends the resolution of the old monitor. Changing to the correct resolution does not fix the issue. This happens when trying to extend my display from two different Windows machines.

barhun commented 2 years ago

Did you try deleting the file edid.txt located in the directory that you launch lazycast from? This is the file which provides possible configurations that your display supports and it gets generated only if there isn't one already in place, so you may need to delete it after connecting a different display. (:

JpTiger commented 2 years ago

Did you try deleting the file edid.txt located in the directory that you launch lazycast from? This is the file which provides possible configurations that your display supports and it gets generated only if there isn't one already in place, so you may need to delete it after connecting a different display. (:

Makes logical sense but unfortunately doesn't work. Tried closing all.sh, deleting edid.txy and relaunching, but the issue persists.

JpTiger commented 2 years ago

Odd development, there might be more going on here. I tried renaming the lazycast folder, cloning into a fresh copy of the github repo and compiling again. The issue mostly still persists: that is Unnamed window opens, black, but then nothing else is displayed and everything else seems to think it's working properly. But this time when I go on the windows machine to see what resolution it's detecting, it's detecting the correct one.

FWIW I'm running Raspbian Stretch on a raspberry pi zero w (first gen) having swapped out the default wifi handler for NetworkManager, as instructed here.

I ran all.sh via SSH this time as an experiment, so I got the printout while it's running. Here it is (including when I manually disconnected):


wlan0
Selected interface 'p2p-wlan0-0'
Available interfaces:
p2p-wlan0-0
p2p-dev-wlan0
wlan0
already on
p2p-wlan0-0
The display is ready
Your device is called: rpi0w
PIN:
31415926
PIN:
31415926
---M1--->
OPTIONS * RTSP/1.0
Require: org.wfa.wfd1.0
CSeq: 1

<--------
RTSP/1.0 200 OK
CSeq: 1
Public: org.wfa.wfd1.0, SET_PARAMETER, GET_PARAMETER

<---M2---
OPTIONS * RTSP/1.0
CSeq: 1
Require: org.wfa.wfd1.0

-------->
RTSP/1.0 200 OK
Server: MSMiracastSource/10.00.19041.1526 guid/73679708-34CC-0003-342D-7473CC34D801
Public: org.wfa.wfd1.0, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER
CSeq: 1

---M3--->
GET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Content-Length: 673
Content-Type: text/parameters
CSeq: 2

wfd_video_formats
wfd_audio_codecs
wfd_client_rtp_ports
wfd_display_edid
wfd_connector_type
wfd_uibc_capability
wfd2_rotation_capability
wfd2_video_formats
wfd2_audio_codecs
wfd2_video_stream_control
wfd_content_protection
wfd_idr_request_capability
intel_friendly_name
intel_sink_manufacturer_name
intel_sink_model_name
intel_sink_version
intel_sink_device_URL
microsoft_latency_management_capability
microsoft_format_change_capability
microsoft_diagnostics_capability
microsoft_cursor
microsoft_rtcp_capability
microsoft_video_formats
microsoft_max_bitrate
microsoft_multiscreen_projection
microsoft_audio_mute
microsoft_color_space_conversion

Written 128 bytes to edid.txt
<--------
RTSP/1.0 200 OK
CSeq: 2
Content-Type: text/parameters
Content-Length: 940

wfd_client_rtp_ports: RTP/AVP/UDP;unicast 1028 0 mode=play
wfd_audio_codecs: LPCM 00000002 00
wfd_video_formats: 00 00 02 10 0001FEFF 3FFFFFFF 00000FFF 00 0000 0000 00 none none
wfd_3d_video_formats: none
wfd_coupled_sink: none
wfd_connector_type: 05
wfd_uibc_capability: input_category_list=GENERIC, HIDC;generic_cap_list=Keyboard, Mouse;hidc_cap_list=Keyboard/USB, Mouse/USB;port=none
wfd_standby_resume_capability: none
wfd_content_protection: none
wfd_display_edid: 0001 00ffffffffffff0010ac1540484d41411910010380261e78eede95a3544c99260f5054a54b00714f8180010101010101010101010101302a009851002a4030701300782d1100001e000000ff00444333323336364b41414d480a000000fc0044454c4c203139303746500a20000000fd00384c1e510e000a20202020202000e2
intel_friendly_name: raspberrypi
intel_sink_manufacturer_name: lazycast
intel_sink_model_name: lazycast
intel_sink_version: 20.4.26
intel_sink_device_URL: https://github.com/homeworkc/lazycast

---M4--->
SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Content-Length: 398
Content-Type: text/parameters
CSeq: 3

wfd_video_formats: 00 00 02 10 00000000 00008000 00000000 00 0000 0000 00 none none
wfd_audio_codecs: LPCM 00000002 00
wfd_presentation_URL: rtsp://192.168.173.80/wfd1.0/streamid=0 none
wfd_client_rtp_ports: RTP/AVP/UDP;unicast 1028 0 mode=play
intel_overscan_comp: x=0, y=0
wfd_uibc_capability: input_category_list=HIDC;generic_cap_list=none;hidc_cap_list=Keyboard/USB, Mouse/USB;port=50000

<--------
RTSP/1.0 200 OK
CSeq: 3

uibcport:50000

---M5--->
SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Content-Length: 27
Content-Type: text/parameters
CSeq: 4

wfd_trigger_method: SETUP

<--------
RTSP/1.0 200 OK
CSeq: 4

<---M6---
SETUP rtsp://192.168.173.80/wfd1.0/streamid=0 RTSP/1.0
CSeq: 5
Transport: RTP/AVP/UDP;unicast;client_port=1028

-------->
RTSP/1.0 200 OK
Transport: RTP/AVP/UDP;unicast;client_port=1028;server_port=57512;ssrc=aebf7cfe;rtcp-fb-ssrc=aebf7cff
Server: MSMiracastSource/10.00.19041.1526 guid/73679708-34CC-0003-342D-7473CC34D801
Blocksize: 1450
Session: 93289466
CSeq: 5

['RTSP/1.0 200 OK\r\nTransport: RTP/AVP/UDP', 'unicast', 'client_port=1028', 'server_port=57512', 'ssrc=aebf7cfe', 'rtcp-fb-ssrc=aebf7cff\r\nServer: MSMiracastSource/10.00.19041.1526 guid/73679708-34CC-0003-342D-7473CC34D801\r\nBlocksize: 1450\r\nSession: 93289466\r\nCSeq: 5\r\n\r\n']
['server_port=57512']
57512
<---M7---
PLAY rtsp://192.168.173.80/wfd1.0/streamid=0 RTSP/1.0
CSeq: 6
Session: 93289466

port:4294951760
sourceip:3203359807
-------->
RTSP/1.0 200 OK
Server: MSMiracastSource/10.00.19041.1526 guid/73679708-34CC-0003-342D-7473CC34D801
Date: Sun, 13 Mar 2022 19:06:55 GMT
Session: 93289466
CSeq: 6

---- Negotiation successful ----
senddes:62
192.168.173.1
./h264/h264.bin 53689 0 192.168.173.1 &
idrport:53689
audiodest:0
sinkip:192.168.173.1
set audio backend :hdmi
oldcc 0 cc 8
idr:12
start:788, end:789
oldcc 11 cc 15
send idr
SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Content-Length: 17
Content-Type: text/parameters
CSeq: 103

wfd_idr_request

idr:12
start:807, end:809
oldcc 12 cc 7
idr:12
start:912, end:917
oldcc 1 cc 4
idr:12
start:985, end:988
oldcc 13 cc 11
RTSP/1.0 200 OK
Server: MSMiracastSource/10.00.19041.1526 guid/73679708-34CC-0003-342D-7473CC34D801
Session: 93289466
CSeq: 103

['RTSP/1.0 200 OK\r\nServer: MSMiracastSource/10.00.19041.1526 guid/73679708-34CC-0003-342D-7473CC34D801\r\nSession: 93289466\r\nCSeq: 103', '']
[]
send idr
SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Content-Length: 17
Content-Type: text/parameters
CSeq: 104

wfd_idr_request

send idr
SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Content-Length: 17
Content-Type: text/parameters
CSeq: 105

wfd_idr_request

send idr
SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Content-Length: 17
Content-Type: text/parameters
CSeq: 106

wfd_idr_request

RTSP/1.0 200 OK
Server: MSMiracastSource/10.00.19041.1526 guid/73679708-34CC-0003-342D-7473CC34D801
Session: 93289466
CSeq: 104

RTSP/1.0 200 OK
Server: MSMiracastSource/10.00.19041.1526 guid/73679708-34CC-0003-342D-7473CC34D801
Session: 93289466
CSeq: 105

RTSP/1.0 200 OK
Server: MSMiracastSource/10.00.19041.1526 guid/73679708-34CC-0003-342D-7473CC34D801
Session: 93289466
CSeq: 106

['RTSP/1.0 200 OK\r\nServer: MSMiracastSource/10.00.19041.1526 guid/73679708-34CC-0003-342D-7473CC34D801\r\nSession: 93289466\r\nCSeq: 104', 'RTSP/1.0 200 OK\r\nServer: MSMiracastSource/10.00.19041.1526 guid/73679708-34CC-0003-342D-7473CC34D801\r\nSession: 93289466\r\nCSeq: 105', 'RTSP/1.0 200 OK\r\nServer: MSMiracastSource/10.00.19041.1526 guid/73679708-34CC-0003-342D-7473CC34D801\r\nSession: 93289466\r\nCSeq: 106', '']
[]
SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Content-Length: 30
Session: 93289466
Content-Type: text/parameters
CSeq: 5

wfd_trigger_method: TEARDOWN

PIN:
31415926
^[```
JpTiger commented 2 years ago

Isolated the issue. It's not the new display, it's that I enabled the full KMS GL Driver for a different piece of software and forgot about it later. Disabling the driver and rebooting solved the issue. Closing this one and will open a new issue if that one hasn't already been reported.