[LAU] Hideous dmix, alsa, jack, realtime and mixing mess

cdr _ at whats-your.name
Fri Sep 21 21:59:12 EDT 2007


On Sat Sep 22, 2007 at 01:14:24AM +0100, Simon Williams wrote:
> AAAARRRGGHHHH!!! FOR GOODNESS SAKE!!!!!!!
> Hardware manufacturers are now driving me totally insane. Are they all 
> completely brain dead? How in the world is anyone actually supposed to use 
> the appalling software sound cards they put in laptops and on motherboards 
> these days?

most people don't. they just use the onboard speakers to watch youtube clips with 8kbps compressed audio..

that said, i found onboard sound completely usable with jack, from a technical standpoint. the main prob is the desktop has horrible RFI sounding leakage on the autio out. and the notebook has horrible quality and additionally after bumping the headphone jack only outputs the left channel.,


> (more on why later). In the end I gave up and settled with one audio 
> application at a time.
> have to manually start the jack server when I want it and shut it down if I 
> want to play audio from any other application.


youll definitely go insane if youre trying to use dmix ALSA apps and JACK stuff all at once, with a single PCM.

ask yourself, do you really need those ALSA apps? which are they? mplayer has a jack backend, as does gstreamer, so just about any media player should be covered if you choose to use JACK instead of dmix for multiplexing your PCM

> dmix blocked the soundcard anyway, so if any one of my applications didn't 
> use dmix I was back to one at a time.
> (I'm looking at YOU, flash plugin (which, incidentally, also comes under 
> the category of "useless ****ing ****")- more on that later as well)

flash opens another PCM if the lowest one is blocked, like hw:0,0,2 if hw:0,0,0 is in use. not sure about other cards but my echo has 8 PCMs (and hw mixing) even tho theres only one physical out.

> Actually, whilst I'm at it could somebody please explain why
> 	fluidsynth --> ALSA
> lags, yet
> 	fluidsynth --> jack --> ALSA
> does not? How in the world does adding yet another layer of software 
> actually SPEED UP the sound output??!?!?!?!?

cuz it picks a large buffer with ALSA and doesnt let you configure it easily.. instead of slaving to jack's more sensible settings for realtime use


> But now I want to play along to an mp3 track. And here a large number of 
> unacceptable hacks and compromises combine, eventually forcing me to go 
> right back to the beginning.

eh? mplayer plays to jack, madjack is an OSC controllable mp3 player that afaik, _only_ plays to jack.. plus maybe one of the DAWs can play mp3 regions directly without decoding to WAV on import (the way Samplitude has done for a decade), have you tried qtractor, ardour, and traverso? maybe you can use ogg and one of them will do it by virtue of libsndfile?


> My initial thought was to try and get my other applications to use jack 
> directly, which would have the added bonus of mixing them nicely. Great in 
> theory, but xmms-jack didn't work and it looks like most other applications 
> will require similar hacks, which for the most part are not available. I 

xmms-jack is pretty old. audacious played to jack fine here, before i stopped using GUI players entirely..

> can't even get some applications to use ALSA instead of OSS, so I don't 
> really stand much chance of getting them to use jack.

apps that still only support OSS? which are these?

> And then I found this...
> http://www.articleworld.org/index.php/How_to_force_ALSA_applications_to_use_JACK
> which looked great, but it uses /etc/asound.conf and ~/.asoundrc. Why is 
> this a problem? Well, aside from the horrific memories it brings back of 
> trying to get dmix to work, I am never actually sure if either of those two 
> files are actually being used, if the syntax is correct, or if the 
> particular contents I found on the internet should actually work. I am 
> convinced that there is some voodoo involved. The site given above also 
> mentions restarting the alsa rc script to make sure that the changes take 
> place, but since there isn't actually an alsa service this seems like 
> complete rubbish to me.

gentoo has a /etc/init.d/alsasound which handles the mixerstate and other stuff.. theres a simialr script for initng

i think in general. udev handles it. i mean i cant even play sound without udev..

that jack-PCM for alsa is kinda nutty, and doesnt totally work. again, why not fix the apps causing problems to not require hacks in the first place?


> 1. How do you tell an application to use dmix (an old and probably 
> irrelevant question, but I want to know anyway)?

set the output to plug:dmix. 

> 2. Why does adding an extra layer of software (jack) in between fluidsynth 
> and ALSA speed up the audio output?

sane buffer defaults and better playback (callback) design

> 3. How do I get proprietary software (which for some reason all still uses 
> OSS)(flash, teamspeak) to use ALSA?

flash doesnt use OSS anymore. upgrade to v9

> 3a. Or at the very least get the flash plugin to release the sound device 
> once it's finished, without requiring the whole of firefox to be restarted?

gnash almost plays youtube these days, btw..

> 4. How do I check that /etc/asound.conf and/or ~/.asoundrc are actually 
> being used?
> 5. How can I force applications to use jack (at the least I need xmms, vlc, 
> mplayer and preferably flash)?

ao=jack in /etc/mplayer/mplayer.conf or ~/.mplayer. xmms, try audacious. flash, good luck :)


> If I buy a pcmcia soundcard is it worth it? Any recommendations? Will it  
> have hardware mixing and a hardware synth? Why are they so damn expensive? 

i'd say so. the sound quality differnce was night and day between the onboard ATIIXP and Echo Indigo. like lifting a veil. plus the onboard plug stopped sending the right channel after bumping it lightly once. my desktop had slightly better onboard quality (intel8x0) but had horrible noise leakage from the cpu and USB..

> I'm currently looking at 70 pounds on ebay for a Creative Audigy 2, which 
> seems totally ridiculous seeing as my midi controller only cost 50. I'm 

nice DACs and ADCs fit into a PCMCIA enclosure are surely more expensvie to produce than a cheapo MIDI chip in a plastic USB brick.

that said, i got my indigo-io for a bit over 100 USD on ebay. thats what, 40 pounds?

> loathed to buy a USB one (especially as I only have USB1.1)- anyone got any 
> comments on those?

nope. i'd stay away :)

also note that most firewire interfaces are not bus-powered. unless you have a fat 6-pin plug. (the little 4-pin plug being most common)

>
> The whole point of buying a midi controller instead of a normal keyboard 
> was that it was supposed to be cheaper and more portable. It doesn't seem 
> to be going that way.

eh? every MIDI device i still own has usb bus power and additional MIDI ports (CME U-Key, Korg PadKontrol). so ive got a MidiSport and MOTU MIDI thing just sitting in a pile of junk

>
> Any suggestions?

hope that helps. in summary i dont things are as bad as you make them seem (i can empathize with the feelings of frustration. and used to feel like you, until making a few changes)


> Simon
> _______________________________________________
> Linux-audio-user mailing list
> Linux-audio-user at lists.linuxaudio.org
> http://lists.linuxaudio.org/mailman/listinfo.cgi/linux-audio-user



More information about the Linux-audio-user mailing list