FDH2 / UxPlay

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

X Error of failed request: BadWindow (invalid Window parameter) when connection established #100

Closed catielanier closed 2 years ago

catielanier commented 2 years ago

OS: Garuda Linux Kernel Version: 5.18.1-zen1-1-zen UxPlay Version: 1.43 DE: KDE Plasma 5.24.5 Phone: iPhone XR iOS Version: 15.5

Issue

Repeatedly getting the following readout after connection established:

ccepted IPv4 client on socket 29
Local: 192.168.0.117
Remote: 192.168.0.38
Open connections: 1
Accepted IPv4 client on socket 32
Local: 192.168.0.117
Remote: 192.168.0.38
Open connections: 2
raop_rtp_mirror starting mirroring
X Error of failed request:  BadWindow (invalid Window parameter)
Major opcode of failed request:  20 (X_GetProperty)
Resource id in failed request:  0x7400002
Serial number of failed request:  21988
Current serial number in output stream:  21988

The only workaround I've seemed to find is to disconnect both my wired and wireless connections, then reconnect both, then establish a connection. This seems to work temporarily, but then video playback stalls after about 5 minutes while audio playback continues to operate normally.

I have previously had this working on the same system under an earlier version, but since has stopped working. The only difference is I had recently performed a firmware update on my iPhone to 15.5, so I'm wondering if this is an issue between this firmware version and UxPlay?

fduncanh commented 2 years ago

Update to UxPlay-1.52 (latest).

if you still have problem report back.

Nothing to do with iPhone

fduncanh commented 2 years ago

Maybe also read troubleshooting section of README, try different videosinks.

But use latest uxplay.

fduncanh commented 2 years ago

I assume this is resolved, since no feedback. should the issue be closed?

NyaomiDEV commented 2 years ago
Accepted IPv4 client on socket 32
Local: 192.168.1.1
Remote: 192.168.1.223
Open connections: 1
Client identified as User-Agent: AirPlay/635.66.3
Accepted IPv4 client on socket 36
Local: 192.168.1.1
Remote: 192.168.1.223
Open connections: 2
raop_rtp_mirror starting mirroring
Begin streaming to GStreamer video pipeline
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  20 (X_GetProperty)
  Resource id in failed request:  0x5c00002
  Serial number of failed request:  2825
  Current serial number in output stream:  2825

Still not solved on UxPlay 1.52; though I have an iPhone 11 running iOS 15 and I am using Linux 5.18.2 on Artix Linux with KDE Plasma 5.24.5.

fduncanh commented 2 years ago


Also, get GStreamer diagnostic error messages with

``
export GST_DEBUG=2
``

before running uxplay
NyaomiDEV commented 2 years ago
0:00:00.035137115 14639 0x55627c2d7660 WARN              vaapiblend gstvaapiblend.c:184:gst_vaapi_blend_initialize:<vaapiblend0> VPP does not support global alpha blending

(gst-plugin-scanner:14639): GLib-GObject-WARNING **: 19:37:14.070: type name '-a-png-encoder-pred' contains invalid characters

(gst-plugin-scanner:14639): GLib-GObject-CRITICAL **: 19:37:14.070: g_type_set_qdata: assertion 'node != NULL' failed

(gst-plugin-scanner:14639): GLib-GObject-CRITICAL **: 19:37:14.070: g_type_set_qdata: assertion 'node != NULL' failed

(gst-plugin-scanner:14639): GLib-GObject-WARNING **: 19:37:14.099: type name '-a-png-encoder-pred' contains invalid characters

(gst-plugin-scanner:14639): GLib-GObject-CRITICAL **: 19:37:14.099: g_type_set_qdata: assertion 'node != NULL' failed

(gst-plugin-scanner:14639): GLib-GObject-CRITICAL **: 19:37:14.099: g_type_set_qdata: assertion 'node != NULL' failed
0:00:00.294327023 14639 0x55627c2d7660 WARN                 default gstsfelement.c:97:gst_sf_create_audio_template_caps: format 0x120000: 'AVR (Audio Visual Research)' is not mapped
0:00:00.294357494 14639 0x55627c2d7660 WARN                 default gstsfelement.c:97:gst_sf_create_audio_template_caps: format 0x180000: 'CAF (Apple Core Audio File)' is not mapped
0:00:00.294383664 14639 0x55627c2d7660 WARN                 default gstsfelement.c:97:gst_sf_create_audio_template_caps: format 0x100000: 'HTK (HMM Tool Kit)' is not mapped
0:00:00.294408435 14639 0x55627c2d7660 WARN                 default gstsfelement.c:97:gst_sf_create_audio_template_caps: format 0xc0000: 'MAT4 (GNU Octave 2.0 / Matlab 4.2)' is not mapped
0:00:00.294435555 14639 0x55627c2d7660 WARN                 default gstsfelement.c:97:gst_sf_create_audio_template_caps: format 0xd0000: 'MAT5 (GNU Octave 2.1 / Matlab 5.0)' is not mapped
0:00:00.294462046 14639 0x55627c2d7660 WARN                 default gstsfelement.c:97:gst_sf_create_audio_template_caps: format 0x210000: 'MPC (Akai MPC 2k)' is not mapped
0:00:00.294491587 14639 0x55627c2d7660 WARN                 default gstsfelement.c:97:gst_sf_create_audio_template_caps: format 0xe0000: 'PVF (Portable Voice Format)' is not mapped
0:00:00.294524528 14639 0x55627c2d7660 WARN                 default gstsfelement.c:97:gst_sf_create_audio_template_caps: format 0x160000: 'SD2 (Sound Designer II)' is not mapped
0:00:00.294555848 14639 0x55627c2d7660 WARN                 default gstsfelement.c:97:gst_sf_create_audio_template_caps: format 0x190000: 'WVE (Psion Series 3)' is not mapped
0:00:00.386560190 14639 0x55627c2d7660 WARN                 nvcodec gstcudaloader.c:139:gst_cuda_load_library: Could not open library libcuda.so.1, libcuda.so.1: cannot open shared object file: No such file or directory
0:00:00.386583110 14639 0x55627c2d7660 WARN                 nvcodec plugin.c:73:plugin_init: Failed to load cuda library
using system MAC address <REDACTED>
Initialized server socket(s)
0:00:01.970154594 14638 0x55f37c710400 WARN              vaapiblend gstvaapiblend.c:184:gst_vaapi_blend_initialize:<vaapiblend0> VPP does not support global alpha blending
Accepted IPv4 client on socket 32
Local: 192.168.1.1
Remote: 192.168.1.223
Open connections: 1
Client identified as User-Agent: AirPlay/635.66.3
Accepted IPv4 client on socket 36
Local: 192.168.1.1
Remote: 192.168.1.223
Open connections: 2
raop_rtp_mirror starting mirroring
Begin streaming to GStreamer video pipeline
ct=8 spf=480 usingScreen=1 isMedia=1  audioFormat=0x1000000
start audio connection, format AAC-ELD 44100/2
raop_rtp starting audio
0:00:15.017521107 14638 0x7ff24807b240 WARN             vaapifilter gstvaapifilter.c:2395:gst_vaapi_filter_set_colorimetry_unlocked:<vaapifilter1> driver does not support 'bt709' input colorimetry. vpp may fail or produce unexpected results.
0:00:15.017548057 14638 0x7ff24807b240 WARN             vaapifilter gstvaapifilter.c:2405:gst_vaapi_filter_set_colorimetry_unlocked:<vaapifilter1> driver does not support 'bt709' output colorimetry. vpp may fail or produce unexpected results.
0:00:15.020202049 14638 0x7ff24807b240 WARN             xvimagepool xvimagepool.c:159:xvimage_buffer_pool_set_config:<xvimagebufferpool0> different size, stride and/or offset, update
0:00:15.021364176 14638 0x7ff24807b240 WARN             xvimagepool xvimagepool.c:159:xvimage_buffer_pool_set_config:<xvimagebufferpool1> different size, stride and/or offset, update
0:00:15.023743871 14638 0x7ff24807b240 WARN             xvimagepool xvimagepool.c:159:xvimage_buffer_pool_set_config:<xvimagebufferpool2> different size, stride and/or offset, update
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  20 (X_GetProperty)
  Resource id in failed request:  0x6000002
  Serial number of failed request:  3094
  Current serial number in output stream:  3094
fduncanh commented 2 years ago

0:00:00.035137115 14639 0x55627c2d7660 WARN vaapiblend gstvaapiblend.c:184:gst_vaapi_blend_initia Your error logs conclusively show VAAPI is your problem

just uninstall the gstreamer VAAPI plugin. (did you try uxplay -avdec which should have blocked VAAPI? you did not say).

If you then find you want/need VAAPI hardware GPU h264 video decoding, read the Troubleshooting section of README for help in trying to get VAAPI working

fduncanh commented 2 years ago

@NyaomiDEV

On Artix Linux (an Arch derivative) pacman -R gstreamer-vaapi should solve all your problems.

fduncanh commented 2 years ago

@lanierc

do export GST_DEBUG=2 before running uxplay, to see what is happening. If anything mentions vaapi, follow the advice above.

NyaomiDEV commented 2 years ago

@fduncanh I wanted to get logs on why it was crashing so I just ran it with the GST_DEBUG flag; so I could post it here.

Yes, indeed, it is VAAPI, which doesn't support bt709 in my AMD POLARIS card (sad). I will use -avdec for now, though I wonder if the logic can be surrounded in a try catch block so that UxPlay itself restarts the GStreamer pipe without the VAAPI support (it now just segfaults)

fduncanh commented 2 years ago

bt709 = 2:3:5:1 is a workaround for missing colorimetry 1:3:5:1 that Apple is using, but is missing in video4linux2 (needed by Raspberry Pi).

Maybe I should make that specific for v4l2, and not impose it on vaapi.

Try editing line 109 of renderers/video_renderer_gstreamer.c and remove the "colorimetry=bt709," from the h264caps string.

fduncanh commented 2 years ago

@NyaomiDEV

I tested with vaapi on an older AMD computer with on-board GPU. It doesn't have a problem with bt709=2:3:5:1 color but also doesn't need it to be forced (seems to end up with 1:3:5:1 which is what Apple is asking for.)

1:x:x:x is full color range, 2:x:x:x: restricts the range a bit.

are you able to test with the h264caps string edited to remove the bt709 entry (see last comment)?.

In principle I agree that I should only apply the bt709 workaround to video4linux2 (v4l2), which is the equivalent of vaapi for the Raspberry Pi , where there is some issue that internal gstreamer negotiations fail with 1:3:5:1 because v4l2 checks that color is in a finite list of recognized color schemes that included bt709.

I'll probably move the bt709 thing back to a rpi-specific uxplay option (where I initially put it) but I would like to know if the edit to remove bt709 fixes uxplay using vaapi for your graphics card.

Do you know for a fact that your AMD POLARIS graphics card doesn't support bt709 color? I see stuff about bt709 when googling for AMD POLARIS and bt709

NyaomiDEV commented 2 years ago

are you able to test with the h264caps string edited to remove the bt709 entry (see last comment)?.

It worked, indeed. Playback is fine and colors are more accurate than ever. False, refer to my post below (sorry)

Do you know for a fact that your AMD POLARIS graphics card doesn't support bt709 color?

I just assumed it from the GStreamer logs. Sadly I am not aware of any tools to check it for sure.

fduncanh commented 2 years ago

Thanks!

My mistake.... I have updated the latest github. Please test

NyaomiDEV commented 2 years ago

I am testing it right now and it indeed works as intended. Though, the brightness is too much. On the Settings screen it all feels just white, the background shade of grey just is not visible. Screenshot_20220622_151444 A normal screenshot by comparison: image

fduncanh commented 2 years ago

@NyaomiDEV

your color issue is some GStreamer issue with AMD POLARIS that I dont know about.

have you tried -vd vaapidecodebin -vs vaapisink in case these were not both automatically chosen

catielanier commented 2 years ago

I just wanted to loop back in.

I since switched to Fedora, and since there’s no repo install for this UxPlay, did a fresh install from source. It is now working as expected, not needing pass any args at all.

On Sun, Jun 26, 2022 at 3:10 PM fduncanh @.***> wrote:

@NyaomiDEV https://github.com/NyaomiDEV

your color issue is some GStreamer issue with AMD POLARIS that I dont know about.

have you tried -vd vaapidecodebin -vs vaapisink in case these were not both automatically chosen

— Reply to this email directly, view it on GitHub https://github.com/FDH2/UxPlay/issues/100#issuecomment-1166619116, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIH4NJUZ4QW755T4Y25BUVDVRCTJNANCNFSM5YBNPJSQ . You are receiving this because you were mentioned.Message ID: @.***>

fduncanh commented 2 years ago

@lanierc Thanks for feedback. It's only because of feedback that this project has progressed.

NyaomiDEV commented 2 years ago

have you tried -vd vaapidecodebin -vs vaapisink in case these were not both automatically chosen

Just tried, and the result is the same.

I tried -avdec -vs gtksink and -avdec -vs ximagesink and the colors were accurate; but -avdec -vs glimagesink or anything without -avdec did have the same brightness problems.

fduncanh commented 2 years ago

I'm guessing that vaapi might be using openGL so you get the glimagesink colors

fduncanh commented 2 years ago

nothing more to do! closing! thanks!