kvarenzn / phisap

[deprecated] [for android] Semi-automatic player for the rhythm game "Phigros"
179 stars 38 forks source link

[server] ERROR (only on systems above MIUI13) #52

Open luohebing opened 1 year ago

luohebing commented 1 year ago

正在统计帧...统计完毕,当前谱面共计24245帧 正在规划触控事件...规划完毕. .\scrcpy-server-v1.25: 1 file pushed, 0 skipped. 39.3 MB/s (42151 bytes in 0.001s) (184, 80) [server] ERROR: Encoding error: java.lang.IllegalArgumentException: null Exception in thread Thread-1 (collector): Traceback (most recent call last): Exception in thread Thread-2 (ctrlmsg_receiver): File "C:\Users\lenovo\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner Traceback (most recent call last): File "C:\Users\lenovo\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner self.run() File "C:\Users\lenovo\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run self.run() File "C:\Users\lenovo\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run self._target(*self._args, *self._kwargs) File "E:\phisap-main\phisap-main\control.py", line 50, in collector self._target(self._args, **self._kwargs) File "E:\phisap-main\phisap-main\control.py", line 59, in ctrlmsg_receiver _pts, size = struct.unpack('!qI', header) struct.error: unpack requires a buffer of 12 bytes size, = struct.unpack('!I', self.control_socket.recv(4)) struct.error: unpack requires a buffer of 4 bytes [server] ERROR: Exception on thread Thread[main,5,main] java.lang.IllegalArgumentException at android.media.MediaCodec.native_configure(Native Method) at android.media.MediaCodec.configure(MediaCodec.java:2214) at android.media.MediaCodec.configure(MediaCodec.java:2130) at com.genymobile.scrcpy.ScreenEncoder.configure(ScreenEncoder.java:282) at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:97) at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:74) at com.genymobile.scrcpy.Server.scrcpy(Server.java:100) at com.genymobile.scrcpy.Server.main(Server.java:334) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:387) [client] INFO: 自动打歌已结束

在MIUI12.5系统不报错,当前系统为MIUI14 参考:https://github.com/Genymobile/scrcpy/issues/3051#top

kvarenzn commented 1 year ago

MIUI啊...手边没有小米设备,而且也没有什么方法可以模拟MIUI,确实没办法,只能随缘了 而且看起来也不是phisap的问题,故障出在scrcpy-server那边

luohebing commented 1 year ago

image 似乎通过增加启动参数解决了问题: "encoder_name='OMX.google.h264.encoder'"

kvarenzn commented 1 year ago

挺好的,不过这个OMX.google.h264.encoder是软件解码吧,你在使用的过程中有没有出现卡顿的情况? 另外,如果可以的话,能否请你贴一张运行命令scrcpy --list-encodersscrcpy的版本为2.0)的输出截图?想了解一下MIUI都支持什么解码器

luohebing commented 1 year ago

有些曲子反复校准也有微妙的局部延迟,不清楚是否是软件解码的问题。

PS C:\Users\lenovo> scrcpy --list-encoders scrcpy 2.0 https://github.com/Genymobile/scrcpy E:\phisap-main\phisap-main\scrcpy-win64-v2.0\scrcpy-server... file pushed, 0 skipped. 69.0 MB/s (52867 bytes in 0.001s) [server] INFO: List of video encoders: --video-codec=h264 --video-encoder='c2.mtk.avc.encoder' --video-codec=h264 --video-encoder='OMX.MTK.VIDEO.ENCODER.AVC' --video-codec=h264 --video-encoder='c2.android.avc.encoder' --video-codec=h264 --video-encoder='OMX.google.h264.encoder' --video-codec=h265 --video-encoder='c2.mtk.hevc.encoder' --video-codec=h265 --video-encoder='OMX.MTK.VIDEO.ENCODER.HEVC' [server] INFO: List of audio encoders: --audio-codec=opus --audio-encoder='c2.android.opus.encoder' --audio-codec=aac --audio-encoder='c2.android.aac.encoder' --audio-codec=aac --audio-encoder='OMX.google.aac.encoder'

kvarenzn commented 1 year ago

多谢

有些曲子反复校准也有微妙的局部延迟,不清楚是否是软件解码的问题。

应该不是,因为硬件解码也会有类似的问题,这时候就需要在phisap运行的过程中微调偏移。应该是phigros自身的问题,毕竟unity写的东西很难保证实时性