You are not logged in.

#1 2008-03-16 23:39:39

cerbie
Member
Registered: 2008-03-16
Posts: 124

PulseAudio/ALSA help -- no virtual devices

I installed PulseAudio, and...

in rc.conf:

DAEMONS=(syslog-ng network netfs crond sensors hal alsa avahi-daemon pulseaudio kdm)

output of groups:

wheel network video audio optical floppy storage users pulse pulse-access

my asound.conf:

pcm.ossmix {
    type pulse
    type dmix
    ipc_key 1024 # must be unique!
    ipc_key_add_uid false   # let multiple users share
    ipc_perm 0666           # IPC permissions for multi-user sharing (octal, default 0600)
    slave {
        pcm "hw:0,0"      # you cannot use a "plug" device here, darn.
        period_time 0
        period_size 2048 # must be power of 2
        buffer_size 32768  # dito. It
    rate 44100
       #format "S32_LE"
       #periods 128 # dito.
       #rate 8000 # with rate 8000 you *will* hear,
       # if ossmix is used :)
 }
    # bindings are cool. This says, that only the first
    # two channels are to be used by dmix, which is
    # enough for (most) oss apps and also lets 
    # multichannel chios work much faster:
    bindings {
        0 0 # from 0 => to 0
        1 1 # from 1 => to 1
    }
}
pcm.dsp0 {
    type plug
    slave.pcm "ossmix" # use our new PCM here
}
# mixer0 like above
ctl.mixer0 {
    type hw
    card 0
}

# You may want to make your new ossmix the default for alsa.
# If your alsa programs are complaining that they can't open
# your sound devices, try uncommenting this next line
pcm.default pcm.dsp0

pcm.pulse {
    type pulse
}

ctl.pulse {
    type pulse
}

my current asound.state:

state.PSC805 {
    control.1 {
        comment.access 'read write'
        comment.type BOOLEAN
        comment.count 1
        iface MIXER
        name 'PCM Playback Switch'
        value true
    }
    control.2 {
        comment.access 'read write'
        comment.type INTEGER
        comment.count 6
        comment.range '0 - 256'
        iface MIXER
        name 'PCM Playback Volume'
        value.0 97
        value.1 97
        value.2 126
        value.3 126
        value.4 0
        value.5 126
    }
    control.3 {
        comment.access 'read write'
        comment.type BOOLEAN
        comment.count 1
        iface MIXER
        name 'PCM Capture Switch'
        value true
    }
    control.4 {
        comment.access 'read write'
        comment.type INTEGER
        comment.count 2
        comment.range '0 - 8'
        iface MIXER
        name 'PCM Capture Volume'
        value.0 0
        value.1 0
    }
}

Note that asound.state is different with my other DAC (DAC707 USB), but I don't know that it can't offer any hints.

Finally, 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.

.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

### Load audio drivers statically (it's probably better to not load
### these drivers manually, but instead use module-hal-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 /usr/lib/pulse-0.9/modules//module-hal-detect.so
load-module module-hal-detect
.else
### Alternatively use the static hardware detection module (for systems that
### lack HAL support)
load-module module-detect
.endif

### Load several protocols
load-module module-esound-protocol-unix
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 reciever 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 description="RTP Multicast Sink"
#load-module module-rtp-send source=rtp.monitor

### Automatically restore the volume of playback streams
load-module module-volume-restore

### Automatically restore the default sink/source when changed by the user during runtime
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

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

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

### Publish connection data in the X11 root window
#.ifexists /usr/lib/pulse-0.9/modules//module-x11-publish.so
#load-module module-x11-publish
#.endif

### Register ourselves in the X11 session manager
# Deactivated by default, to avoid deadlock when PA is started as esd from gnome-session
# Instead we load this via /etc/xdg/autostart/ and "pactl load-module" now
# load-module module-x11-xsmp

### 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 /usr/lib/pulse-0.9/modules//module-gconf.so
load-module module-gconf
.endif

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

Based on the wiki article, it looks to me like this should just work, adding a virtual device...same, as far as I can tell, from Gentoo's wiki, and PulseAudio's docs, as well.

Initially, both errors in the Arch wiki occured. First the ".fail" one, and then the X11 publish one after that.

No errors or warnings come up now, but all that I have is the device representing the hardware. If I start ALSA before HAL, the "loading modules" step at bootup takes a long time, and pops out a warning that it can't add a MIDI sequencer just before it moves on (and does so with the other USB DAC, as well).

P.S. I've been dealing with this again and again, over several install,s and now three kernel versions. Trying many options. It appears to be an ALSA problem (ALSA appears to see everything, but gives errors starting, these days, and won't output through all devices). Doing a, "by the book," PulseAudio config, with onboard off (Intel/Realtek HDA), and booting up with a USB sound device, seems to work reliably (after that, hotplugging any in works fine). Likewise, for playing with SPDIF, having HDA on and nothing else plugged in the PC works fine.

Last edited by cerbie (2008-11-22 05:52:40)


"If the data structure can't be explained on a beer coaster, it's too complex." - Felix von Leitner

Offline

Board footer

Powered by FluxBB