Bug 488961 - Unable to connect or use from Android client aFreeRDP
Summary: Unable to connect or use from Android client aFreeRDP
Status: RESOLVED FIXED
Alias: None
Product: KRdp
Classification: Plasma
Component: general (show other bugs)
Version: 6.1.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-22 09:32 UTC by ttsdzb
Modified: 2025-01-03 14:17 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.2.5
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ttsdzb 2024-06-22 09:32:59 UTC
SUMMARY
I'm using KRdp on Arch Linux, however it does not work properly and I have no idea about its logs. Only got a black screen on [aFreeRDP](https://f-droid.org/en/packages/com.freerdp.afreerdp/), or immediately disconnect with [another RDP client](https://play.google.com/store/apps/details?id=com.devolutions.remotedesktopmanager).

STEPS TO REPRODUCE
1. Install package `krdp` via pacman.
2. Run `krdpserver -u test -p test` in the terminal, and press "Share" in the prompt.
3. Observe the output. The program will periodically output errors.
4. Connect the RDP server with aFreeRDP.

OBSERVED RESULT
Client got a blacks screen with nothing can be controlled, or disconnect immediately.

EXPECTED RESULT
The screen appears on the client and can be controlled.

SOFTWARE/OS VERSIONS
Linux: Arch Linux
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION
When the client starts the connection, a same prompt as when the program starts pops out and immediately disappears.

Here's a complete log with steps described above:
```
org.kde.krdp: Initializing Freedesktop Portal Session
org.kde.krdp: Listening for connections on QHostAddress("0.0.0.0") 3389
org.kde.krdp: Started Freedesktop Portal session
kpipewire_vaapi_logging: VAAPI: Failed to initialize display
kpipewire_vaapi_logging: VAAPI: Failed to initialize display
kpipewire_vaapi_logging: DRM device not found
org.kde.krdp: Closing Freedesktop Portal Session
org.kde.krdp: Initializing Freedesktop Portal Session
org.kde.krdp: Session setup completed, start processing...
[16:53:50:238] [36378:36418] [ERROR][com.freerdp.core.transport] - BIO_read returned a system error 0: 成功
[16:53:50:239] [36378:36418] [ERROR][com.freerdp.core] - transport_read_layer:freerdp_set_last_error_ex ERRCONNECT_CONNECT_TRANSPORT_FAILED [0x0002000D]
org.kde.krdp: Unable to check file descriptor
org.kde.krdp: Closing session
org.kde.krdp: Closing Freedesktop Portal Session
org.kde.krdp: Initializing Freedesktop Portal Session
org.kde.krdp: Session setup completed, start processing...
[16:54:00:238] [36378:36431] [ERROR][com.freerdp.core.transport] - BIO_read returned a system error 0: 成功
[16:54:00:238] [36378:36431] [ERROR][com.freerdp.core] - transport_read_layer:freerdp_set_last_error_ex ERRCONNECT_CONNECT_TRANSPORT_FAILED [0x0002000D]
org.kde.krdp: Unable to check file descriptor
org.kde.krdp: Closing session
org.kde.krdp: Closing Freedesktop Portal Session
org.kde.krdp: Initializing Freedesktop Portal Session
org.kde.krdp: Session setup completed, start processing...
[16:54:10:239] [36378:36434] [ERROR][com.freerdp.core.transport] - BIO_read returned a system error 0: 成功
[16:54:10:239] [36378:36434] [ERROR][com.freerdp.core] - transport_read_layer:freerdp_set_last_error_ex ERRCONNECT_CONNECT_TRANSPORT_FAILED [0x0002000D]
org.kde.krdp: Unable to check file descriptor
org.kde.krdp: Closing session
org.kde.krdp: Closing Freedesktop Portal Session
org.kde.krdp: Initializing Freedesktop Portal Session
org.kde.krdp: Session setup completed, start processing...
[16:54:20:240] [36378:36437] [ERROR][com.freerdp.core.transport] - BIO_read returned a system error 0: 成功
[16:54:20:240] [36378:36437] [ERROR][com.freerdp.core] - transport_read_layer:freerdp_set_last_error_ex ERRCONNECT_CONNECT_TRANSPORT_FAILED [0x0002000D]
org.kde.krdp: Unable to check file descriptor
org.kde.krdp: Closing session
org.kde.krdp: Closing Freedesktop Portal Session
org.kde.krdp: Initializing Freedesktop Portal Session
org.kde.krdp: Session setup completed, start processing...
[16:54:22:033] [36378:36440] [INFO][com.freerdp.core.connection] - Client Security: NLA:1 TLS:1 RDP:0
[16:54:22:033] [36378:36440] [INFO][com.freerdp.core.connection] - Server Security: NLA:1 TLS:0 RDP:0
[16:54:22:033] [36378:36440] [INFO][com.freerdp.core.connection] - Negotiated Security: NLA:1 TLS:0 RDP:0
[16:54:22:039] [36378:36440] [WARN][com.winpr.negotiate] - AcceptSecurityContext status SEC_I_CONTINUE_NEEDED [0x00090312]
[16:54:22:041] [36378:36440] [WARN][com.winpr.negotiate] - AcceptSecurityContext status SEC_I_COMPLETE_NEEDED [0x00090313]
[16:54:22:045] [36378:36440] [INFO][com.freerdp.core.connection] - Accepted client: aFreeRDP-1694a1
[16:54:22:045] [36378:36440] [INFO][com.freerdp.core.connection] - Accepted channels:
[16:54:22:045] [36378:36440] [INFO][com.freerdp.core.connection] -  rdpdr
[16:54:22:045] [36378:36440] [INFO][com.freerdp.core.connection] -  rdpsnd
[16:54:22:045] [36378:36440] [INFO][com.freerdp.core.connection] -  cliprdr
[16:54:22:045] [36378:36440] [INFO][com.freerdp.core.connection] -  drdynvc
[16:54:22:045] [36378:36440] [INFO][com.freerdp.core.gcc] - Active rdp encryption level: NONE
[16:54:22:045] [36378:36440] [INFO][com.freerdp.core.gcc] - Selected rdp encryption method: NONE
org.kde.krdp: Correcting invalid color depth from client: 16
org.kde.krdp: New client connected:  Unspecified platform Unspecified version
org.kde.krdp: Video stream initialized
org.kde.krdp: Received caps:
org.kde.krdp:   RDPGFX_CAPVERSION_8 AVC: false YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_81 AVC: false YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_10 AVC: true YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_101 AVC: true YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_102 AVC: true YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_103 AVC: true YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_104 AVC: true YUV420: true
org.kde.krdp:   RDPGFX_CAPVERSION_105 AVC: true YUV420: true
org.kde.krdp:   RDPGFX_CAPVERSION_106 AVC: true YUV420: true
org.kde.krdp:   UNKNOWN_VERSION AVC: false YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_107 AVC: true YUV420: true
org.kde.krdp: Selected caps: RDPGFX_CAPVERSION_107
[16:54:22:148] [36378:36440] [ERROR][com.freerdp.core.peer] - peer_recv_callback: CONNECTION_STATE_ACTIVE - peer_recv_pdu() fail
[16:54:22:148] [36378:36440] [ERROR][com.freerdp.core.transport] - transport_check_fds: transport->ReceiveCallback() - -1
org.kde.krdp: Unable to check file descriptor
org.kde.krdp: Closing session
org.kde.krdp: Closing Freedesktop Portal Session
org.kde.krdp: Initializing Freedesktop Portal Session
org.kde.krdp: Session setup completed, start processing...
[16:54:30:242] [36378:36466] [ERROR][com.freerdp.core.transport] - BIO_read returned a system error 0: 成功
[16:54:30:242] [36378:36466] [ERROR][com.freerdp.core] - transport_read_layer:freerdp_set_last_error_ex ERRCONNECT_CONNECT_TRANSPORT_FAILED [0x0002000D]
org.kde.krdp: Unable to check file descriptor
org.kde.krdp: Closing session
org.kde.krdp: Closing Freedesktop Portal Session
^C
```
Comment 1 Akseli Lahtinen 2024-06-24 06:50:46 UTC
Can confirm. Seems there are some issues connecting from Android clients in general.

Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.80
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.1
Kernel Version: 6.9.5-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: AMD Radeon RX 6600


libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib64/dri-nonfree/radeonsi_drv_video.so
libva info: Trying to open /usr/lib64/dri-freeworld/radeonsi_drv_video.so
libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
kpipewire_vaapi_logging: VAAPI: Mesa Gallium driver 24.1.2 for AMD Radeon RX 6600 (radeonsi, navi23, LLVM 18.1.6, DRM 3.57, 6.9.5-200.fc40.x86_64) in use for device "/dev/dri/renderD128"
kpipewire_vaapi_logging: DRM device not found
[09:49:40:953] [10855:11029] [INFO][com.freerdp.core.connection] - Client Security: NLA:1 TLS:1 RDP:0
[09:49:40:953] [10855:11029] [INFO][com.freerdp.core.connection] - Server Security: NLA:1 TLS:0 RDP:0
[09:49:40:953] [10855:11029] [INFO][com.freerdp.core.connection] - Negotiated Security: NLA:1 TLS:0 RDP:0
[09:49:40:982] [10855:11029] [WARN][com.winpr.negotiate] - AcceptSecurityContext status SEC_I_CONTINUE_NEEDED [0x00090312]
[09:49:40:994] [10855:11029] [WARN][com.winpr.negotiate] - AcceptSecurityContext status SEC_I_COMPLETE_NEEDED [0x00090313]
[09:49:40:006] [10855:11029] [INFO][com.freerdp.core.connection] - Accepted client: aFreeRDP-a9c2c1
[09:49:40:006] [10855:11029] [INFO][com.freerdp.core.connection] - Accepted channels:
[09:49:40:006] [10855:11029] [INFO][com.freerdp.core.connection] -  rdpdr
[09:49:40:006] [10855:11029] [INFO][com.freerdp.core.connection] -  rdpsnd
[09:49:40:006] [10855:11029] [INFO][com.freerdp.core.connection] -  cliprdr
[09:49:40:006] [10855:11029] [INFO][com.freerdp.core.connection] -  drdynvc
[09:49:40:006] [10855:11029] [INFO][com.freerdp.core.gcc] - Active rdp encryption level: NONE
[09:49:40:006] [10855:11029] [INFO][com.freerdp.core.gcc] - Selected rdp encryption method: NONE
org.kde.krdp: New client connected:  Unspecified platform Unspecified version
kpipewire_record_logging: Hardware encoding is not supported on this device.
[libx264 @ 0x7fad40a21e80] -qscale is ignored, -crf is recommended.
[libx264 @ 0x7fad40a21e80] MB rate (19350000) > level limit (16711680)
[libx264 @ 0x7fad40a21e80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fad40a21e80] profile Constrained Baseline, level 6.2, 4:2:0, 8-bit
kpipewire_dmabuf_logging: eglChooseConfig returned this many configs: 1
[09:49:40:238] [10855:11029] [ERROR][com.freerdp.core.peer] - peer_recv_callback: CONNECTION_STATE_ACTIVE - peer_recv_pdu() fail
[09:49:40:238] [10855:11029] [ERROR][com.freerdp.core.transport] - transport_check_fds: transport->ReceiveCallback() - -1
[libx264 @ 0x7fad40a21e80] frame I:1     Avg QP:20.00  size:452478
[libx264 @ 0x7fad40a21e80] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x7fad40a21e80] coded y,uvDC,uvAC intra: 19.7% 18.0% 17.3%
[libx264 @ 0x7fad40a21e80] i16 v,h,dc,p: 67% 23% 10%  1%
[libx264 @ 0x7fad40a21e80] i8c dc,h,v,p: 83% 10%  7%  0%
[libx264 @ 0x7fad40a21e80] kb/s:3619823.75
*** pw_stream_destroy called from wrong context, check thread and locking: Not in loop
*** impl_ext_end_proxy called from wrong context, check thread and locking: Not in loop
'pthread_equal(impl->thread, thread_id)' failed at ../spa/plugins/support/loop.c:363 loop_leave()
Comment 2 Arjen Hiemstra 2024-07-10 09:37:02 UTC
Would it be possible to get the client side logs? Most of the time this happens because the client doesn't support H264 decoding and we don't support anything else. However, the logs here suggest that it does support that, but then something else fails. The client might have some more details on what goes wrong.
Comment 3 ttsdzb 2024-07-11 12:33:04 UTC
> Would it be possible to get the client side logs?

There's not much documents about aFreeRDP in the project repository... For now I haven't got anything useful. It doesn't save log files, nor have an interface to view outputs.
Comment 4 Matteo Mazzarelli 2024-07-19 17:19:08 UTC
I also experience this. I am not currently aware of an Android app which is compatible with KRDP, so I would appreciate any pointers towards one if I'm missing something. I have toyed with aFreeRDP's settings and I get a slightly different logging output (set colors to 32bit and resolution to 1920x1080), which could possibly be useful:

 krdpserver -u user -p test
org.kde.krdp: Initializing Freedesktop Portal Session
org.kde.krdp: Listening for connections on QHostAddress(QHostAddress::Any) 3389
org.kde.krdp: Started Freedesktop Portal session
kpipewire_vaapi_logging: VAAPI: Failed to initialize display
kpipewire_vaapi_logging: DRM device not found
org.kde.krdp: Closing Freedesktop Portal Session
org.kde.krdp: Initializing Freedesktop Portal Session
org.kde.krdp: Session setup completed, start processing...
[19:17:03:381] [3314:3353] [INFO][com.freerdp.core.connection] - Client Security: NLA:1 TLS:1 RDP:0
[19:17:03:381] [3314:3353] [INFO][com.freerdp.core.connection] - Server Security: NLA:1 TLS:0 RDP:0
[19:17:03:381] [3314:3353] [INFO][com.freerdp.core.connection] - Negotiated Security: NLA:1 TLS:0 RDP:0
[19:17:03:404] [3314:3353] [WARN][com.winpr.negotiate] - AcceptSecurityContext status SEC_I_CONTINUE_NEEDED [0x00090312]
[19:17:03:410] [3314:3353] [WARN][com.winpr.negotiate] - AcceptSecurityContext status SEC_I_COMPLETE_NEEDED [0x00090313]
[19:17:03:416] [3314:3353] [INFO][com.freerdp.core.connection] - Accepted client: aFreeRDP-b44b9f
[19:17:03:416] [3314:3353] [INFO][com.freerdp.core.connection] - Accepted channels:
[19:17:03:416] [3314:3353] [INFO][com.freerdp.core.connection] -  rdpdr
[19:17:03:416] [3314:3353] [INFO][com.freerdp.core.connection] -  rdpsnd
[19:17:03:416] [3314:3353] [INFO][com.freerdp.core.connection] -  cliprdr
[19:17:03:416] [3314:3353] [INFO][com.freerdp.core.connection] -  drdynvc
[19:17:03:416] [3314:3353] [INFO][com.freerdp.core.gcc] - Active rdp encryption level: NONE
[19:17:03:416] [3314:3353] [INFO][com.freerdp.core.gcc] - Selected rdp encryption method: NONE
org.kde.krdp: Started Freedesktop Portal session
org.kde.krdp: New client connected:  Unspecified platform Unspecified version
org.kde.krdp: Video stream initialized
kpipewire_record_logging: Hardware encoding is not supported on this device.
[libx264 @ 0x7129ec366e00] -qscale is ignored, -crf is recommended.
[libx264 @ 0x7129ec366e00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7129ec366e00] profile Constrained Baseline, level 6.1, 4:2:0, 8-bit
kpipewire_dmabuf_logging: eglChooseConfig returned this many configs: 1
org.kde.krdp: Received caps:
org.kde.krdp:   RDPGFX_CAPVERSION_8 AVC: false YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_81 AVC: false YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_10 AVC: true YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_101 AVC: true YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_102 AVC: true YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_103 AVC: true YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_104 AVC: true YUV420: true
org.kde.krdp:   RDPGFX_CAPVERSION_105 AVC: true YUV420: true
org.kde.krdp:   RDPGFX_CAPVERSION_106 AVC: true YUV420: true
org.kde.krdp:   UNKNOWN_VERSION AVC: false YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_107 AVC: true YUV420: true
org.kde.krdp: Selected caps: RDPGFX_CAPVERSION_107
[19:17:04:542] [3314:3353] [ERROR][com.freerdp.core.peer] - peer_recv_callback: CONNECTION_STATE_ACTIVE - peer_recv_pdu() fail
[19:17:04:542] [3314:3353] [ERROR][com.freerdp.core.transport] - transport_check_fds: transport->ReceiveCallback() - -1
org.kde.krdp: Unable to check file descriptor
org.kde.krdp: Closing session
[libx264 @ 0x7129ec366e00] frame I:1     Avg QP:20,00  size:439925
[libx264 @ 0x7129ec366e00] mb I  I16..4: 100,0%  0,0%  0,0%
[libx264 @ 0x7129ec366e00] coded y,uvDC,uvAC intra: 44,5% 42,6% 41,8%
[libx264 @ 0x7129ec366e00] i16 v,h,dc,p: 62% 28%  8%  2%
[libx264 @ 0x7129ec366e00] i8c dc,h,v,p: 68% 14% 17%  1%
[libx264 @ 0x7129ec366e00] kb/s:3519399,75
org.kde.krdp: Closing Freedesktop Portal Session

I have changed settings in the app to allow for more logging info but I am confused as to where it is printed, because no additional info is sent to KRDP server-side by setting the logging level to debug in aFreeRDP.
Comment 5 ttsdzb 2025-01-03 06:33:59 UTC
Updating to 6.2.5 resolves this for me. I wonder how others going on?
Comment 6 Matteo Mazzarelli 2025-01-03 14:06:59 UTC
(In reply to ttsdzb from comment #5)
> Updating to 6.2.5 resolves this for me. I wonder how others going on?

I can confirm that aFreeRDP can now correctly connect and show the screen. The pointer is still not shown but moving the pointer around and clicking works, although I am not sure whether this depends on KRDP or the Android application.