Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux端帧率过低 #1293

Open
dontknowhy opened this issue Jul 29, 2024 · 10 comments · May be fixed by listen1/listen1_chrome_extension#1216
Open

Linux端帧率过低 #1293

dontknowhy opened this issue Jul 29, 2024 · 10 comments · May be fixed by listen1/listen1_chrome_extension#1216

Comments

@dontknowhy
Copy link

Listen1 干了啥

手动拆包asar可以在main.js看见:

switch (process.platform) {
  case "darwin":
    trayIconPath = join(__dirname, "/resources/logo_16.png");
    transparent = true;
    break;
  case "linux":
    trayIconPath = join(__dirname, "/resources/logo_32.png");
    // fix transparent window not working in linux bug
    app.disableHardwareAcceleration();
    break;
  case "win32":
    trayIconPath = join(__dirname, "/resources/logo_32.png");
    break;
  default:
    break;
}

其中的linux平台被这段 app.disableHardwareAcceleration();设置成不使用GPU渲染,而chromium对于这种情况会分配4核心去渲染界面,然后聪明的大小核调度器会全部丢给小核心处理。
所以美丽的linux端简约主题会滑动不跟手,现代主题个位数帧率。

我干了啥

去除掉这个可疑的限制,打包asar,然后我们就得到一个掉帧严重的 Listen1 。但是把打包好的asar放入Electron v31.2.1(Chromium v126.0.6478.127)就没有掉帧的界面(但音乐播放不正常,怀疑是播放音乐相关组件在Listen1使用的Electron 13.6.9以上会出问题。)。

目前为止有什么解决办法

当然是如有,你只需要给最开始去掉强制关闭硬件加速的野生Listen1启动时加上--ignore-gpu-blocklist --enable-zero-copy --enable-features=Vulkan的命令行选项,然后你就可以自由体验10W功耗的现代化歌词界面了(Iris Xe-LP)。

给开发者建议

优化一下这个沟槽主题,虽然我知道肯定不止说说这么简单。
缺点就是你不如出门去找浏览器扩展版,优化问题目前在我这没有什么太大的表现,就是你还是需要5W的功耗。

@kunieone
Copy link

same!UI做的很好,但是就是太卡了,有点难受

@linusliang555
Copy link

➜ listen1_desktop-2.32.0 git:(master) ✗ electron34 ./app --enable-logging
APPIMAGE env is not defined, current application is not an AppImage
checkForUpdatesAndNotify called, downloadPromise is null
[40141:0121/221714.276631:WARNING:sandbox_linux.cc(430)] InitializeSandbox() called with multiple threads in process gpu-process.
[40141:0121/221714.277384:WARNING:viz_main_impl.cc(85)] VizNullHypothesis is disabled (not a warning)
[40080:0121/221718.241365:INFO:CONSOLE(484)] "TypeError: Cannot read properties of undefined (reading 'session')

", source: file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/angular.min.js (484)
[40141:0121/221718.340992:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[40141:0121/221720.973131:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[40141:0121/221723.405472:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!
[40080:0121/221729.215069:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
Policy set or a policy with "unsafe-eval" enabled. This exposes users of
this app to unnecessary security risks.

For more information and help, consult
https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.", source: node:electron/js2c/renderer_init (2)
[40080:0121/221730.141563:INFO:CONSOLE(484)] "TypeError: Cannot read properties of undefined (reading 'session')

", source: file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/angular.min.js (484)
[40080:0121/221748.623171:INFO:CONSOLE(484)] "Error: timeout of 0ms exceeded Possibly unhandled rejection: {"message":"timeout of 0ms exceeded","name":"Error","stack":"Error: timeout of 0ms exceeded\n at e.exports (file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/axios.min.js:2:9719)\n at l.ontimeout (file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/axios.min.js:2:8646)","config":{"url":"https://music.163.com/api/nuser/account/get","method":"post","data":"params=%2B8Wo%2BHxf8Iof3ZCnPOX2YNKGTvtos%2BV4%2FVkcWlysxXA%3D&encSecKey=8fc235da747df1dbe902934ec84019e69e055fa325f59089d744f1663d2fac5b3a71fd5d0b485bc12b5f4167184e0559e558fe3568f6458ce05c6afb26cfa5472a97e8bdd76d81019e8f19fd8a8d1309b51f97c3ba45f76411c47d7d4dca4465a5503cf38834a75564170c31fa83c53233819948742b3375930494008fdd4ab2","headers":{"Accept":"application/json, text/plain, /","Content-Type":"application/x-www-form-urlencoded;charset=utf-8"},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1},"code":"ECONNABORTED"}", source: file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/angular.min.js (484)
[40080:0121/221748.623233:INFO:CONSOLE(484)] "Error: timeout of 0ms exceeded Possibly unhandled rejection: {"message":"timeout of 0ms exceeded","name":"Error","stack":"Error: timeout of 0ms exceeded\n at e.exports (file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/axios.min.js:2:9719)\n at l.ontimeout (file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/axios.min.js:2:8646)","config":{"url":"https://music.163.com/discover/playlist/?order=hot&limit=35&offset=0","method":"get","headers":{"Accept":"application/json, text/plain, /"},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1},"code":"ECONNABORTED"}", source: file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/angular.min.js (484)
[40080:0121/221748.871608:INFO:CONSOLE(484)] "Error: timeout of 0ms exceeded Possibly unhandled rejection: {"message":"timeout of 0ms exceeded","name":"Error","stack":"Error: timeout of 0ms exceeded\n at e.exports (file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/axios.min.js:2:9719)\n at l.ontimeout (file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/axios.min.js:2:8646)","config":{"url":"https://music.163.com/api/nuser/account/get","method":"post","data":"params=YxEhH%2B6QAa4ON5Sy8ARVHtbjbXzMujjgjY48nxW4G5o%3D&encSecKey=311b30e0c1f6ce855eda2acc27fdef6df75489c97f2290c53d213e68c91fd904da166cb5f81cef9a31c541fb1fe4170a878363a39b15a9bcacd36b4efe925752e8ef28b79ddff6f9fb8157eb0dafd3965a780214166dc4b79dc204d6fff18891a145b3e9538292799359576954e26a6ee7977f74625bbd9cd9c275c1a60cc6e8","headers":{"Accept":"application/json, text/plain, /","Content-Type":"application/x-www-form-urlencoded;charset=utf-8"},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1},"code":"ECONNABORTED"}", source: file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/angular.min.js (484)
[40080:0121/221800.475752:INFO:CONSOLE(484)] "Error: timeout of 0ms exceeded Possibly unhandled rejection: {"message":"timeout of 0ms exceeded","name":"Error","stack":"Error: timeout of 0ms exceeded\n at e.exports (file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/axios.min.js:2:9719)\n at l.ontimeout (file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/axios.min.js:2:8646)","config":{"url":"https://music.163.com/discover/playlist/?order=hot&limit=35&offset=0","method":"get","headers":{"Accept":"application/json, text/plain, /"},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1},"code":"ECONNABORTED"}", source: file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/angular.min.js (484)
[40080:0121/221813.654522:INFO:CONSOLE(484)] "Error: timeout of 0ms exceeded Possibly unhandled rejection: {"message":"timeout of 0ms exceeded","name":"Error","stack":"Error: timeout of 0ms exceeded\n at e.exports (file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/axios.min.js:2:9719)\n at l.ontimeout (file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/axios.min.js:2:8646)","config":{"url":"https://www.kuwo.cn/api/pc/classify/playlist/getRcmPlayList?pn=1&rn=25&order=hot&httpsStatus=1","method":"get","headers":{"Accept":"application/json, text/plain, /"},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1},"code":"ECONNABORTED"}", source: file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/angular.min.js (484)
[40080:0121/221814.491278:INFO:CONSOLE(484)] "Error: timeout of 0ms exceeded Possibly unhandled rejection: {"message":"timeout of 0ms exceeded","name":"Error","stack":"Error: timeout of 0ms exceeded\n at e.exports (file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/axios.min.js:2:9719)\n at l.ontimeout (file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/axios.min.js:2:8646)","config":{"url":"https://www.bilibili.com/audio/music-service-c/web/menu/hit?ps=20&pn=1","method":"get","headers":{"Accept":"application/json, text/plain, /"},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1},"code":"ECONNABORTED"}", source: file:///home/liang/listen1-desktop/src/listen1_desktop-2.32.0/app/listen1_chrome_extension/js/vendor/angular.min.js (484)
在electron34下是因为app/listen1_chrome_extension/js/vendor/axios.min.js导致的音频无法播放和搜索

@mikelxk
Copy link
Collaborator

mikelxk commented Mar 2, 2025

你能试试 listen1/listen1_chrome_extension#1216 后还很卡吗
我试着build了下linux

@dontknowhy
Copy link
Author

你能试试 listen1/listen1_chrome_extension#1216 后还很卡吗

现在在你提交pull request下的单独浏览器插件版,占用貌似正常了许多(压力最大的歌词界面帧数可以跑满,且功耗大约在2W~3W左右(相比之下以前需要5W以上的功耗)(抱歉我这样对比流畅度,因为两个版本其实都可以在新chromium套壳的Edge跑满90帧(也许是,未知有没有限制帧数)
现在的问题是:什么时候把Linux下那个莫名其妙的硬件加速判定删了(

@mikelxk
Copy link
Collaborator

mikelxk commented Mar 2, 2025

你试试https://github.com/listen1/listen1_desktop/releases/tag/perf-test
已经删了,这行本来就是我加的,好像很久之前 要是不关硬件加速 linux 透明窗口会有问题

@dontknowhy
Copy link
Author

你试试https://github.com/listen1/listen1_desktop/releases/tag/perf-test
已经删了

功耗:7W
GPU占用:70%
帧数:哎这倒是满的(用GALLIUM_HUD调出mesa内置的hud查看的)

@mikelxk
Copy link
Collaborator

mikelxk commented Mar 2, 2025

你试试https://github.com/listen1/listen1_desktop/releases/tag/perf-test
已经删了

功耗:7W
GPU占用:70%
帧数:哎这倒是满的(用GALLIUM_HUD调出mesa内置的hud查看的)

那应该没啥大问题了,electron是32,然后我优化了一下scroll的逻辑, 反正不卡就行

@dontknowhy
Copy link
Author

你试试https://github.com/listen1/listen1_desktop/releases/tag/perf-test
已经删了

功耗:7W
GPU占用:70%
帧数:哎这倒是满的(用GALLIUM_HUD调出mesa内置的hud查看的)

那应该没啥大问题了,electron是32,然后我优化了一下scroll的逻辑, 反正不卡就行

?你不管这差距这么大的占用吗
以及electron在linux上好像是没有透明窗口一说的?(我猜的,QQ这种什么b玩意都塞的都不做那大抵是没有了)

@mikelxk
Copy link
Collaborator

mikelxk commented Mar 2, 2025

https://github.com/listen1/listen1_desktop/releases/tag/perf-test
那你再试试有no-scroll的release
electron based应用这个功耗很正常,你的显卡和配置是什么?

@dontknowhy
Copy link
Author

dontknowhy commented Mar 7, 2025

https://github.com/listen1/listen1_desktop/releases/tag/perf-test 那你再试试有no-scroll的release electron based应用这个功耗很正常,你的显卡和配置是什么?

erm...
一样功耗
GPU:Intel Core i5 12500H的Iris Xe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants