4 Star 0 Fork 3

src-openEuler/lxpanel

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
lxpanel-0.10.1-0003-volumealsa-poll-alsa-mixer-several-times-at-startup.patch 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
丈青山 提交于 2023-01-09 18:26 . update to 0.10.1
From d682b50677dde648bf4ff0fca52b9ff8e1d25d09 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Sun, 1 Aug 2021 21:50:00 +0900
Subject: [PATCH] volumealsa: poll alsa mixer several times at startup
On Fedora 34, the default alsa mixer is replaced by pipewire-alsa.
Very often time, pipewire wakes up later than lxpanel is launched, which
makes alsa mixer not detectable at lxpanel startup.
For workaround, poll mixer several times at lxpanel startup.
---
plugins/volumealsa/volumealsa.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/plugins/volumealsa/volumealsa.c b/plugins/volumealsa/volumealsa.c
index 5c41051..bf5410b 100644
--- a/plugins/volumealsa/volumealsa.c
+++ b/plugins/volumealsa/volumealsa.c
@@ -963,10 +963,17 @@ static GtkWidget *volumealsa_constructor(LXPanel *panel, config_setting_t *setti
lxpanel_apply_hotkey(&vol->hotkey_mute, tmp_str, volume_mute, vol, FALSE);
/* Initialize ALSA. If that fails, present nothing. */
- if ( ! asound_initialize(vol))
{
- volumealsa_destructor(vol);
- return NULL;
+ int ret = 0;
+ for (int i = 0 ; i < 4 ; i++) {
+ ret = asound_initialize(vol);
+ if (ret) break;
+ usleep(750 * 1000);
+ }
+ if (!ret) {
+ volumealsa_destructor(vol);
+ return NULL;
+ }
}
/* Allocate top level widget and set into Plugin widget pointer. */
--
2.31.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/lxpanel.git
git@gitee.com:src-openeuler/lxpanel.git
src-openeuler
lxpanel
lxpanel
master

搜索帮助