Gentoo Archives: gentoo-user

From: YoYo Siska <yoyo@××××××.sk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] What is the best audio system?
Date: Tue, 28 Feb 2012 09:07:23
Message-Id: 20120228090615.GA3719@ksp.sk
In Reply to: Re: [gentoo-user] What is the best audio system? by Frank Steinmetzger
1 On Tue, Feb 28, 2012 at 03:30:24AM +0100, Frank Steinmetzger wrote:
2 >
3 > > dmix *may* be able to handle multiple audio streams (in practice, in
4 > > my personal experience, it always requires more work than PA); but it
5 > > will never be able to do the other stuff PA handles.
6 >
7 > This seems like a dumb question (for I was a strict PA denier until recently
8 > and have been using alsa-only since always), but does PA handle OSS
9 > applications better than alsa/dmix? Whenever I want to use sidplay, which only
10 > speaks OSS, I need to stop all other audio programs (e.g. press Stop in the
11 > Clementine player if it's only paused), or else /dev/dsp was busy.
12
13 PA doesn't care about oss (/dev/dsp). It opens the soundcard through
14 normal alsa interface (which means /dev/dsp becomes busy). You can
15 either kill pulseaudio, or tell pulseaudio to suspend the correspondig
16 sink (not sure what exactly happens if an audio stream through PA is active
17 etc..).
18
19 Regarading oss (/dev/dsp) and plain alsa, it is the same, if something
20 opens the soundcard through alsa, /dev/dsp becomes busy... (even when
21 using dmix in alsa, because /dev/dsp is handled by a kernel modules,
22 dmix is userspace).
23
24 There is however a way to amke oss work with dmix through aoss (a small
25 program that preloads a binary, that 'hijacks' calls to open /dev/dsp
26 and 'reroutes' that to alsa, works most of the time, but can have
27 problems if the program does some weird things...)
28 In that case aoss opens the alsa device "pcm.dsp" (or dsp0, i'm not sure
29 right now), which you can easily point to dmix...
30
31 from my /etc/asond.conf:
32 ========================================
33 pcm.dsp {
34 type plug
35 slave.pcm "duplex"
36 }
37 pcm.dsp0 {
38 type plug
39 slave.pcm "duplex"
40 }
41 pcm.!default {
42 type plug
43 slave.pcm "duplex"
44 }
45 pcm.duplex {
46 type asym
47 playback.pcm "dmix:0"
48 capture.pcm "dsnoop:0"
49 }
50 ========================================
51
52 Then you can run (even multiple) 'aoss mpg123 file.mp3 ...'
53
54
55 You can also make this to work alongside pulseaudio, if you configure
56 pulseaudio to use the dmix device instead of directyly using the hw
57 device.
58 Nnote that this might cause problems, you have to disable pulseaudio's
59 autodetect and configure all soundcards manually, and using dmix
60 introduces some additional overhead and probles, also such setup is most
61 probably not supported by pulseaudio etc... However it also enables you
62 tu run plain alsa apps alongside PA (officialy you should just configure the
63 !default device to use the PA alsa plugin is simpler and it should work
64 better, though I had some problems with some apps) and more importantly
65 to run multi PAs simultaneusly (ie for multiple users...)
66
67
68 yoyo

Replies

Subject Author
Re: [gentoo-user] What is the best audio system? Marc Joliet <marcec@×××.de>
Re: [gentoo-user] What is the best audio system? Frank Steinmetzger <Warp_7@×××.de>