forked from wyjoutstanding/Algorithm
-
Notifications
You must be signed in to change notification settings - Fork 0
Audio driver configuration #2
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
Draft
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
227 changes: 227 additions & 0 deletions
README-AUDIO-FIX.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,227 @@ | ||
| # Intel 8086:7a50 音频驱动配置修复指南 | ||
|
|
||
| ## 问题描述 | ||
|
|
||
| 您的Dell系统中的Intel音频控制器(设备ID: 8086:7a50)被系统识别但没有驱动加载,导致无法使用板载音频。 | ||
|
|
||
| ## 快速修复 | ||
|
|
||
| ### 方法1:自动修复脚本(推荐) | ||
|
|
||
| ```bash | ||
| # 给脚本添加执行权限 | ||
| chmod +x fix-audio-driver.sh | ||
|
|
||
| # 以root权限运行修复脚本 | ||
| sudo ./fix-audio-driver.sh | ||
|
|
||
| # 重启系统以应用更改 | ||
| sudo reboot | ||
| ``` | ||
|
|
||
| ### 方法2:手动修复 | ||
|
|
||
| 请参考 `audio-driver-diagnosis.md` 文档中的详细步骤。 | ||
|
|
||
| ## 文件说明 | ||
|
|
||
| - **fix-audio-driver.sh** - 自动诊断和修复脚本 | ||
| - **audio-driver-diagnosis.md** - 详细的问题诊断和手动修复指南 | ||
| - **README-AUDIO-FIX.md** - 本文件,快速开始指南 | ||
|
|
||
| ## 重启后验证 | ||
|
|
||
| ```bash | ||
| # 查看SOF驱动是否加载 | ||
| dmesg | grep -i sof | ||
|
|
||
| # 列出所有声卡 | ||
| aplay -l | ||
|
|
||
| # 检查音频模块 | ||
| lsmod | grep snd | ||
|
|
||
| # 测试音频输出 | ||
| speaker-test -c 2 -t wav | ||
| ``` | ||
|
|
||
| ## 预期结果 | ||
|
|
||
| 成功后,您应该看到: | ||
|
|
||
| ```bash | ||
| $ aplay -l | ||
| **** List of PLAYBACK Hardware Devices **** | ||
| card 0: sofhdadsp [sof-hda-dsp], device 0: HDA Analog (*) [] | ||
| Subdevices: 1/1 | ||
| Subdevice #0: subdevice #0 | ||
| ... | ||
| ``` | ||
|
|
||
| dmesg输出应包含: | ||
|
|
||
| ``` | ||
| sof-audio-pci-intel-tgl .&checktime(0000,00,1,':')f.3: enabling device | ||
| sof-audio-pci-intel-tgl .&checktime(0000,00,1,':')f.3: DSP detected with PCI class/subclass/prog-if info | ||
| ``` | ||
|
|
||
| ## 故障排除 | ||
|
|
||
| ### 如果音频仍然不工作 | ||
|
|
||
| 1. **检查BIOS设置** | ||
| - 重启进入BIOS | ||
| - 确保"Audio Controller"或"High Definition Audio"已启用 | ||
| - 保存并退出 | ||
|
|
||
| 2. **尝试不同的dsp_driver值** | ||
|
|
||
| 编辑 `/etc/modprobe.d/sof-audio.conf`: | ||
|
|
||
| ```bash | ||
| # 尝试值1(传统HDA) | ||
| options snd-intel-dspcfg dsp_driver=1 | ||
| ``` | ||
|
|
||
| 然后重新加载驱动或重启。 | ||
|
|
||
| 3. **检查固件完整性** | ||
|
|
||
| ```bash | ||
| ls -la /lib/firmware/intel/sof/ | ||
| ls -la /lib/firmware/intel/sof-tplg/ | ||
| ``` | ||
|
|
||
| 应该看到多个 .ri 和 .tplg 文件。 | ||
|
|
||
| 4. **启用调试模式** | ||
|
|
||
| 编辑 `/etc/modprobe.d/sof-audio.conf`,添加: | ||
|
|
||
| ```bash | ||
| options snd_sof sof_debug=1 | ||
| options snd_sof_pci sof_pci_debug=1 | ||
| ``` | ||
|
|
||
| 重新加载驱动后查看详细日志: | ||
|
|
||
| ```bash | ||
| dmesg | grep -i sof | ||
| ``` | ||
|
|
||
| 5. **更新内核** | ||
|
|
||
| 如果使用的是旧内核,考虑升级到最新版本: | ||
|
|
||
| ```bash | ||
| sudo apt update | ||
| sudo apt install linux-generic-hwe-$(lsb_release -rs) | ||
| ``` | ||
|
|
||
| ### 常见错误信息 | ||
|
|
||
| | 错误 | 原因 | 解决方法 | | ||
| |------|------|----------| | ||
| | `sof-audio-pci: probe of .&checktime(0000,00,1,':')f.3 failed` | 固件缺失或不兼容 | 安装/更新SOF固件 | | ||
| | `Direct firmware load for intel/sof/...` | 固件文件缺失 | 检查固件目录 | | ||
| | `snd_hda_intel: probe of .&checktime(0000,00,1,':')f.3 failed` | 驱动冲突 | 配置dsp_driver参数 | | ||
|
|
||
| ## 技术细节 | ||
|
|
||
| ### 硬件信息 | ||
|
|
||
| - **设备**: Intel Raptor Lake PCH音频控制器 | ||
| - **PCI ID**: 8086:7a50 | ||
| - **子系统**: Dell 1028:0bf7 | ||
| - **类型**: 多媒体音频控制器 [0401] | ||
| - **所需驱动**: snd-sof-pci, snd-hda-intel | ||
| - **所需固件**: SOF (Sound Open Firmware) v2.2+ | ||
|
|
||
| ### 驱动架构 | ||
|
|
||
| ``` | ||
| 用户空间应用 | ||
| ↓ | ||
| ALSA API | ||
| ↓ | ||
| snd-hda-intel (HDA驱动) | ||
| ↓ | ||
| snd-sof-pci (SOF驱动) | ||
| ↓ | ||
| SOF固件 (/lib/firmware/intel/sof/) | ||
| ↓ | ||
| Intel DSP硬件 | ||
| ``` | ||
|
|
||
| ## 有用的命令 | ||
|
|
||
| ```bash | ||
| # 查看PCI音频设备详细信息 | ||
| lspci -nnk -s 00:1f.3 | ||
|
|
||
| # 查看所有PCI音频设备 | ||
| lspci | grep -i audio | ||
|
|
||
| # 查看ALSA信息 | ||
| cat /proc/asound/cards | ||
| cat /proc/asound/version | ||
|
|
||
| # 查看pulseaudio状态(如果使用) | ||
| pactl info | ||
| pactl list sinks | ||
|
|
||
| # 查看pipewire状态(如果使用) | ||
| systemctl --user status pipewire | ||
| pw-cli info all | ||
|
|
||
| # 重新加载ALSA | ||
| sudo alsa force-reload | ||
|
|
||
| # 查看模块参数 | ||
| modinfo snd_sof_pci | ||
| modinfo snd_intel_dspcfg | ||
| ``` | ||
|
|
||
| ## 参考资源 | ||
|
|
||
| - [SOF项目官网](https://thesofproject.github.io/) | ||
| - [SOF固件发布](https://github.com/thesofproject/sof-bin/releases) | ||
| - [Linux内核音频文档](https://www.kernel.org/doc/html/latest/sound/) | ||
| - [Arch Linux音频故障排除](https://wiki.archlinux.org/title/Advanced_Linux_Sound_Architecture/Troubleshooting) | ||
| - [Ubuntu音频故障排除](https://help.ubuntu.com/community/SoundTroubleshooting) | ||
|
|
||
| ## 支持 | ||
|
|
||
| 如果问题仍然存在,请收集以下信息寻求帮助: | ||
|
|
||
| ```bash | ||
| # 生成诊断报告 | ||
| { | ||
| echo "=== 系统信息 ===" | ||
| uname -a | ||
| lsb_release -a 2>/dev/null || cat /etc/os-release | ||
|
|
||
| echo -e "\n=== 音频PCI设备 ===" | ||
| lspci -nnk | grep -A3 "Audio" | ||
|
|
||
| echo -e "\n=== 声卡 ===" | ||
| aplay -l | ||
|
|
||
| echo -e "\n=== 模块 ===" | ||
| lsmod | grep -E "snd|sof" | ||
|
|
||
| echo -e "\n=== dmesg音频日志 ===" | ||
| dmesg | grep -iE "sof|snd|audio|hda" | ||
|
|
||
| echo -e "\n=== 模块配置 ===" | ||
| cat /etc/modprobe.d/*audio* 2>/dev/null | ||
| cat /etc/modprobe.d/*alsa* 2>/dev/null | ||
| cat /etc/modprobe.d/*sof* 2>/dev/null | ||
| } > audio-diagnostic-report.txt | ||
|
|
||
| echo "诊断报告已保存到: audio-diagnostic-report.txt" | ||
| ``` | ||
|
|
||
| ## 许可证 | ||
|
|
||
| 本文档和脚本以MIT许可证发布,可自由使用和修改。 |
136 changes: 136 additions & 0 deletions
audio-driver-diagnosis.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| # Intel音频驱动配置诊断报告 | ||
|
|
||
| ## 硬件信息 | ||
|
|
||
| - **设备**: Intel Corporation Device [8086:7a50] | ||
| - **位置**: 00:1f.3 | ||
| - **类型**: Multimedia audio controller [0401] | ||
| - **子系统**: Dell Device [1028:0bf7] | ||
| - **版本**: rev 11 | ||
|
|
||
| ## 问题诊断 | ||
|
|
||
| 根据提供的信息,系统检测到了Intel音频控制器,但驱动未加载: | ||
|
|
||
| 1. ✅ PCI设备已被识别 | ||
| 2. ✅ 内存地址已分配(0x6203140000-0x6203143fff, 0x6203000000-0x62030fffff) | ||
| 3. ❌ 没有看到SOF(Sound Open Firmware)驱动加载 | ||
| 4. ❌ 只有NVIDIA HDMI音频在工作(card1) | ||
|
|
||
| ## 可能的原因 | ||
|
|
||
| 这是Intel第13代/第14代酷睿处理器(Raptor Lake/Alder Lake)的音频设备,需要: | ||
| - SOF固件 | ||
| - snd-sof-pci驱动 | ||
| - 正确的内核模块配置 | ||
|
|
||
| ## 解决方案 | ||
|
|
||
| ### 步骤1:检查当前驱动状态 | ||
|
|
||
| ```bash | ||
| # 检查是否加载了SOF驱动 | ||
| lsmod | grep -E "snd_sof|snd_hda" | ||
|
|
||
| # 检查可用的声卡 | ||
| aplay -l | ||
|
|
||
| # 查看内核模块黑名单 | ||
| cat /etc/modprobe.d/* | grep -E "snd|audio" | ||
| ``` | ||
|
|
||
| ### 步骤2:安装SOF固件(如果缺失) | ||
|
|
||
| ```bash | ||
| # Ubuntu/Debian | ||
| sudo apt update | ||
| sudo apt install firmware-sof-signed | ||
|
|
||
| # 或者从源获取最新固件 | ||
| wget https://github.com/thesofproject/sof-bin/releases/download/v2.2.6/sof-bin-v2.2.6.tar.gz | ||
| tar xzf sof-bin-v2.2.6.tar.gz | ||
| sudo mkdir -p /lib/firmware/intel/sof | ||
| sudo cp -r sof-bin-v2.2.6/sof-v2.2.6/* /lib/firmware/intel/sof/ | ||
| sudo cp -r sof-bin-v2.2.6/sof-tplg-v2.2.6/* /lib/firmware/intel/sof-tplg/ | ||
| ``` | ||
|
|
||
| ### 步骤3:配置内核模块 | ||
|
|
||
| 创建或修改 `/etc/modprobe.d/alsa-base.conf`: | ||
|
|
||
| ```bash | ||
| # 强制使用SOF驱动 | ||
| options snd-intel-dspcfg dsp_driver=3 | ||
|
|
||
| # 如果上面不工作,尝试 | ||
| # options snd-intel-dspcfg dsp_driver=1 | ||
| ``` | ||
|
|
||
| ### 步骤4:重新加载驱动 | ||
|
|
||
| ```bash | ||
| # 卸载相关模块 | ||
| sudo modprobe -r snd_hda_intel snd_sof_pci snd_sof | ||
|
|
||
| # 重新加载 | ||
| sudo modprobe snd_sof_pci | ||
| sudo modprobe snd_hda_intel | ||
|
|
||
| # 或者直接重启系统 | ||
| sudo reboot | ||
| ``` | ||
|
|
||
| ### 步骤5:验证 | ||
|
|
||
| 重启后检查: | ||
|
|
||
| ```bash | ||
| # 查看dmesg中的SOF信息 | ||
| dmesg | grep -i "sof\|audio" | ||
|
|
||
| # 检查声卡 | ||
| aplay -l | ||
|
|
||
| # 测试音频 | ||
| speaker-test -c 2 -t wav | ||
| ``` | ||
|
|
||
| ## 预期结果 | ||
|
|
||
| 成功后应该看到: | ||
|
|
||
| ``` | ||
| dmesg输出中应包含: | ||
| - sof-audio-pci-intel-tgl .&checktime(0000,00,1,':')f.3: enabling device | ||
| - sof-audio-pci-intel-tgl .&checktime(0000,00,1,':')f.3: DSP detected with PCI class/subclass/prog-if info | ||
| - sof-audio-pci-intel-tgl .&checktime(0000,00,1,':')f.3: bound .&checktime(0000,00,02,':').0 | ||
| ``` | ||
|
|
||
| ## 常见问题 | ||
|
|
||
| ### Q1: 安装firmware后仍然没有声音 | ||
|
|
||
| **A**: 检查BIOS设置,确保音频控制器已启用 | ||
|
|
||
| ### Q2: 需要哪个dsp_driver值? | ||
|
|
||
| **A**: | ||
| - `dsp_driver=1` - 旧版HDA驱动 | ||
| - `dsp_driver=3` - SOF驱动(推荐用于新硬件) | ||
| - `dsp_driver=4` - 禁用DSP | ||
|
|
||
| ### Q3: 内核版本要求 | ||
|
|
||
| **A**: 建议使用内核5.10+,你的内核6.1.147应该已经支持 | ||
|
|
||
| ## 附加信息 | ||
|
|
||
| - 设备ID 8086:7a50 是Intel Raptor Lake PCH的音频设备 | ||
| - Dell设备通常需要特定的拓扑文件 | ||
| - 如果问题持续,可能需要更新BIOS固件 | ||
|
|
||
| ## 参考链接 | ||
|
|
||
| - [SOF项目官网](https://thesofproject.github.io/latest/index.html) | ||
| - [SOF固件下载](https://github.com/thesofproject/sof-bin/releases) | ||
| - [Linux音频故障排除](https://wiki.archlinux.org/title/Advanced_Linux_Sound_Architecture/Troubleshooting) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.