Skip to content

feat(audio1): add AI noise reduction support#1172

Open
MyLeeJiEun wants to merge 1 commit into
linuxdeepin:masterfrom
MyLeeJiEun:fork-from-master-0702-feature-ai-noise
Open

feat(audio1): add AI noise reduction support#1172
MyLeeJiEun wants to merge 1 commit into
linuxdeepin:masterfrom
MyLeeJiEun:fork-from-master-0702-feature-ai-noise

Conversation

@MyLeeJiEun

Copy link
Copy Markdown
Contributor
  1. Added AiReduceNoise and AiNoiseSourcePath D-Bus properties for toggling AI noise reduction
  2. Implemented writeAiReduceNoise callback and DConfig persistence for AI noise reduction state
  3. Added rnnoise virtual source handling: skip port check, prevent auto-switch when active
  4. Added GetDefaultInputPortAnyCard() helper for AI noise recovery across cards
  5. Registered CheckPort method for Meter and SinkInput in D-Bus export
  6. Added aiReduceNoiseEnabled DConfig key for global AI noise reduction setting

Log: Add AI noise reduction feature with D-Bus properties, DConfig persistence, and rnnoise virtual source handling

feat(audio1): 添加 AI 降噪功能支持

  1. 添加 AiReduceNoise 和 AiNoiseSourcePath D-Bus 属性用于开关 AI 降噪
  2. 实现 writeAiReduceNoise 回调及 DConfig 持久化 AI 降噪状态
  3. 添加 rnnoise 虚拟声源处理:跳过端口检查,开启时阻止自动切换
  4. 添加 GetDefaultInputPortAnyCard() 辅助方法用于跨声卡恢复 AI 降噪
  5. 为 Meter 和 SinkInput 注册 CheckPort 方法到 D-Bus 导出
  6. 添加 aiReduceNoiseEnabled DConfig 键用于全局 AI 降噪设置

Log: 新增 AI 降噪功能,包含 D-Bus 属性、DConfig 持久化及 rnnoise 虚拟声源处理
PMS: STORY-41229

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @MyLeeJiEun, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: MyLeeJiEun

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot

Copy link
Copy Markdown

Hi @MyLeeJiEun. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@MyLeeJiEun
MyLeeJiEun force-pushed the fork-from-master-0702-feature-ai-noise branch from 23f2239 to c5f2cf6 Compare July 9, 2026 08:30
@deepin-bot

deepin-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 6.1.100
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1173

@MyLeeJiEun
MyLeeJiEun force-pushed the fork-from-master-0702-feature-ai-noise branch 4 times, most recently from 9b30c86 to f4a466d Compare July 10, 2026 10:07
@MyLeeJiEun

Copy link
Copy Markdown
Contributor Author

/retest

@deepin-ci-robot

Copy link
Copy Markdown

@MyLeeJiEun: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@MyLeeJiEun

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@deepin-ci-robot

Copy link
Copy Markdown

@MyLeeJiEun: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/ok-to-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@MyLeeJiEun
MyLeeJiEun force-pushed the fork-from-master-0702-feature-ai-noise branch from f4a466d to 36f2747 Compare July 15, 2026 03:21
1. Add AiReduceNoise and AiNoiseSourcePath D-Bus properties for control center
2. Re-apply rnnoise when switching input device with AI noise enabled
3. Add write callback for AiReduceNoise to handle external property changes
4. Re-check AI noise state on PulseAudio context ready
5. Skip port check for virtual sources (rnnoise)
6. Add aiReduceNoiseEnabled DConfig entry

Log: Add AI noise reduction feature with D-Bus properties, source switching, and DConfig support

feat(audio1): 新增 AI 降噪功能

1. 新增 AiReduceNoise 和 AiNoiseSourcePath D-Bus 属性,供控制中心使用
2. AI 降噪开启时切换输入设备后重新应用 rnnoise
3. 添加 AiReduceNoise 写回调,处理外部属性变更
4. PulseAudio 上下文就绪时重新检查 AI 降噪状态
5. 虚拟声源(rnnoise)跳过端口检查
6. 添加 aiReduceNoiseEnabled DConfig 配置项

Log: 新增 AI 降噪功能,包括 D-Bus 属性、源切换处理和 DConfig 配置
PMS: STORY-41229
@MyLeeJiEun
MyLeeJiEun force-pushed the fork-from-master-0702-feature-ai-noise branch from 36f2747 to bbb4391 Compare July 16, 2026 11:55
Comment thread audio1/audio.go
}
}
}
if strings.Contains(device, "rnnoise") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加一个注释,为什么要使用这个方式去处理

Comment thread audio1/audio.go
return false
}

func (a *Audio) paDefaultSourceIs(target string) bool {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加一下注释,开启ai降噪的时候需要通过这种方式去获取当前的输入源

Comment thread audio1/audio.go

logger.Infof("initAiReduceNoise: DConfig=%v, rnnoiseFound=%v, calling setAiReduceNoise(true)",
aiReduceNoiseEnabled, rnnoiseFound)
if err := a.setAiReduceNoise(true, ""); err != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释一下,传入空的时候使用默认的输入源作为开启降噪后的源

Comment thread audio1/audio.go
}

s.setMute(GetConfigKeeper().Mute.MuteInput || !portConfig.Enabled)
s.setReduceNoise(a.ReduceNoise)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是旧的降噪,是否需要移除了,还有下面的降噪的设置,放在这里更合适一点。

Comment thread audio1/audio.go
}
// 如果 AI 降噪已开启,在切换输入设备后重新应用 rnnoise,
// 确保新选中的物理麦克风作为 rnnoise 的 master 源。
a.PropsMu.RLock()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要在这里做降噪,前面的物理通道会触发事件,但是可能还没得到响应,这是设置降噪,会扰乱事件的处理。在更新默认source的地方处理。

@deepin-bot

deepin-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 6.1.101
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants