|
Lines 366-371
Link Here
|
| 366 |
</sect2> |
366 |
</sect2> |
| 367 |
</sect1> |
367 |
</sect1> |
| 368 |
|
368 |
|
|
|
369 |
<sect2> |
| 370 |
<title>Utilizing Multiple Sound Sources</title> |
| 371 |
|
| 372 |
<para>It is often desirable to have multiple sources of sound that are able to |
| 373 |
play simultaneously, such as when <application>esound</application> or |
| 374 |
<application>artsd</application> don't support sharing of the sound device |
| 375 |
with a certain application.</para> |
| 376 |
|
| 377 |
<para>FreeBSD lets you do this through `Virtual Sound Channels', which can be |
| 378 |
set with the &man.sysctl.8; facility. Virtual channels allow you to multiplex |
| 379 |
your sound card's playback channels by mixing sound in the kernel.</para> |
| 380 |
|
| 381 |
<para>To set the number of virtual channels, there are two sysctl knobs which, |
| 382 |
if you are the <username>root</username> user, can be set like this:</para> |
| 383 |
|
| 384 |
<screen>&prompt.root; sysctl hw.snd.pcm0.vchans=4 &prompt.root; |
| 385 |
sysctl hw.snd.maxautovchans=4</screen> |
| 386 |
|
| 387 |
<para><literal>hw.snd.pcm0.vchans</literal> is the number of vchans pcm0 has, |
| 388 |
and is configurable once a device has been attached.<literal>hw.snd.maxautovchans |
| 389 |
</literal> is the number of vchans a new audio device is given when it is |
| 390 |
attached using &man.kldload.8;. Since the pcm module can be loaded independently |
| 391 |
of the hardware drivers, <literal>hw.snd.maxautovchans</literal> can store how |
| 392 |
many vchans any devices which are attached later will be given.</para> |
| 393 |
|
| 394 |
<para>If you are not using &man.devfs.5;, you will have to point your applications |
| 395 |
at <devicename>/dev/dsp0</devicename>.x, where 'x' is 0 to 3 if <literal> |
| 396 |
hw.snd.pcm.0.vchans</literal> is set to 4. On a system using devfs, the above |
| 397 |
will automatically be allocated transparently to the user.</para> |
| 398 |
|
| 369 |
<sect1 id="sound-mp3"> |
399 |
<sect1 id="sound-mp3"> |
| 370 |
<sect1info> |
400 |
<sect1info> |
| 371 |
<authorgroup> |
401 |
<authorgroup> |