Ticket #25 (new enhancement)

Opened 2 years ago

Last modified 5 months ago

Support ALSA hardware mixing

Reported by: elmarco Assigned to: lennart
Priority: normal Milestone:
Component: module-alsa-* Severity: normal
Keywords: Cc: gjc@inescporto.pt

Description

It would be great if the hardware mixing available with ALSA were used.

Change History

11/24/06 22:45:09 changed by gjc

  • cc set to gjc@inescporto.pt.

IMHO "it would be great" is not a correct way to put it; we _need_ PA to play nice with ALSA dmix, which is now turned on by default, regardless of whether the device supports hardware mixing or not.

I remember exactly how many years it took to convert most apps from OSS to ALSA (in fact, many still use OSS only), I know of many apps that will never convert to a pulseaudio API, which make them not play any sound ever while the PA server is running because PA, unlike any other ALSA client I've used before, has the uncanny ability of hogging the sound device and not letting anyone else access it. Not nice!

11/27/06 10:26:06 changed by ossman

dmix is the opposite of hardware mixing, it does it all in software.

If pulse hogs your sound card then you've either configured alsa or pulse to use bare hardware.

11/27/06 11:47:34 changed by gjc

I'm not sure, but I think dmix does it in either software or hardware depending on your card's capabilities.

Anyway, I'm pretty sure I didn't configure alsa for anything; in fact, I just checked, it has no configuration file at all (neither ~/.asound.conf nor /etc/asound.conf exist).

I normally have mixing with alsa (either hardware or software, I don't know). For instance, I can listen to rhythmbox and play xmame with sounds at the same time. Once I installed pulseaudio, at next login the pulseaudio daemon started running, and I no longer had sound in xmame. So naturally I had to uninstall pulseaudio again.

12/18/07 18:54:18 changed by rawler

Same problem here. Starting pulse with a native alsa-stream it only says it can open hw:0, although the alsa-default is dmix (I think, at least it works running I.E. Rhythmbox and aplay at the same time.)

Is it possible to change this somewhere?

(follow-up: ↓ 6 ) 12/18/07 19:24:18 changed by rawler

Actually, I just figured it out. Seems like the HAL-detection bypasses alsa-defaults, and connects directly to the hardware.

Editing /etc/pulse/default.pa, commenting out autodetection and enabling load-module module-alsa-sink fixed the problem at once.

Using the HAL-module is the default configuration in Ubuntu, creating the problem for any card not supporting hardware-mixing. There is a bug in launchpad on the topic https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/109439

(in reply to: ↑ 5 ) 04/05/08 14:26:06 changed by meden

I managed to deal correctly with ALSA and dmix disabling module-hal-detect and setting up thing manually as follow (in default.pa):

# Carica i moduli In/Out ALSA per la Audigy
load-module module-alsa-sink device=front:CARD=Audigy,DEV=0 sink_name=Audigy_Out_2.0
load-module module-alsa-sink device=surround51:CARD=Audigy,DEV=0 sink_name=Audigy_Out_5.1
load-module module-alsa-source device=hw:0,0 source_name=Audigy_In
#
# Carica i moduli In/Out ALSA per la IntelHDA
load-module module-alsa-sink device=front:CARD=Intel,DEV=0 sink_name=IntelHDA_Out
load-module module-alsa-source device=hw:1,0 source_name=IntelHDA_In

Now, using ALSA device names, I can choose where redirect streams and the number of channel happily, without locking the hardware. And Skype works too. Hope that can help.