File: configuration.html

package info (click to toggle)
yiff 2.14.2-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,044 kB
  • ctags: 2,899
  • sloc: ansic: 36,398; cpp: 7,233; makefile: 428; sh: 156
file content (813 lines) | stat: -rw-r--r-- 26,383 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
<html>
<head>
<title>YIFF Configuration HOWTO</title>

<meta name="Author" CONTENT="WolfPack Entertainment">
<meta name="description" CONTENT="YIFF Sound Server configuration HOWTO">
<meta name="keywords" CONTENT="Y2,YIFF,Sound,Server,system,documentation,
configuration,configure,config,configuring,setup,set,up,howto">
<meta name="GENERATOR" CONTENT="Mozilla/3.04Gold (Linux; I) [Netscape]">

<body
 background=""
 bgcolor=ffffff
 text=000000
 link=c050cf
 vlink=80708f
 alink=606060
>

</head>


<body>
<a name="top">
<left>
<p><h6>
Back to <a href="documentation.html">documentation</a>
</h6></p>
<p><h6>
2000 December 1
</h6></p>

</left>
<center>
<h1>YIFF Sound Server<br>Configuration HOWTO</h1>
</center>

<left>
<h3>Contents</h3>
<ol>
 <li><a href="#s1">Basics about sound on computers</a>
 <li><a href="#s2">Y Sound System terminology</a>
 <li><a href="#s3">Requirements</a>
 <li><a href="#s4">Setting up <code>yiffrc</code></a>
 <li><a href="#s5">`Walk-though' using the Y Sound Server</a>
 <li><a href="#s6">Y server run on demand rules</a>
</ol>
</left>



<left>
<img src="hr1.gif" width=95% height=32>
<a name="s1">
<h2>Basics about sound on computers</h2>
<p>
Knowing the fundimentals on how your computer produces sound is the most
important topic of configuring the YIFF Sound Server, newbies and
advanced gurus should take a moment to review this section
<u>throughly</u>!
</p>

<p>
Your computer produces (and records) sound using an <i>audio adapter</i>,
more commonly reffered to as a <i>sound card</i>. The Y Sound System
reffers to this as the <i>recorder</i> (details in the
<a href="#s2">next section</a>). We will reffer to it as the
<i>sound card</i> for now...
</p>

<p>
The sound card has the following configurable attributes (some sound
cards may have additional attributes and features):
<ul>
 <li><i>Digital Sound Processor</i> (abbriviated DSP), this is the part
of the sound card that produces per sample sound.
 <li><i>Musical instrument data interface synth</i> (abbriviated MIDI),
this is the part of the sound card that produces preprogrammed musical
instrument sounds from a given sequence of notes to play (not all
sound cards have this).
 <li><i>Sample rate</i> the speed at which each <i>sample</i> is played.
This unit is measured in Hz on the DSP.
 <li><i>Sample size</i> the number of bits (usually 8 or 16) representing
one sample on the DSP.
 <li><i>Channels</i> the number of channels; 1 for mono, 2 for stereo,
and 4 for quad. Note that quad sound is not supported on all systems.
 <li><i>Buffer fragment size</i> the number of bytes being played per
<i>cycle</i> on the DSP.
</ul>
</p>

<p>It is critical that you know how to calculate the above
information when configuring the YIFF Sound Server (and using Y
client applications too).
</p>

<p>
YIFF and the Y system handles data in bytes, for instance if you
set the sample rate to 11025 Hz and the sample size was set to 8 bits
with 1 channel then you would have 11025 * 1 * 1 = 11025 bytes per
second. Since
there are 8 bits in one byte, but what if the sample size was 16 bits?
Then that would be two bytes per sample. So now you would have
11025 * 2 * 1 = 22050 bytes per second.
</p>

<p>
In the above two examples the number of channels remained at a constant
1. What if you had a sample rate of 11025 Hz and sample size was set to
8 bits but channels is set to 2? Although each sample is represented by
one byte, you have two channels therefore it is one sample per
channel. So with two channels you would have a total of 11025 *
1 * 2 = 22050 bytes
per second even though the sample size is set to 8 bits (one byte).
</p>

<p>Lastly if the sample rate was 22050 Hz and the sample size was set
to 16 bits (2 bytes) and channels set to 2. Then you would have
22050 * 2 * 2 = 88200 bytes.
</p>

<p>Now we add one more attribute in to the equation and that is
<i>buffer fragment size</i>. The sound card driver does not handle
updates in seconds, rather it updates things in <i>cycles</i>. A
<i>cycle</i> can have a variable relationship with real time,
it is determined by the other attributes <i>sample rate</i>,
<i>sample size</i>, <i>channels</i>, and <i>buffer fragment size</i>.
</p>

<p>Software under most circumstances calculates the cycle, however
YIFF allows you to either let it calculate it or allow you to
set an explicit value for a set of conditions. The cycle is usually
measured in <i>microseconds</i> (abbriviated <i>us</i>), and is calculated
with the following equation:
<ul>
 <li><code>cycle_us = 1,000,000 / (sample_rate * channels *
(sample_size_bits / 8)) * buffer_fragment_size / 1.5</code>
</ul>
That equation calculates the cycle for a typical double buffer
(two buffer fragments) situation. Assuming <code>sample_rate</code> and
<code>channels</code> are greater than 0 and <code>sample_size_bits</code>
is greater than or equal to 8. <code>buffer_fragment_size</code>
is a 2^n value (ie 256, 512, 1024, etc...).
Note that this equation conforms to the
<a href="http://www.opensound.com/">Open Sound System
(OSS) implmentation</a>.
</p>

<p>If the <i>cycle</i> interval is too big then you will here rapit
`clicks' or `gaps' in the sound, if it is set too small then the buffers
will slowly overflow. Note that YIFF will try its best to keep the buffer
from overflowing by resyncing the sound driver every few seconds
(you can adjust this interval too). So it's generally safer to make the
cycle interval value a tad smaller at a cost to performance. However
in most situations the calculated theoretical cycle interval will work
just fine.
</p>

<h6>
Back to the <a href="#top">top</a>.
</h6>
</left>



<left>
<img src="hr1.gif" width=95% height=32>
<a name="s2">
<h2>Y Sound System terminology</h2>
<p>
The Y Sound System employs a few additional terms to generalize
additional conceptual properties about using your sound card.
These conceptual properties will help make it easier to work with
sound using the Y system at a higher level.
<ul>
 <li><i>Recorder</i> addresses the entire audio device or sound card unit. 
 <li><i>Audio</i> is a set of adjustable parameters for a recorder.
 <li><i>Sound</i> the segment of data representing sound currently being
played or recorded.
 <li><i>Cycle</i> is the interval in which the <i>Sound</i> is updated to
the <i>recorder</i>.
</ul>
</p>

<h6>
Back to the <a href="#top">top</a>.
</h6>
</left>


<left>
<img src="hr1.gif" width=95% height=32>
<a name="s3">
<h2>Requirements</h2>
<p>
<ol>
 <li>A system with any of the following drivers installed:
  <ul>
   <li><a href="http://www.alsa-project.org/">
Advanced Linux Sound Architechture (ALSA)</a>
   <li>Linux sound driver (plain vanilla driver from the kernel)
   <li><a href="http://www.opensound.com/">
Open Sound System (OSS)</a>
  </ul>
 <li>Latest <a href="download.html">YIFF Sound Server</a>
 installed (but not configured)
</ol>
</p>

<h6>
Back to the <a href="#top">top</a>.
</h6>
</left>



<left>
<img src="hr1.gif" width=95% height=32>
<a name="s4">
<h2>Setting up <code>yiffrc</code></h2>
<p>
The <code>yiffrc</code> is a configuration file which the YIFF
Sound Server needs in order to run properly, this file is usually
placed in <code>/usr/etc/yiffrc</code>.
</p>

<p>A default copy is placed in <code>/usr/etc/yiffrc</code> when
you first install the YIFF Sound Server. There are two ways to
edit this file, you can edit it by hand or use <code>yiffconfig</code>
</p>

<p>
You are strongly encuraged to use <code>yiffconfig</code> first,
come back to this section of the HOWTO if and only if it does not work
and you need to configure it manually.
</p>

<p>
To configure <code>yiffrc</code> manually, run your prefered text editor
and read through the entire configuration file first. Each section and
parameter should come fully commented (a comment is a line starting
with a <code>#</code> character).  Read each comment carefully and
set the appropriate value. Some more important or obscure parameters
will be described as follows
</p>

<h4>Preset Y Audio Modes</h4>
<p>Preset <i>Y Audio Modes</i> are located in a section of configuration
blocks starting with <code>BeginYAudioMode</code> and ending with
<code>EndYAudioMode</code>. Reffer to the
<a href="#s1">basic properties of sound cards</a> to set the appropriate 
values, note that you should only change these values if they do not work
out at first (ie if you experience delays or 'clicks' during playing of
sound). Preset Y Audio Modes make it easier for Y clients to change
the Audio parameters by using preset ones which it would consider
as `known working Audio parameters'.
</p>

<p>Below is a sample section for Y Audio Modes:</p>
<p>
<pre><code>
BeginYAudioMode
    Name = Default
    Cycle = 30959
    WriteAhead = 46438
    SampleSize = 8
    Channels = 1
    SampleRate = 11025
    AllowFragmenting = yes
    Fragments = 2
    FragmentSize = 512
    FlipStereo = no
    Direction = Play
EndYAudioMode

BeginYAudioMode
    Name = PlayMono8000
    Cycle = 42666
    WriteAhead = 63999
    SampleSize = 8
    Channels = 1
    SampleRate = 8000
    AllowFragmenting = yes
    Fragments = 2
    FragmentSize = 512
    FlipStereo = no
    Direction = Play
EndYAudioMode

BeginYAudioMode   
    Name = PlayStereo8000
    Cycle = 42666
    WriteAhead = 63999
    SampleSize = 8
    Channels = 2
    SampleRate = 8000
    AllowFragmenting = yes
    Fragments = 2
    FragmentSize = 1024
    FlipStereo = no
    Direction = Play
EndYAudioMode

BeginYAudioMode   
    Name = PlayMono11025
    Cycle = 30959
    WriteAhead = 46438
    SampleSize = 8
    Channels = 1
    SampleRate = 11025
    AllowFragmenting = yes
    Fragments = 2
    FragmentSize = 512
    FlipStereo = no
    Direction = Play
EndYAudioMode

BeginYAudioMode   
    Name = PlayStereo11025
    Cycle = 30959
    WriteAhead = 46438
    SampleSize = 8
    Channels = 2
    SampleRate = 11025
    AllowFragmenting = yes
    Fragments = 2
    FragmentSize = 1024
    FlipStereo = no
    Direction = Play
EndYAudioMode

BeginYAudioMode   
    Name = PlayMono22050
    Cycle = 30959
    WriteAhead = 46438
    SampleSize = 8
    Channels = 1
    SampleRate = 22050
    AllowFragmenting = yes
    Fragments = 2
    FragmentSize = 1024
    FlipStereo = no
    Direction = Play
EndYAudioMode

BeginYAudioMode   
    Name = PlayStereo22050
    Cycle = 30959
    WriteAhead = 46438
    SampleSize = 8
    Channels = 2
    SampleRate = 22050
    AllowFragmenting = yes
    Fragments = 2
    FragmentSize = 2048
    FlipStereo = no
    Direction = Play
EndYAudioMode
</code></pre></p>

<p>That was just a sample of a few basic Y Audio Modes, note that
the names of the Y Audio Modes are important. You should have all
the standardized modes defined, reffer to the default <code>yiffrc</code>
that was installed with the rest of the YIFF Sound System for
a complete listing.
</p>

<p>
Note that <code>AllowFragmenting</code> should always be <code>yes</code> 
(it's backwards compatability for older versions of Linux). The number of
fragments <code>Fragments</code> should be <code>2</code> (for double
buffering).
</p>

<h4>MIDI Player Command</h4>
<p>
MIDI support requires an external player, there is a parameter called
<code>MIDIPlayCommand</code> it specifies the command to have YIFF
run when a Y client program requests that a MIDI type sound object
needs to be played. 
</p>

<p>
Example command if your player was <code>pmidi</code>:
</p>
<p><pre><code>
MIDIPlayCommand = /usr/bin/pmidi -p 65:0 %f
</code></pre></p>

<p>
Note that the <code>%f</code> will be replaced with the full path to
the sound object.
</p>

<p>Another related parameter is <code>MIDIDevicePort</code>, this value
is the ALSA MIDI device port number. This value is only used if
you are using ALSA, typically you can leave this value as <code>0</code>.
</p>


<h4>Y Sound Paths</h4>

<p>You can define one or more search paths called <i>Y Sound Paths</i>
which are directories to look for Sound object files (.wav or .mid files
for example). When a Y client gives a relative path to the YIFF server,
the YIFF server will search through each one of these paths for the
sound object looking for a match.
The Y Sound Paths configuration block begins with a
<code>BeginYSoundPath</code> and ends with a <code>EndYSoundPath</code>.
The search goes through the listing from first Y Sound Path defined to
the last one.
</p>

<p>For example</p>
<p><pre><code>
BeginYSoundPath
    Path = /usr/share/sounds
EndYSoundPath

BeginYSoundPath
    Path = /tmp
EndYSoundPath
</code></pre></p>

<p>
This covers most of the problem areas that might cause confusion during
configuring.</p>
<p>
If you are still having trouble configuring or have additional
questions about configuration, feel free to ask the
<a href="http://wolfpack.twu.net/contacts.html">authors</a>.
</p>

<p>To test if everything is working, make sure your sound drivers
are loaded and run:
<ul>
 <li><code>/usr/sbin/yiff /usr/etc/yiffrc</code>
</ul>
Be sure to read the <a href="#s5">next section</a> which shows you how to
run the YIFF Sound Server and modify it with the Y utility programs at run
time. ...Plus many other features!
</p>

<h6>
Back to the <a href="#top">top</a>.
</h6>
</left>


<left>
<img src="hr1.gif" width=95% height=32>
<a name="s5">
<h2>`Walk-though' using the Y Sound Server</h2>
<p>Now hopefully you have atleast one working preset Y Audio Mode and
are ready to hear it work.
</p>

<h4>Starting the YIFF Sound Server</h4>
<p>
You can start the YIFF Sound Server as the user with the lowest
permissions, YIFF only needs access to the devices and locations
specified in the <code>yiffrc</code> configuration file.
</p>
<p>To start the YIFF Sound Server, just type (modify paths as needed):
<ul><li><code>
/usr/sbin/yiff /usr/etc/yiffrc
</code></ul>
The above command should have started
the YIFF Sound Server and print any warnings or errors encountered.
Some typical errors you might encounter are:
<ul>
 <li><code>/usr/etc/yiffrc: No such file.</code> This means that the
path to the configuration file is incorrect. Please specify the correct
path to the configuration file and make sure that
<code>/usr/sbin/yiff</code> has permission to check for its existance and
open it.
 <li>Cannot bind network listening port. The port number that
<code>/usr/sbin/yiff</code> listens to for incoming Y client connections
(default number is 9433) is already in user by another server or is not
allowed to be binded with the current permissions on
<code>/usr/sbin/yiff</code>. You may need to increase the permissions on
<code>/usr/sbin/yiff</code> or reduce the permissions on (give access
to) the network port number in question.
 <li><code>/dev/dsp: Cannot open for playing.</code> This may indicate
another non-Y compliant sound application is already trying to use the
digital sound processor device, check if any other programs are currently
running (type <code>ps aux</code>) that might be using
<code>/dev/dsp</code>. Also check if the sound driver is installed and
loaded properly (type <code>modprobe sound</code>).
</ul>
</p>

<p>
Note that the YIFF Sound Server will automatically run in the background,
if however you want to run YIFF in the foreground then add
<code>--foreground</code> to the command, for example:
<ul><li><code>
/usr/sbin/yiff /usr/etc/yiffrc --foreground
</code></ul>
To get a list of command line arguments for YIFF, type:
<ul><li><code>
/usr/sbin/yiff --help
</code></ul>
You can type the above regardless if YIFF running or not.
</p>
<p>
To formally start YIFF you should run:
<ul><li><code>
/usr/sbin/starty
</code></ul>
This is a script file that calls YIFF and sets up additional resources
(such as <i>yhosts</i>). You are responsible for writing this script
file, but note if you configured YIFF using <code>yiffconfig</code>
you should have been given an option to allow <code>yiffconfig</code>
to create a <code>/usr/sbin/starty</code> start script for you.
</p>

<h4>Is the YIFF Sound Server running?</h4>
<p>
There are two ways to check that:
<ol>
 <li><code>ps aux|grep yiff</code>
 <li><code>yrecinfo</code>
</ol>
The first command will basically check the complete list of processes
and show you the line (if any) for the pid of the YIFF Sound Server.
The second line is a more Y specific way of checking,
<code>yrecinfo</code> will print the status of the YIFF Sound Server
if it was able to connect to it or an error message if it was not able
to connect. A typical successful output from <code>yrecinfo</code>
would look like:
</p>
<p><pre><code>
recorder: 127.0.0.1:9433
version: 2.11
cycle load: 3.4%
maximum protocol statement: 30000 bytes
cycle set: 2
cycle: 30959 microseconds
compensated cycle: 30959 microseconds
write ahead: 46438 microseconds
cumulative latency: 0 microseconds
sample rate: 11025 Hz
channels: 1
sample size: 8 bits
bytes per second: 11025 bytes
allow sound buffer fragments: yes
sound buffer fragments: 2
sound buffer size: 512 bytes
flip stereo: no
direction: 0
</code></pre></p>

<p>
By default <code>yrecinfo</code> connects to port 9433 on the
computer it is running on, to specify an particular address and port,
type:
<ul><li><code>
yrecinfo --recorder 127.0.0.1:9433
</code></ul>
The above is the same as running <code>yrecinfo</code> without any
arguments but as you can see, you can get a different address by simply
changing <code>127.0.0.1</code> to a different address.
For a different port just change <code>9433</code> to the port number
you want. You should note that all Y compliant applications will handle
the <code>--recorder &lt;address&gt;:&lt;port&gt;</code> argument.
As always to get a full list of arguments available, run with the
argument <code>--help</code>, for example:
<ul><li><code>
yrecinfo --help
</code></ul>
</p>

<h4>Playing something</h4>
<p>If everything looks good so far, then its time to check if the YIFF
Sound Server can play something. Select a reasonably lengthed (1 MB or so)
wav, voc, or raw sound file and type:
<ul><li><code>
yplay -v -m /home/me/mysound.wav
</code></ul>
Replace <code>/home/me/mysound.wav</code> with the <u>full path</u> to
the sound file in question. Remember that if you pass a relative path,
the file will be searched through the Y Sound Paths list and if it is
not found <code>yplay</code> will return stating an error (the current
working directory is not checked). The <code>-v</code> and <code>-m</code>
arguments specify verbose and automatically change Audio values as needed
(respectivly). Typically the <code>-m</code> argument is discuraged
because changing the Audio mode as needed will cause any other Y client
application's sound objects to be killed. You can press
<code>ctrl+c</code> at any time during <code>yplay</code>'s playback
to stop it.
</p>
<p>
Next try and see if you can play a MIDI sound object, it's the same
procedure with <code>yplay</code> except that you tell it to play a midi 
file, for example:
<ul><li><code>
yplay -v -m /home/me/mysound.mid
</code></ul>
This might produce an error if your MIDI player program is not set up
properly. Run <code>yiffconfig</code> or edit <code>/usr/etc/yiffrc</code>
to change the <code>MIDIPlayCommand</code> parameter as needed.
</p>

<h4>Changing the Y Audio Mode manually</h4>
<p>
You can easilly switch preset Y Audio Modes or set specific Audio modes
using <code>yset</code>. This is a very powerful command, as it allows
you to manipulate many aspects of the YIFF Sound Server at run time.
For example, to switch preset Y Audio Modes first type:
<ul><li><code>
yrecinfo --modes
</code></ul>
This will print the YIFF Sound server status and a list of available Y Audio
Modes. Make note of a particular Y Audio Mode name you like to switch to
and type:
<ul><li><code>
yset audio PlayStereo11025
</code></ul>
Replace <code>PlayStereo11025</code> with the Y Audio Mode you want to
switch to (make sure it appeared in the <code>yrecinfo</code> list).
You may hear a 'click' as the Audio values are updated.
</p>
<p>
There are many options to <code>yset</code>, again to get a list of
arguments type:
<ul><li><code>
yset --help
</code></ul>
</p>

<h4>Shell out</h4>
<p>
One additional feature that should be pointed out at this time is that the
YIFF Sound
Server can <i>shell out</i>, what this means is that the YIFF Sound Server
will continue to; run normally, handle Y client connections, and play
sound... or so it seems. What its really doing is everything except play
sound. It will still communicate with the Y client programs connected to
it and 'lie' to them when they request to play a sound (it will
pretend its playing the sound but not actually play it). This is similar
in principal as a GUI switching to full screen mode to allow a non-GUI
program to run (old MS-Windows users should know what we mean here).
So basically YIFF will stop using the digital sound processor device
specified by the configuration parameter <code>DSPDevice</code> so other
non-Y applications can use it. So to shell out type:
<ul><li><code>
yset shellout
</code></ul>
You should get a message indicating the Y server has been shelled out, now
type:
<ul><li><code>
yplay -v /home/me/mysound.wav
</code></ul>
Do <b>not</b> specify the <code>-m</code> argument above (you'll see why
in a moment). When you press enter you will see that it appears the sound
is playing normally but you will hear nothing comming from the speakers.
Now press <code>ctrl+c</code> and type:
<ul><li><code>
yset audio default
</code></ul>
Any preset Y Audio Mode or Audio values will do, this will unshell and
bring YIFF back to running normally (make sure no other non-Y applications
are ysing the digital sound processor device when you type this). To
conferm that sound is back, type:
<ul><li><code>
yplay -v /home/me/mysound.wav
</code></ul>
Note that if you had specified <code>-m</code> to <code>yplay</code>, it
would have changed the Audio and thus unshell.
</p>

<h4>Mixers</h4>
<p>One thing that <code>yset</code> cannot manipulate are the Y mixers.
This is where a new command called <code>ymixer</code> is used, note that
not all sound cards have mixers and if even so not all mixer channels
exist (maybe not even <code>vol</code>, so double check your sound card
manual first before continuing on in this section).
</p>
<p>First to get a list of all Y mixers, just type:
<ul><li><code>
ymixer
</code></ul>
You should get a list of mixer channel names and their respective values
in percent.
</p>
<p>
To set a specific Y mixer value type:
<ul><li><code>
ymixer vol 70 40
</code></ul>
This will set the mixer <code>vol</code> to left channel 70 percent
and right channel 40 percent. To verify type:
<ul><li><code>
ymixer vol
</code></ul>
You may notice a slight different in output value as the YIFF server
adjusts to the internal values.
</p>
<p>
Note that the mixer device is specified in the
<code>yiffrc</code> configuration file by the parameter
<code>MixerDevice</code>. You can set this parameter's value to nothing
to indicate you have no mixer.
</p>
<p>
Your Y mixer settings are stored in a file in your home directory
called <code>.YMixerSettings</code> this file is automatically loaded
when you run the YIFF Sound Server and rewritten when you shut down the
YIFF Sound Server.
</p>

<h4>Allowing foreign Y clients</h4>
<p>Since Y Sound Systems is a network transparent system, it allows
Y clients from other computers to connect to the Y server, but not unless
you say so.
</p><p>
To allow a Y client on another computer to connect to a YIFF Sound Server
currently running on your computer type (on your comptuer):
<ul><li><code>
yhost wolfpack.twu.net
</code></ul>
This will add the host <code>wolfpack.twu.net</code> IP address to the
list of foreign yhosts (ip addresses) allowed to connect to the YIFF
Sound Server on your computer. Note that its better to specify an IP
address as it is more precise in security, for example:
<ul><li><code>
yhost 123.45.67.89
</code></ul>
To remove an address type:
<ul><li><code>
yhost - 123.45.67.89
</code></ul>
Note the <code>-</code> character which specifies to remove the address
from the allowed list of addresses.
</p>

<p>
Remember that changes you make using <code>yhost</code> are not
permanent, they will be gone once you shut down your YIFF Sound Server. So
to preserve changes you should add the <code>yhost</code> to your
<code>starty</code> script.
</p>

<p><font color=ff0000> Beware, allowing programs from other computers to
control YIFF will allow them to do bad things, such as shutting down YIFF
or having it play a million sound objects at once. <b>Only</b> specify
<code>yhost</code> addresses of computers <u>you trust</u>! </font></p>

<h4>Shutting down the YIFF Sound Server</h4>
<p>To shut down the YIFF Sound Server type:
<ul><li><code>
yshutdown
</code></ul>
This will have YIFF stop all sound objects being played, destroy all sound
objects, close connections to any Y client applications
currently connected and then shut down.
</p>

<h6>
Back to the <a href="#top">top</a>.
</h6>
</left>


<left>
<img src="hr1.gif" width=95% height=32>
<a name="s6">
<h2>Y server run on demand rules</h2>
<p>
These are the rules for the conditions in when the YIFF Sound 
Server is started and shutdown (automatically) by Y client programs: 
<ol>
 <li>If a program wants to connect to the YIFF server, first that program
attempts a connect, if it is unable to connect then it attempts to start
the YIFF server (and makes note that it started YIFF) and attempts to
connect again.
 <li>If a program is currently connected to YIFF and wants to disconnect,
first it recalls if it started YIFF, if it did, it will shutdown YIFF,
otherwise it will just disconnect from YIFF.
</ol>
Remember, you can always shut down the Y server at any time using
<code>yshutdown</code>.
</p>

<p>You can also send a 
<code>kill -s INT &lt;pid&gt;</code> to the YIFF Sound Server, it will
recieve that signal and shutdown normally.
</p>

<p>
YIFF also responds to the HUP signal, type
<code>kill -s HUP &lt;pid&gt;</code>
YIFF reload its configuration and reset its resources. Warning,
this may disconnect any Y client programs currently connected.
</p>


<h4>Where to go from here?</h4>
<p>
Once you have everything set up you may want to take a look at the
<a href="links.html">links</a> to other neat and wonderful Y applications.
</p>


<h6>
Back to the <a href="#top">top</a>.
</h6>
</left>


</body>
</html>