0

我正在尝试使目标的声卡能够通过 ALSA 工作,它是 Qualcomm MSM8660 Snapdragon,这意味着没有 pci 设备并运行一种嵌入式 linux。

因为这个设备最初是一款商业安卓手机,所以我确信它的内核上有适当的内置音频驱动程序,但 ALSA 根本不识别声卡。

我相信这是因为我没有编写任何 alsa 配置文件,例如 /etc/asound.conf 和 /usr/share/alsa/alsa.conf (我尝试了其构建源附带的默认 alsa.conf 但没有运气)

它用以下命令说的是:

/dev # ls pcm*
pcmC0D0c  pcmC0D0p  pcmC0D1c  pcmC0D1p


/dev # cat /proc/asound/cards
 0 [msmaudio       ]:  - msm-audio
                      msm-audio


/dev # cat /proc/asound/devices 
  0: [ 0]   : control
 16: [ 0- 0]: digital audio playback
 17: [ 0- 1]: digital audio playback
 24: [ 0- 0]: digital audio capture
 25: [ 0- 1]: digital audio capture
 33:        : timer


/dev # cat /proc/asound/pcm
00-00: DSP 1 msm-codec-dai-0 :  : playback 2 : capture 1
00-01: MVS mvs-codec-dai-1 :  : playback 1 : capture 1


/dev # cat /proc/asound/timers 
G0: system timer : 10000.000us (10000000 ticks)
P0-0-0: PCM playback 0-0-0 : SLAVE
P0-0-1: PCM capture 0-0-1 : SLAVE
P0-0-2: PCM playback 0-0-2 : SLAVE
P0-1-0: PCM playback 0-1-0 : SLAVE
P0-1-1: PCM capture 0-1-1 : SLAVE


/dev # cat /proc/asound/card0/pcm0p/info 
card: 0
device: 0
subdevice: 0
stream: PLAYBACK
id: DSP 1 msm-codec-dai-0
name: 
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 2
subdevices_avail: 2


/dev # cat /proc/asound/card0/pcm1p/info 
card: 0
device: 1
subdevice: 0
stream: PLAYBACK
id: MVS mvs-codec-dai-1
name: 
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 1

请让我知道我应该怎么做才能让它发挥作用。

我提前感谢。

祝你有美好的一天。


我将官方 alsa-lib 源的默认 alsa.conf 添加到 /usr/share/also 并在 /etc 处写了一个非常简单的 asound.conf

pcm.!default {
        type hw
        card 0
}

ctl.!default {
        type hw
        card 0
}

结果是,

/temp # aplay- l
**** List of PLAYBACK Hardware Devices ****
card 0: msmaudio [msm-audio], device 0: DSP 1 msm-codec-dai-0 []
  Subdevices: 2/2
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
card 0: msmaudio [msm-audio], device 1: MVS mvs-codec-dai-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

所以问题是配置文件,我遇到了另一个问题,aplay 卡在

/temp # aplay -i ./gbb.mp3
...
...
access("//.asoundrc", R_OK)             = -1 ENOENT (No such file or directory)
open("/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
ioctl(3, SNDRV_CTL_IOCTL_PVERSION or USBDEVFS_CONTROL or USBDEVFS_CONTROL32, 0xbedb085c) = 0
ioctl(3, SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE, 0xbedb0880) = 0
open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK|O_CLOEXEC
...
...

但我想这不再是关于配置了。

4

0 回答 0