[Seek Help] pygame下mixer.init()错误
Tofloor
poster avatar
jie_yi_ehw
deepin
2024-12-02 16:54
Author

一台hp zbook 15v G5笔记本,升级到了deepin社区版20.9,内核版本是5.15.77-amd-desktop;

声音输出设备有两个:

(1)HDMI/DisplayPort(HDA NVidia) -- > GP107GL High Definition Audio Controller

(2)Speakers(HDA Intel PCH) --> Cannon Lake PCH cAVS

平时输出设备用的是(2),可外放,可耳机、音箱,看视频,听音乐都正常。

问题:

在用pygame时想初始化mixer,总是报错:

$import pygame
/usr/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: Your system is avx2 capable but pygame was not built with support for it. The performance of some of your blits could be adversely affected. Consider enabling compile time detection with environment variables like PYGAME_DETECT_AVX2=1 if you are compiling without cross compilation.
return f(*args, **kwds)
pygame 2.6.1 (SDL 2.0.14, Python 3.7.3)
Hello from the pygame community. https://www.pygame.org/contribute.html
$pygame.init()
(4, 1)
$pygame.mixer.init()
Traceback (most recent call last):
File "", line 1, in
pygame.error: No such audio device

同样版本的pygame在别人的安装了deepin 20的笔记本thinkpad x250上安装完后初始化就没有问题(20.几没注意看),安装过程应该没问题,pygame应该没问题,应该是我使用不当、配置不当的问题

请教,是我升级的版本不合适?还是我声卡驱动不合适?

$ cat /proc/asound/cards
0 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0x4023108000 irq 171
1 [NVidia ]: HDA-Intel - HDA NVidia
HDA NVidia at 0x91000000 irq 17

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC295 Analog [ALC295 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0

Reply Favorite View the author
All Replies

No replies yet