AkiChase / scrcpy-mask

A Scrcpy client in Rust & Tarui aimed at providing mouse and key mapping to control Android device, similar to a game emulator
Apache License 2.0
649 stars 44 forks source link

[BUG] front-command forwarding failure, please restart the program ! #70

Open TTsdzb opened 3 months ago

TTsdzb commented 3 months ago

Describe the bug 可以连接设备,但执行任意操作自动断开。

To Reproduce Steps to reproduce the behavior:

  1. 启动程序
  2. 进入设备页控制设备,此时设备进入“受控设备”栏,日志提示连接成功
  3. 回到首页,任意滑动一下,此时设备没反应,日志弹出 front-command forwarding failure, please restart the program !
  4. 回到设备页,提示“受控设备已断开”

Expected behavior 设备能正常操作,不断开连接。

Environment (please complete the following information):

Additional context

使用 deb 包 通过 PKGBUILD 打包安装,添加了 webkit2gtk-4.1scrcpy(貌似其实并不需要)两个依赖。见 scrcpy-mask-bin。AppImage 无法启动,在弹出一个透明窗口后崩溃。

设备为一台小米平板 6 Pro,MIUI 14.0.9,Android 13 以及一台红米 Note 8 Pro,MIUI 12.5.6,Android 11。两台设备问题与日志完全相同,且普通 scrcpy 能正常使用。

$ export RUST_BACKTRACE=full
$ scrcpy-mask
/usr/lib/scrcpy-mask/resource/scrcpy-mask-server-v2.4: 1 file pushed, 0 skipped. 133.0 MB/s (69359 bytes in 0.000s)

Successfully push server files
Successfully forward port
Starting scrcpy server...
[server] INFO: Device: [Xiaomi] Xiaomi 23046RP50C (Android 13)
device reply channel created
connect to scrcpy-server:Ok(127.0.0.1:40302)
thread 'tokio-runtime-worker' panicked at /home/runner/work/scrcpy-mask/scrcpy-mask/src-tauri/src/scrcpy_mask_cmd.rs:78:50:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x57b5b94ff5a2 - <unknown>
   1:     0x57b5b952b54c - <unknown>
   2:     0x57b5b94fbb6f - <unknown>
   3:     0x57b5b94ff374 - <unknown>
   4:     0x57b5b9500b1b - <unknown>
   5:     0x57b5b9500873 - <unknown>
   6:     0x57b5b9500fbd - <unknown>
   7:     0x57b5b9500e59 - <unknown>
   8:     0x57b5b94ffa76 - <unknown>
   9:     0x57b5b9500bc4 - <unknown>
  10:     0x57b5b8bf2a85 - <unknown>
  11:     0x57b5b8bf2b43 - <unknown>
  12:     0x57b5b8bf2a26 - <unknown>
  13:     0x57b5b8c522c1 - <unknown>
  14:     0x57b5b8c9bb77 - <unknown>
  15:     0x57b5b8c19b0a - <unknown>
  16:     0x57b5b94bfa4b - <unknown>
  17:     0x57b5b94beaea - <unknown>
  18:     0x57b5b94c52f0 - <unknown>
  19:     0x57b5b94be3f8 - <unknown>
  20:     0x57b5b94ce19a - <unknown>
  21:     0x57b5b94b144d - <unknown>
  22:     0x57b5b94b6ec7 - <unknown>
  23:     0x57b5b94cce60 - <unknown>
  24:     0x57b5b95057c5 - <unknown>
  25:     0x71c02b9b439d - <unknown>
  26:     0x71c02ba3949c - <unknown>
  27:                0x0 - <unknown>
Failed to read from scrcpy server, maybe it was closed. Error:unexpected end of file
Drop TcpStream reader
device reply channel closed
[server] DEBUG: Controller stopped
front-command forwarding failure, please restart the program !
[server] DEBUG: Device message sender stopped
front-command forwarding failure, please restart the program !
front-command forwarding failure, please restart the program !
Scrcpy server closed
front-command forwarding failure, please restart the program !
front-command forwarding failure, please restart the program !
front-command forwarding failure, please restart the program !
front-command forwarding failure, please restart the program !
front-command forwarding failure, please restart the program !
front-command forwarding failure, please restart the program !
front-command forwarding failure, please restart the program !
front-command forwarding failure, please restart the program !
TTsdzb commented 3 months ago

如果启用了 ScreenStream 则不会出现这个问题。而且只要显示过画面,就算稍后再关闭投屏,也能正常使用。