Kubuntu 中无法检测到声卡,只有虚拟输出显示在声子中

Kubuntu 中无法检测到声卡,只有虚拟输出显示在声子中

看来,在 KDE 中,不会识别任何声卡。板载卡不起作用。但至少附加声卡应该可以工作:我试过两张不同的声卡,它们都可以工作,而且在 Live 环境中确实可以工作,但 pulseaudio 出了问题……在 Phonon 中,除了“Dummy Output”外没有列出任何卡,也没有声音。以下是一些输出(; daemonize = no在 中注释掉之后/etc/pulse/daemon.conf):

pulseaudio -vvvv

richie@richie-desktop:~$ pulseaudio -vvvv
I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
D: [pulseaudio] core-rtclock.c: Timer slack is set to 50 us.
D: [pulseaudio] core-util.c: RealtimeKit worked.
I: [pulseaudio] core-util.c: Successfully gained nice level -11.
I: [pulseaudio] main.c: This is PulseAudio 4.0
D: [pulseaudio] main.c: Compilation host: x86_64-pc-linux-gnu
D: [pulseaudio] main.c: Compilation CFLAGS: -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -W -Wextra -pipe -Wno-long-long -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option                                                                                                                                  
D: [pulseaudio] main.c: Running on host: Linux x86_64 3.11.0-15-generic #25-Ubuntu SMP Thu Jan 30 17:22:01 UTC 2014                                        
D: [pulseaudio] main.c: Found 2 CPUs.                                                                                                                      
I: [pulseaudio] main.c: Page size is 4096 bytes                                                                                                            
D: [pulseaudio] main.c: Compiled with Valgrind support: no                                                                                                 
D: [pulseaudio] main.c: Running in valgrind mode: no                                                                                                       
D: [pulseaudio] main.c: Running in VM: no                                                                                                                  
D: [pulseaudio] main.c: Optimized build: yes                                                                                                               
D: [pulseaudio] main.c: FASTPATH defined, only fast path asserts disabled.                                                                                 
I: [pulseaudio] main.c: Machine ID is fb1f7a50fa35f51686a94d09522640ea.                                                                                    
I: [pulseaudio] main.c: Session ID is c1.                                                                                                                  
I: [pulseaudio] main.c: Using runtime directory /run/user/1000/pulse.                                                                                      
I: [pulseaudio] main.c: Using state directory /home/richie/.config/pulse.                                                                                  
I: [pulseaudio] main.c: Using modules directory /usr/lib/pulse-4.0/modules.                                                                                
I: [pulseaudio] main.c: Running in system mode: no                                                                                                         
E: [pulseaudio] pid.c: Daemon already running.                                                                                                             
E: [pulseaudio] main.c: pa_pid_file_create() failed.                                                                                                       
richie@richie-desktop:~$ amixer                                                                                                                            
Simple mixer control 'IEC958',0                                                                                                                            
  Capabilities: pswitch pswitch-joined                                                                                                                     
  Playback channels: Mono                                                                                                                                  
  Mono: Playback [off]            

pacmd

richie@richie-desktop:~$ pacmd list                                                                                                                        
Welcome to PulseAudio! Use "help" for usage information.                                                                                                   
>>> Memory blocks currently allocated: 1, size: 63.9 KiB.                                                                                                  
Memory blocks allocated during the whole lifetime: 1, size: 63.9 KiB.                                                                                      
Memory blocks imported from other processes: 0, size: 0 B.                                                                                                 
Memory blocks exported to other processes: 0, size: 0 B.
Total sample cache size: 0 B.
Default sample spec: s16le 2ch 44100Hz
Default channel map: front-left,front-right
Default sink name: auto_null
Default source name: auto_null.monitor
Memory blocks of type POOL: 1 allocated/1 accumulated.
Memory blocks of type POOL_EXTERNAL: 0 allocated/0 accumulated.
Memory blocks of type APPENDED: 0 allocated/0 accumulated.
Memory blocks of type USER: 0 allocated/0 accumulated.
Memory blocks of type FIXED: 0 allocated/0 accumulated.
Memory blocks of type IMPORTED: 0 allocated/0 accumulated.
19 module(s) loaded.
    index: 0
        name: <module-device-restore>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically restore the volume/mute state of devices"
                module.version = "4.0"
    index: 1
        name: <module-stream-restore>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically restore the volume/mute/device state of streams"
                module.version = "4.0"
    index: 2
        name: <module-card-restore>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically restore profile of cards"
                module.version = "4.0"
    index: 3
        name: <module-augment-properties>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Augment the property sets of streams with additional static information"
                module.version = "4.0"
    index: 4
        name: <module-switch-on-port-available>
        argument: <>
        used: -1
        load once: no
        properties:

    index: 5
        name: <module-bluetooth-policy>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Frédéric Dalleau"
                module.description = "When a bluetooth sink or source is added, load module-loopback"
                module.version = "4.0"
    index: 6
        name: <module-bluetooth-discover>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Joao Paulo Rechi Vita"
                module.description = "Detect available bluetooth audio devices and load bluetooth audio drivers"
                module.version = "4.0"
    index: 7
        name: <module-native-protocol-unix>
        argument: <>
        used: -1
        load once: no
        properties:
                module.author = "Lennart Poettering"
                module.description = "Native protocol (UNIX sockets)"
                module.version = "4.0"
    index: 8
        name: <module-default-device-restore>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically restore the default sink and source"
                module.version = "4.0"
    index: 9
        name: <module-rescue-streams>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "When a sink/source is removed, try to move their streams to the default sink/source"
                module.version = "4.0"
    index: 10
        name: <module-null-sink>
        argument: <sink_name=auto_null sink_properties='device.description="Dummy Output"'>
        used: 0
        load once: no
        properties:
                module.author = "Lennart Poettering"
                module.description = "Clocked NULL sink"
                module.version = "4.0"
    index: 11
        name: <module-always-sink>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Colin Guthrie"
                module.description = "Always keeps at least one sink loaded even if it's a null one"
                module.version = "4.0"
    index: 12
        name: <module-intended-roles>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically set device of streams based of intended roles of devices"
                module.version = "4.0"
    index: 13
        name: <module-suspend-on-idle>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "When a sink/source is idle for too long, suspend it"
                module.version = "4.0"
    index: 14
        name: <module-systemd-login>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Create a client for each login session of this user"
                module.version = "4.0"
    index: 15
        name: <module-position-event-sounds>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Position event sounds between L and R depending on the position on screen of the widget triggering them."
                module.version = "4.0"
    index: 16
        name: <module-filter-heuristics>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Colin Guthrie"
                module.description = "Detect when various filters are desirable"
                module.version = "4.0"
    index: 17
        name: <module-filter-apply>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Colin Guthrie"
                module.description = "Load filter sinks automatically when needed"
                module.version = "4.0"
    index: 18
        name: <module-cli-protocol-unix>
        argument: <>
        used: -1
        load once: no
        properties:
                module.author = "Lennart Poettering"
                module.description = "Command line interface protocol (UNIX sockets)"
                module.version = "4.0"
1 sink(s) available.
  * index: 0
        name: <auto_null>
        driver: <module-null-sink.c>
        flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
        state: SUSPENDED
        suspend cause: IDLE 
        priority: 1000
        volume: 0:   3% 1:   3%
                0: -87.39 dB 1: -87.39 dB
                balance 0.00
        base volume: 100%
                     0.00 dB
        volume steps: 65537
        muted: no
        current latency: 0.00 ms
        max request: 344 KiB
        max rewind: 344 KiB
        monitor source: 0
        sample spec: s16le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        used by: 0
        linked by: 0
        configured latency: 0.00 ms; range is 0.50 .. 2000.00 ms
        module: 10
        properties:
                device.description = "Dummy Output"
                device.class = "abstract"
                device.icon_name = "audio-card"
1 source(s) available.
  * index: 0
        name: <auto_null.monitor>
        driver: <module-null-sink.c>
        flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
        state: SUSPENDED
        suspend cause: IDLE 
        priority: 1000
        volume: 0: 100% 1: 100%
                0: 0.00 dB 1: 0.00 dB
                balance 0.00
        base volume: 100%
                     0.00 dB
        volume steps: 65537
        muted: no
        current latency: 0.00 ms
        max rewind: 344 KiB
        sample spec: s16le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        used by: 0
        linked by: 0
        configured latency: 0.00 ms; range is 0.50 .. 2000.00 ms
        monitor_of: 0
        module: 10
        properties:
                device.description = "Monitor of Dummy Output"
                device.class = "monitor"
                device.icon_name = "audio-input-microphone"
4 client(s) logged in.
    index: 0
        driver: <module-systemd-login.c>
        owner module: 14
        properties:
                application.name = "Login Session c1"
                systemd-login.session = "c1"
    index: 1
        driver: <protocol-native.c>
        owner module: 7
        properties:
                application.name = "KMix"
                native-protocol.peer = "UNIX socket client"
                native-protocol.version = "28"
                application.process.id = "1876"
                application.process.user = "richie"
                application.process.host = "richie-desktop"
                application.process.binary = "kmix"
                application.language = "en_US.UTF-8"
                window.x11.display = ":0"
                application.process.machine_id = "fb1f7a50fa35f51686a94d09522640ea"
                application.process.session_id = "c1"
                application.icon_name = "kmix"
    index: 2
        driver: <protocol-native.c>
        owner module: 7
        properties:
                application.name = "KMix"
                native-protocol.peer = "UNIX socket client"
                native-protocol.version = "28"
                application.process.id = "1504"
                application.process.user = "richie"
                application.process.host = "richie-desktop"
                application.process.binary = "kdeinit4"
                application.language = "en_US.UTF-8"
                window.x11.display = ":0"
                application.process.machine_id = "fb1f7a50fa35f51686a94d09522640ea"
                application.process.session_id = "c1"
    index: 3
        driver: <cli.c>
        owner module: 18
        properties:
                application.name = "UNIX socket client"
0 card(s) available.
0 sink input(s) available.
0 source outputs(s) available.
0 cache entrie(s) available.

cat /etc/pulse/default.pa

>>> richie@richie-desktop:~$ cat /etc/pulse/default.pa 
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.nofail

### Load something into the sample cache
#load-sample-lazy x11-bell /usr/share/sounds/gtk-events/activate.wav
#load-sample-lazy pulse-hotplug /usr/share/sounds/startup3.wav
#load-sample-lazy pulse-coldplug /usr/share/sounds/startup3.wav
#load-sample-lazy pulse-access /usr/share/sounds/generic.wav

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
#load-module module-udev-detect tsched=0
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

.ifexists module-android-audio-hal.so
load-module module-android-audio-hal
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GConf settings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gconf.so
.nofail
load-module module-gconf
.fail
.endif

### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
#load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

# X11 modules should not be started from default.pa so that one daemon
# can be shared by multiple sessions.

### Load X11 bell module
#load-module module-x11-bell sample=bell-windowing-system

### Register ourselves in the X11 session manager
#load-module module-x11-xsmp

### Publish connection data in the X11 root window
#.ifexists module-x11-publish.so
#.nofail
#load-module module-x11-publish
#.fail
#.endif

### Make some devices default
#set-default-sink output
#set-default-source input

在 ALSA 方面,每个声卡(包括板载声卡、HDMI 和额外添加的声卡)都可以正常工作。有人知道 pulseaudio 出了什么问题吗?

有什么办法可以让它正常运行并发出声音吗?

答案1

如果你这样做,ps ax | grep pulse你会注意到 pulseaudio 已经在运行:

➜  ~  ps ax | grep pulse
 3468 ?        S<l    0:55 /usr/bin/pulseaudio --start
➜  ~  pulseaudio -vvvv
I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
D: [pulseaudio] core-rtclock.c: Timer slack is set to 50 us.
D: [pulseaudio] core-util.c: RealtimeKit worked.
I: [pulseaudio] core-util.c: Successfully gained nice level -11.
I: [pulseaudio] main.c: This is PulseAudio 4.0
D: [pulseaudio] main.c: Compilation host: i486-pc-linux-gnu
D: [pulseaudio] main.c: Compilation CFLAGS: -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -W -Wextra -pipe -Wno-long-long -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option
D: [pulseaudio] main.c: Running on host: Linux x86_64 3.12-1-amd64 #1 SMP Debian 3.12.6-2 (2013-12-29)
D: [pulseaudio] main.c: Found 1 CPUs.
I: [pulseaudio] main.c: Page size is 4096 bytes
D: [pulseaudio] main.c: Compiled with Valgrind support: no
D: [pulseaudio] main.c: Running in valgrind mode: no
D: [pulseaudio] main.c: Running in VM: no
D: [pulseaudio] main.c: Optimized build: yes
D: [pulseaudio] main.c: FASTPATH defined, only fast path asserts disabled.
I: [pulseaudio] main.c: Machine ID is bfcb4f8e26b936b5242f474c51c5e2a9.
I: [pulseaudio] main.c: Session ID is 2.
I: [pulseaudio] main.c: Using runtime directory /run/user/1000/pulse.
I: [pulseaudio] main.c: Using state directory /home/user/.pulse.
I: [pulseaudio] main.c: Using modules directory /usr/lib/pulse-4.0/modules.
I: [pulseaudio] main.c: Running in system mode: no
E: [pulseaudio] pid.c: Daemon already running.
E: [pulseaudio] main.c: pa_pid_file_create() failed.

因此,您看到的行为是开发人员所期望的,如果您的声音不起作用,则可能是出于其他动机

答案2

在进入 PulseAudio 之前,使用 检查天气声卡是否已启动aplay -l。如果未在此处找到声卡,则查看启动的 dmesg。查看天气声音驱动程序是否已加载。您也可以通过执行lsmod | grepsnd 进行检查。Pulseaudio 只是一个音频服务器。如果上述内容正常运行,PulseAudio 应该可以正常工作。

相关内容