Welcome to the new location of Alien's Wiki, sharing a single dokuwiki install with the SlackDocs Wiki.
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Last revision | |||
— | slackware:alsa [2006/03/18 22:21] – created alien | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Mixed Sound with ARTS and ALSA ====== | ||
+ | |||
+ | A small HOWTO found at http:// | ||
+ | |||
+ | ALSA comes with a method to mix multiple sound streams which is called //dmix//. ALSA-enabled applications should be able to all access the device at the same time when it is set up. To do this you'll need to set up either a system-wide ''/ | ||
+ | |||
+ | |||
+ | ===== / | ||
+ | |||
+ | Here is an example ''/ | ||
+ | |||
+ | < | ||
+ | pcm.ossmix { | ||
+ | type dmix | ||
+ | ipc_key 1027 # must be unique! | ||
+ | slave { | ||
+ | pcm " | ||
+ | # device here, darn. | ||
+ | period_time 0 | ||
+ | period_size 1024 | ||
+ | buffer_size 4096 | ||
+ | #format " | ||
+ | #periods 128 # dito. | ||
+ | rate 44100 # with rate 8000 you *will* | ||
+ | # hear, if ossmix is used :) | ||
+ | } | ||
+ | bindings { | ||
+ | 0 0 # from 0 => to 0 | ||
+ | 1 1 # from 1 => to 1 | ||
+ | } | ||
+ | } | ||
+ | pcm.!default { | ||
+ | type plug | ||
+ | slave.pcm " | ||
+ | } | ||
+ | # mixer0 like above | ||
+ | ctl.mixer0 { | ||
+ | type hw | ||
+ | card 0 | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== / | ||
+ | |||
+ | The instructions at http:// | ||
+ | |||
+ | This is what ''/ | ||
+ | |||
+ | < | ||
+ | #asym fun start here. we define one pcm device called " | ||
+ | pcm.dmixed { | ||
+ | ipc_key 1025 | ||
+ | type dmix | ||
+ | slave { | ||
+ | pcm " | ||
+ | period_time 0 | ||
+ | period_size 1024 | ||
+ | buffer_size 8192 | ||
+ | rate 48000 | ||
+ | } | ||
+ | } | ||
+ | |||
+ | #one called " | ||
+ | pcm.dsnooped { | ||
+ | ipc_key 1026 | ||
+ | type dsnoop | ||
+ | slave.pcm " | ||
+ | } | ||
+ | |||
+ | #and this is the real magic | ||
+ | pcm.asymed { | ||
+ | type asym | ||
+ | playback.pcm " | ||
+ | capture.pcm " | ||
+ | } | ||
+ | |||
+ | #a quick plug plugin for above device to do the converting magic. saves | ||
+ | #typing when settng the pcm name in an alsa app | ||
+ | pcm.pasymed { | ||
+ | type plug | ||
+ | slave.pcm " | ||
+ | } | ||
+ | |||
+ | #a ctl device to keep xmms happy | ||
+ | ctl.pasymed { | ||
+ | type hw | ||
+ | card 0 | ||
+ | } | ||
+ | |||
+ | #here we try to point the aoss script to our asymed device | ||
+ | pcm.dsp0 { | ||
+ | type plug | ||
+ | slave.pcm " | ||
+ | } | ||
+ | |||
+ | ctl.mixer0 { | ||
+ | type hw | ||
+ | card 0 | ||
+ | } | ||
+ | |||
+ | #this sets the default device | ||
+ | pcm.!default { | ||
+ | type plug | ||
+ | slave.pcm " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | It's pretty much the same as decribed in the given link. However, a problem is to get applications to work with it that do not support ALSA. | ||
+ | |||
+ | |||
+ | ===== ARTS ===== | ||
+ | |||
+ | The solution to the above mentioned problems is to use a sound daemon, like KDE's ARTS. | ||
+ | |||
+ | Arts needs to be started on login. You can do that for instance from your '' | ||
+ | |||
+ | < | ||
+ | |||
+ | |||
+ | ===== Application Setup ===== | ||
+ | |||
+ | ==== Firefox ==== | ||
+ | |||
+ | To make firefox use the ARTS daemon we use a library wrapper called '' | ||
+ | |||
+ | < | ||
+ | |||
+ | To be sure it works install the Flash Plugin and try any Flash animation - like this [[http:// | ||
+ | |||
+ | |||
+ | ==== XMMS ==== | ||
+ | |||
+ | For xmms, you need to select the // | ||
+ | |||
+ | |||
+ | ==== GAIM ==== | ||
+ | |||
+ | Also easy - in the //Sound// preferences tab, select // | ||
+ | |||
+ | |||
+ | ==== MPlayer ==== | ||
+ | |||
+ | The [[http:// | ||
+ | |||
+ | Available audio output drivers: | ||
+ | mpegpes Mpeg-PES audio output | ||
+ | oss OSS/ | ||
+ | alsa9 ALSA-0.9.x audio output | ||
+ | esd EsounD audio output | ||
+ | sdl SDLlib audio output | ||
+ | null Null audio output | ||
+ | pcm RAW PCM/WAVE file writer audio output | ||
+ | plugin Plugin audio output | ||
+ | |||
+ | Now the dmix feature configured above comes in handy again. We just use the '' | ||
+ | |||
+ | Just add this to the '' | ||
+ | |||
+ | < | ||
+ | ao=alsa9: | ||
+ | srate=48000 | ||
+ | </ | ||