Skip to content

Apply Sound Mixer volumes after every pccore_reset#13

Merged
bubio merged 1 commit into
mainfrom
fix/mixer-startup-volume
Jun 10, 2026
Merged

Apply Sound Mixer volumes after every pccore_reset#13
bubio merged 1 commit into
mainfrom
fix/mixer-startup-volume

Conversation

@bubio

@bubio bubio commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

アプリ起動時に Sound Mixer(np2cfg.vol_*)の設定が実際にはサウンドチップへ反映されていなかった問題の修正です。

  • コアの pccore_reset() は全サウンドチップを電源投入時の音量へリセットします。sound_init() は基本的なチップ音量しか復元せず、FMGEN のリニア音量や cs4231 のスケーリングを設定しないため、起動時(およびリセット後)に Mixer 設定が無視されていました。
  • グルー層にラッパー usa_pccore_reset() を新設し、pccore_reset() の直後に fmboard_updatevolume() で Mixer 全体を再適用するようにしました(ライブのスライダー編集経路と同じ)。
  • 全リセット呼び出し箇所をこのラッパー経由に統一。NP2kai コア(サブモジュール)は無改変です。

変更ファイルは src/c.zigsrc/np2_glue.c の2点のみ。

Test plan

  • zig build 成功
  • サブモジュール core/np2kai が無改変(クリーン)であることを確認
  • 変更がプロジェクト側2ファイルのみに限定されていることを確認

🤖 Generated with Claude Code

The core pccore_reset() resets all sound chips to their power-on volume.
sound_init() only restores the basic chip volumes and misses the FMGEN
linear volumes and cs4231 scaling, so the np2cfg.vol_* Sound Mixer
settings were never actually applied at startup (or after any reset).

Wrap pccore_reset() in the glue layer (usa_pccore_reset) so it re-applies
the full mixer via fmboard_updatevolume() afterwards, matching the live
slider-edit path, and route all callers through it. NP2kai's core stays
unpatched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bubio bubio merged commit 7fe10c6 into main Jun 10, 2026
3 checks passed
@bubio bubio deleted the fix/mixer-startup-volume branch June 10, 2026 15:02
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 this pull request may close these issues.

1 participant