| 1 |
\input texinfo @c -*-texinfo-*- |
| 2 |
@c %**start of header |
| 3 |
@setfilename RPTP.info |
| 4 |
@settitle The RPTP Protocol |
| 5 |
@defindex ev |
| 6 |
@iftex |
| 7 |
@finalout |
| 8 |
@end iftex |
| 9 |
@setchapternewpage odd |
| 10 |
@c %**end of header |
| 11 |
|
| 12 |
@ifinfo |
| 13 |
|
| 14 |
This file documents RPTP protocol. |
| 15 |
|
| 16 |
Copyright (C) 1995 Mark Boyns |
| 17 |
|
| 18 |
Permission is granted to make and distribute verbatim copies of |
| 19 |
this manual provided the copyright notice and this permission notice |
| 20 |
are preserved on all copies. |
| 21 |
|
| 22 |
@ignore |
| 23 |
Permission is granted to process this file through Tex and print the |
| 24 |
results, provided the printed document carries copying permission |
| 25 |
notice identical to this one except for the removal of this paragraph |
| 26 |
(this paragraph not being relevant to the printed manual). |
| 27 |
|
| 28 |
@end ignore |
| 29 |
Permission is granted to copy and distribute modified versions of this |
| 30 |
manual under the conditions for verbatim copying, provided also that the |
| 31 |
entire resulting derived work is distributed under the terms of a |
| 32 |
permission notice identical to this one. |
| 33 |
|
| 34 |
Permission is granted to copy and distribute translations of this manual |
| 35 |
into another language, under the above conditions for modified versions. |
| 36 |
@end ifinfo |
| 37 |
|
| 38 |
@titlepage |
| 39 |
@title The RPTP Protocol |
| 40 |
|
| 41 |
@author by Mark Boyns |
| 42 |
@page |
| 43 |
@vskip 0pt plus 1filll |
| 44 |
Copyright @copyright{} 1995 Mark Boyns |
| 45 |
|
| 46 |
Permission is granted to make and distribute verbatim copies of |
| 47 |
this manual provided the copyright notice and this permission notice |
| 48 |
are preserved on all copies. |
| 49 |
|
| 50 |
Permission is granted to copy and distribute modified versions of this |
| 51 |
manual under the conditions for verbatim copying, provided that the |
| 52 |
entire resulting derived work is distributed under the terms of a |
| 53 |
permission notice identical to this one. |
| 54 |
|
| 55 |
Permission is granted to copy and distribute translations of this manual |
| 56 |
into another language, under the above conditions for modified versions. |
| 57 |
|
| 58 |
@end titlepage |
| 59 |
@page |
| 60 |
|
| 61 |
@node Top, Overview, (dir), (dir) |
| 62 |
@top RPTP |
| 63 |
|
| 64 |
This document describes the Remote Play Transfer Protocol, otherwise |
| 65 |
known as RPTP. |
| 66 |
|
| 67 |
@menu |
| 68 |
* Overview:: |
| 69 |
* Attributes:: |
| 70 |
* Events:: |
| 71 |
* Event Notification:: |
| 72 |
* Commands:: |
| 73 |
* Connecting:: |
| 74 |
* Timeouts:: |
| 75 |
* Attribute Index:: Attribute Index. |
| 76 |
* Event Index:: Event Index. |
| 77 |
* Command Index:: Command Index. |
| 78 |
@end menu |
| 79 |
|
| 80 |
@node Overview, Attributes, Top, Top |
| 81 |
@chapter Overview |
| 82 |
|
| 83 |
RPTP is a command-based TCP interface to control the rplay audio server. |
| 84 |
The protocol is simple, the client sends a command and the server sends |
| 85 |
back a result. |
| 86 |
|
| 87 |
Name-value pairs are used in both commands and results. A name-value |
| 88 |
pair is of the form @samp{name=value} where @samp{name} is an attribute |
| 89 |
name and @samp{value} is the value of the attribute. Multiple |
| 90 |
name-value pairs on a line are separated by a spaces and/or tabs. When |
| 91 |
@samp{value} contains spaces or tabs it must be quoted as |
| 92 |
@samp{name="value"}. |
| 93 |
|
| 94 |
Commands consist of a command name followed by command attributes. An |
| 95 |
example would be @samp{play volume=50 sound=bogus.au}. In this case, |
| 96 |
the command is @samp{play} and its attributes are @samp{volume=50} and |
| 97 |
@samp{sound=bogus.au}. |
| 98 |
|
| 99 |
The server responds to each command with a result line. Each result |
| 100 |
line begins with a special character which is used to determine command |
| 101 |
success or failure. The following characaters are defined: |
| 102 |
|
| 103 |
@table @samp |
| 104 |
@item + |
| 105 |
Successful command execution (RPTP_OK) |
| 106 |
|
| 107 |
@item - |
| 108 |
Error (RPTP_ERROR) |
| 109 |
|
| 110 |
@item ! |
| 111 |
Connection timeout (RPTP_TIMEOUT) |
| 112 |
|
| 113 |
@item @@ |
| 114 |
Event notification (RPTP_NOTIFY) |
| 115 |
@end table |
| 116 |
|
| 117 |
After this first character, the result line contains name-value pairs. |
| 118 |
For example, if the server wanted to report an error to the client, |
| 119 |
the result line could be: @samp{-error="sorry, you can't do that"}. |
| 120 |
|
| 121 |
There is one RPTP command that returns more than one line. This is the |
| 122 |
list command which returns a normal result line followed by zero or more |
| 123 |
lines terminated by a line containing only a @samp{.}. These additional |
| 124 |
lines do not begin with any special characters. Future versions may |
| 125 |
include an attribute that clients can use to determine the number of |
| 126 |
lines that will be returned. |
| 127 |
|
| 128 |
All RPTP lines are terminated using a carriage return @samp{\r} (ASCII 13) |
| 129 |
followed by a newline @samp{\n} (ASCII 10). |
| 130 |
|
| 131 |
@node Attributes, Events, Overview, Top |
| 132 |
@chapter Attributes |
| 133 |
|
| 134 |
The following is a list of attributes that can be found within |
| 135 |
the name-value lists. |
| 136 |
|
| 137 |
@defvr Attribute access |
| 138 |
A set of characters defining access permissions. These characters can |
| 139 |
include @samp{r} - read access, @samp{w} - write access, and |
| 140 |
@samp{x} - execute access. |
| 141 |
|
| 142 |
Example: |
| 143 |
@example |
| 144 |
access=rwx |
| 145 |
@end example |
| 146 |
@end defvr |
| 147 |
|
| 148 |
@defvr Attribute application |
| 149 |
The name of an rplay application. |
| 150 |
|
| 151 |
Example: |
| 152 |
@example |
| 153 |
application="rptp 3.2.0a7" |
| 154 |
@end example |
| 155 |
@end defvr |
| 156 |
|
| 157 |
@defvr Attribute audio-bits |
| 158 |
The number of bits in an audio sample or audio device. |
| 159 |
The value can be 8, 16, and maybe 24 and 32 in the future. |
| 160 |
|
| 161 |
Example: |
| 162 |
@example |
| 163 |
audio-bits=16 |
| 164 |
@end example |
| 165 |
@end defvr |
| 166 |
|
| 167 |
@defvr Attribute audio-bufsize |
| 168 |
The size in bytes of the audio buffer. |
| 169 |
|
| 170 |
Example: |
| 171 |
@example |
| 172 |
audio-bufsize=1600 |
| 173 |
@end example |
| 174 |
@end defvr |
| 175 |
|
| 176 |
@defvr Attribute audio-byte-order |
| 177 |
The byte order of the audio data. The value can be either |
| 178 |
big-endian or little-endian. |
| 179 |
|
| 180 |
Example: |
| 181 |
@example |
| 182 |
audio-byte-order=big-endian |
| 183 |
@end example |
| 184 |
@end defvr |
| 185 |
|
| 186 |
@defvr Attribute audio-channels |
| 187 |
The number of channels in an audio sample or audio device. |
| 188 |
The value can be 1 or 2. |
| 189 |
|
| 190 |
Example: |
| 191 |
@example |
| 192 |
audio-channels=2 |
| 193 |
@end example |
| 194 |
@end defvr |
| 195 |
|
| 196 |
@defvr Attribute audio-device |
| 197 |
The name of an audio device. |
| 198 |
The value can be any audio device name. |
| 199 |
|
| 200 |
Example: |
| 201 |
@example |
| 202 |
audio-device=/dev/audio |
| 203 |
@end example |
| 204 |
@end defvr |
| 205 |
|
| 206 |
@defvr Attribute audio-format |
| 207 |
The format of an audio sample or audio device. |
| 208 |
The value can be ulaw, linear-8, ulinear-8, linear-16, or ulinear-16. |
| 209 |
(linear = signed, ulinear = unsigned) |
| 210 |
|
| 211 |
Example: |
| 212 |
@example |
| 213 |
audio-format=ulaw |
| 214 |
@end example |
| 215 |
@end defvr |
| 216 |
|
| 217 |
@defvr Attribute audio-offset |
| 218 |
Number of bytes to skip from the current position in the audio data. |
| 219 |
|
| 220 |
Example: |
| 221 |
@example |
| 222 |
audio-offset=32. |
| 223 |
@end example |
| 224 |
@end defvr |
| 225 |
|
| 226 |
@defvr Attribute audio-port |
| 227 |
Audio output ports. |
| 228 |
The value can be speaker, headphone, and lineout. |
| 229 |
Multiple ports should be separated using a comma. |
| 230 |
|
| 231 |
Example: |
| 232 |
@example |
| 233 |
audio-port=headphone,speaker |
| 234 |
@end example |
| 235 |
@end defvr |
| 236 |
|
| 237 |
@defvr Attribute audio-rate |
| 238 |
The rate at which audio buffers are being written. |
| 239 |
|
| 240 |
Example: |
| 241 |
@example |
| 242 |
audio-rate=10 |
| 243 |
@end example |
| 244 |
@end defvr |
| 245 |
|
| 246 |
@defvr Attribute audio-sample-rate |
| 247 |
The sample rate of an audio sample or audio device. |
| 248 |
|
| 249 |
Example: |
| 250 |
@example |
| 251 |
audio-sample-rate=11025 |
| 252 |
@end example |
| 253 |
@end defvr |
| 254 |
|
| 255 |
@defvr Attribute audio-volume |
| 256 |
The volume of an audio sample or audio device. |
| 257 |
The value can be an integer between 0 and 255. |
| 258 |
|
| 259 |
Example: |
| 260 |
@example |
| 261 |
audio-volume=120 |
| 262 |
@end example |
| 263 |
@end defvr |
| 264 |
|
| 265 |
@defvr Attribute bits |
| 266 |
See audio-bits. |
| 267 |
@end defvr |
| 268 |
|
| 269 |
@defvr Attribute channels |
| 270 |
See audio-channels. |
| 271 |
@end defvr |
| 272 |
|
| 273 |
@defvr Attribute count |
| 274 |
The number of times a sound will be played or |
| 275 |
a generic number of items. |
| 276 |
|
| 277 |
Example: |
| 278 |
@example |
| 279 |
count=5 |
| 280 |
@end example |
| 281 |
@end defvr |
| 282 |
|
| 283 |
@defvr Attribute event |
| 284 |
The name of an RPTP event. |
| 285 |
|
| 286 |
Example: |
| 287 |
@example |
| 288 |
event=play |
| 289 |
@end example |
| 290 |
@end defvr |
| 291 |
|
| 292 |
@defvr Attribute error |
| 293 |
An error message. |
| 294 |
|
| 295 |
Example: |
| 296 |
@example |
| 297 |
error="access denied" |
| 298 |
@end example |
| 299 |
@end defvr |
| 300 |
|
| 301 |
@defvr Attribute format |
| 302 |
See audio-format. |
| 303 |
@end defvr |
| 304 |
|
| 305 |
@defvr Attribute host |
| 306 |
A hostname. |
| 307 |
|
| 308 |
Example: |
| 309 |
@example |
| 310 |
host=mojo |
| 311 |
@end example |
| 312 |
@end defvr |
| 313 |
|
| 314 |
@defvr Attribute id |
| 315 |
A spool id. |
| 316 |
The value can be an integer between 0 and 999. A value of |
| 317 |
0 refers to all ids. An id always begins with the @samp{#} |
| 318 |
character since ids can be intermixed with sound names. |
| 319 |
Therefore, sounds can never begin with @samp{#}. |
| 320 |
|
| 321 |
Example: |
| 322 |
@example |
| 323 |
id=#219 |
| 324 |
@end example |
| 325 |
@end defvr |
| 326 |
|
| 327 |
@defvr Attribute idle |
| 328 |
The amount of time a RPTP connection has been idle. |
| 329 |
|
| 330 |
Example: |
| 331 |
@example |
| 332 |
idle=1+01:37:05 |
| 333 |
@end example |
| 334 |
@end defvr |
| 335 |
|
| 336 |
@defvr Attribute input |
| 337 |
Where audio is coming from. |
| 338 |
|
| 339 |
Example: |
| 340 |
@example |
| 341 |
input=flow |
| 342 |
@end example |
| 343 |
@end defvr |
| 344 |
|
| 345 |
@defvr Attribute input-bits |
| 346 |
See audio-bits. |
| 347 |
@end defvr |
| 348 |
|
| 349 |
@defvr Attribute input-byte-order |
| 350 |
See audio-byte-order. |
| 351 |
@end defvr |
| 352 |
|
| 353 |
@defvr Attribute input-channels |
| 354 |
See audio-channels. |
| 355 |
@end defvr |
| 356 |
|
| 357 |
@defvr Attribute input-format |
| 358 |
See audio-format. |
| 359 |
@end defvr |
| 360 |
|
| 361 |
@defvr Attribute input-offset |
| 362 |
See audio-offset. |
| 363 |
@end defvr |
| 364 |
|
| 365 |
@defvr Attribute input-sample-rate |
| 366 |
See audio-sample-rate. |
| 367 |
@end defvr |
| 368 |
|
| 369 |
@defvr Attribute left |
| 370 |
The output level of the left speaker. |
| 371 |
Valid levels range from 0 to 255. |
| 372 |
@end defvr |
| 373 |
|
| 374 |
@defvr Attribute list-count |
| 375 |
The number of times a list of sounds will be played. |
| 376 |
|
| 377 |
Example: |
| 378 |
@example |
| 379 |
list-count=5 |
| 380 |
@end example |
| 381 |
@end defvr |
| 382 |
|
| 383 |
@defvr Attribute message |
| 384 |
A generic message. |
| 385 |
|
| 386 |
Example: |
| 387 |
@example |
| 388 |
message="stop successful" |
| 389 |
@end example |
| 390 |
@end defvr |
| 391 |
|
| 392 |
@defvr Attribute notify |
| 393 |
A list of RPTP events. |
| 394 |
Multiple events should be separated using a comma. |
| 395 |
|
| 396 |
Example: |
| 397 |
@example |
| 398 |
notify=play,pause,done |
| 399 |
@end example |
| 400 |
@end defvr |
| 401 |
|
| 402 |
@defvr Attribute pause |
| 403 |
The number of sounds paused. |
| 404 |
|
| 405 |
Example: |
| 406 |
@example |
| 407 |
pause=1 |
| 408 |
@end example |
| 409 |
@end defvr |
| 410 |
|
| 411 |
@defvr Attribute play |
| 412 |
The number of sounds playing. |
| 413 |
|
| 414 |
Example: |
| 415 |
@example |
| 416 |
play=3 |
| 417 |
@end example |
| 418 |
@end defvr |
| 419 |
|
| 420 |
@defvr Attribute position |
| 421 |
The current second offset in a sound. |
| 422 |
@end defvr |
| 423 |
|
| 424 |
@defvr Attribute priority |
| 425 |
The priority of a sound. |
| 426 |
The value should be an integer between 0 and 255 where |
| 427 |
0 is the lowest priority and 255 is the highest. |
| 428 |
|
| 429 |
Example: |
| 430 |
@example |
| 431 |
priority=0 |
| 432 |
@end example |
| 433 |
@end defvr |
| 434 |
|
| 435 |
@defvr Attribute random |
| 436 |
Play a random sound from a list of sounds. |
| 437 |
|
| 438 |
Example: |
| 439 |
@example |
| 440 |
random=true |
| 441 |
@end example |
| 442 |
@end defvr |
| 443 |
|
| 444 |
@defvr Attribute remain |
| 445 |
Number of seconds remaining in a sound. |
| 446 |
@end defvr |
| 447 |
|
| 448 |
@defvr Attribute right |
| 449 |
The output level of the right speaker. |
| 450 |
Valid levels range from 0 to 255. |
| 451 |
@end defvr |
| 452 |
|
| 453 |
@defvr Attribute sample |
| 454 |
The current sample offset in a sound. |
| 455 |
@end defvr |
| 456 |
|
| 457 |
@defvr Attribute samples |
| 458 |
The total number of samples in a sound. |
| 459 |
@end defvr |
| 460 |
|
| 461 |
@defvr Attribute sample-rate |
| 462 |
See audio-sample-rate. |
| 463 |
@end defvr |
| 464 |
|
| 465 |
@defvr Attribute seconds |
| 466 |
Number of seconds in a sound. |
| 467 |
|
| 468 |
Example: |
| 469 |
@example |
| 470 |
seconds=247.54 |
| 471 |
@end example |
| 472 |
@end defvr |
| 473 |
|
| 474 |
@defvr Attribute size |
| 475 |
The number of bytes in an audio file. |
| 476 |
|
| 477 |
Example: |
| 478 |
@example |
| 479 |
size=1868508 |
| 480 |
@end example |
| 481 |
@end defvr |
| 482 |
|
| 483 |
@defvr Attribute sound |
| 484 |
The name of a sound. |
| 485 |
|
| 486 |
Example: |
| 487 |
@example |
| 488 |
sound=petergun.au |
| 489 |
@end example |
| 490 |
@end defvr |
| 491 |
|
| 492 |
@defvr Attribute uptime |
| 493 |
The amount of time an RPTP server has been running. |
| 494 |
|
| 495 |
Example: |
| 496 |
@example |
| 497 |
uptime=27+09:19:10 |
| 498 |
@end example |
| 499 |
@end defvr |
| 500 |
|
| 501 |
@defvr Attribute version |
| 502 |
The version of rplay. |
| 503 |
|
| 504 |
Example: |
| 505 |
@example |
| 506 |
version=3.2.0a8 |
| 507 |
@end example |
| 508 |
@end defvr |
| 509 |
|
| 510 |
@defvr Attribute volume |
| 511 |
See audio-volume. |
| 512 |
@end defvr |
| 513 |
|
| 514 |
@node Events, Event Notification, Attributes, Top |
| 515 |
@chapter Events |
| 516 |
|
| 517 |
RPTP supports both synchronous and asynchronous event notification. |
| 518 |
Events can be use to monitor the status of the server or wait for |
| 519 |
something special to happen. These events are: |
| 520 |
|
| 521 |
@table @code |
| 522 |
@item all |
| 523 |
@evindex all |
| 524 |
All events. |
| 525 |
|
| 526 |
@item any |
| 527 |
@evindex any |
| 528 |
See all. |
| 529 |
|
| 530 |
@item continue |
| 531 |
@evindex continue |
| 532 |
A sound has been continued. |
| 533 |
|
| 534 |
@item done |
| 535 |
@evindex done |
| 536 |
A sound is finished. |
| 537 |
|
| 538 |
@item level |
| 539 |
@evindex level |
| 540 |
Used to obtain the output level of the left and right speakers. |
| 541 |
Level values range from 0 to 255. |
| 542 |
|
| 543 |
@item none |
| 544 |
@evindex none |
| 545 |
No events. |
| 546 |
|
| 547 |
@item pause |
| 548 |
@evindex pause |
| 549 |
A sound has been paused. |
| 550 |
|
| 551 |
@item play |
| 552 |
@evindex play |
| 553 |
A sound has been played. |
| 554 |
|
| 555 |
@item position |
| 556 |
@evindex position |
| 557 |
Used to obtain the current sample position of a sound that's being |
| 558 |
played. |
| 559 |
|
| 560 |
@item skip |
| 561 |
@evindex skip |
| 562 |
A sound has been skipped. |
| 563 |
|
| 564 |
@item state |
| 565 |
@evindex state |
| 566 |
A server state change. |
| 567 |
|
| 568 |
@item stop |
| 569 |
@evindex stop |
| 570 |
A sound has been stopped. |
| 571 |
|
| 572 |
@item volume |
| 573 |
@evindex volume |
| 574 |
The volume has changed. |
| 575 |
@end table |
| 576 |
|
| 577 |
@node Event Notification, Commands, Events, Top |
| 578 |
@chapter Event Notification |
| 579 |
|
| 580 |
RPTP clients can receive event notification messages from the server. |
| 581 |
The event notification messages sent by the server always begin with the |
| 582 |
@samp{@@} character followed by a list of attributes. This character is |
| 583 |
used to help RPTP clients distinguish notification messages from other |
| 584 |
RPTP responses. Using a special character is especially useful for |
| 585 |
clients that deal with server messages asychronously. |
| 586 |
|
| 587 |
Each message will always contain an event attribute to inform the client |
| 588 |
which event occurred. The message can also contain several other |
| 589 |
attributes to provide the client with more event information. |
| 590 |
|
| 591 |
The following is a list of sample event messages: |
| 592 |
@table @code |
| 593 |
|
| 594 |
@item continue |
| 595 |
Example: |
| 596 |
@example |
| 597 |
@@event=continue id=#160 sound=bogus.au |
| 598 |
@end example |
| 599 |
|
| 600 |
@item done |
| 601 |
Example: |
| 602 |
@example |
| 603 |
@@event=done id=#23 sound=bogus.au |
| 604 |
@end example |
| 605 |
|
| 606 |
@item level |
| 607 |
Example: |
| 608 |
@example |
| 609 |
@@event=level volume=46 left=23 right=23 |
| 610 |
@end example |
| 611 |
|
| 612 |
@item pause |
| 613 |
Example: |
| 614 |
@example |
| 615 |
@@event=pause id=#160 sound=bogus.au |
| 616 |
@end example |
| 617 |
|
| 618 |
@item play |
| 619 |
Example: |
| 620 |
@example |
| 621 |
@@event=play id=#160 sound=bogus.au volume=127 sample-rate=8000 seconds=1.19 count=1 |
| 622 |
@end example |
| 623 |
|
| 624 |
@item position |
| 625 |
Example: |
| 626 |
@example |
| 627 |
@@event=position id=#24 position=0.50 remain=0.69 seconds=1.19 sample=4000 samples=9542 |
| 628 |
@end example |
| 629 |
|
| 630 |
@item skip |
| 631 |
Example: |
| 632 |
@example |
| 633 |
@@event=skip id=#160 sound=bogus.au |
| 634 |
@end example |
| 635 |
|
| 636 |
@item state |
| 637 |
Example: |
| 638 |
@example |
| 639 |
@@event=state play=1 pause=1 volume=120 |
| 640 |
@end example |
| 641 |
|
| 642 |
@item stop |
| 643 |
Example: |
| 644 |
@example |
| 645 |
@@event=stop id=#160 sound=bogus.au |
| 646 |
@end example |
| 647 |
|
| 648 |
@item volume |
| 649 |
Example: |
| 650 |
@example |
| 651 |
@@event=volume volume=200 |
| 652 |
@end example |
| 653 |
@end table |
| 654 |
|
| 655 |
Notification messages can be enabled and disabled using the @code{set} |
| 656 |
command. For example, @samp{set notify=play,pause} tells the server to |
| 657 |
send notification messages when sounds are played or paused. |
| 658 |
|
| 659 |
For fun you might try connecting to your rplay server with telnet and |
| 660 |
monitor its events in real-time. This can be done using the following: |
| 661 |
|
| 662 |
@noindent |
| 663 |
@example |
| 664 |
$ telnet somehost.sdsu.edu 5556 |
| 665 |
@end example |
| 666 |
|
| 667 |
Once connected, type @samp{set notify=all} and you will receive |
| 668 |
notification for all server events. |
| 669 |
|
| 670 |
@node Commands, Connecting, Event Notification, Top |
| 671 |
@chapter Commands |
| 672 |
|
| 673 |
Clients use commands to interact with the server. All commands will |
| 674 |
return errors using a result line beginning with @samp{-}. This line |
| 675 |
will always contain the @code{error} attribute which contains a text |
| 676 |
error message. An example error response would be: |
| 677 |
@samp{-error="access denied"}. |
| 678 |
|
| 679 |
The follow is a list of all the RPTP commands. Almost all commands |
| 680 |
accept attributes which can be specified in any order. More commands |
| 681 |
and command attributes can and probably will be added in the future. |
| 682 |
|
| 683 |
@deffn Command access |
| 684 |
Obtain client access permissions. |
| 685 |
|
| 686 |
This command returns one line containing the @code{access} attribute. |
| 687 |
@end deffn |
| 688 |
|
| 689 |
@deffn Command application @var{name} |
| 690 |
Set the name of the client application. |
| 691 |
|
| 692 |
This command returns one line containing the @code{name} of the application. |
| 693 |
|
| 694 |
Example: |
| 695 |
@example |
| 696 |
application Xrplay 2.0 |
| 697 |
+Xrplay 2.0 |
| 698 |
@end example |
| 699 |
|
| 700 |
@strong{Caution:} This command is considered obsolete and may be removed |
| 701 |
in the future. Please use the @code{set} command instead. |
| 702 |
@end deffn |
| 703 |
|
| 704 |
@deffn Command continue @var{id}|@var{sound} ... |
| 705 |
Continue playing a paused sound. |
| 706 |
|
| 707 |
This command returns one line containing the @code{message} attribute. |
| 708 |
|
| 709 |
Example: |
| 710 |
@example |
| 711 |
continue sound=bogus.au |
| 712 |
+message="continue successful" |
| 713 |
@end example |
| 714 |
@end deffn |
| 715 |
|
| 716 |
@deffn Command done @var{id}|@var{sound} ... |
| 717 |
Force a playing or paused sound to be done. In most cases this is the |
| 718 |
same as stop. |
| 719 |
|
| 720 |
This command returns one line containing the @code{message} attribute. |
| 721 |
|
| 722 |
Example: |
| 723 |
@example |
| 724 |
done sound=bogus.au |
| 725 |
message="done successful" |
| 726 |
@end example |
| 727 |
@end deffn |
| 728 |
|
| 729 |
@deffn Command find @var{sound} |
| 730 |
Search for a sound. |
| 731 |
|
| 732 |
This command returns one line containing the @code{sound} and @code{size} |
| 733 |
attributes. |
| 734 |
|
| 735 |
Example: |
| 736 |
@example |
| 737 |
find sound=bogus.au |
| 738 |
+sound=bogus.au size=9574 |
| 739 |
@end example |
| 740 |
@end deffn |
| 741 |
|
| 742 |
@deffn Command get @var{sound} |
| 743 |
Retrieve a sound. |
| 744 |
|
| 745 |
This command returns one line containing the @code{sound} and @code{size} |
| 746 |
attributes followed by @code{size} bytes of audio data. |
| 747 |
|
| 748 |
Example: |
| 749 |
@example |
| 750 |
get sound=bogus.au |
| 751 |
+sound=bogus.au size=9574 |
| 752 |
... 9574 bytes of audio data ... |
| 753 |
@end example |
| 754 |
@end deffn |
| 755 |
|
| 756 |
@deffn Command help |
| 757 |
Obtain a list of server-supported commands. |
| 758 |
@end deffn |
| 759 |
|
| 760 |
@deffn Command info @var{sound} |
| 761 |
Obtain information about a sound. |
| 762 |
|
| 763 |
This command returns one line containing information about the sound. |
| 764 |
The following attributes may be included: @code{sound}, @code{size}, |
| 765 |
@code{bits}, @code{sample-rate}, and @code{channels}. |
| 766 |
|
| 767 |
Example: |
| 768 |
@example |
| 769 |
info sound=bogus.au |
| 770 |
+sound=bogus.au size=9574 bits=8 sample-rate=8000 channels=1 |
| 771 |
@end example |
| 772 |
@end deffn |
| 773 |
|
| 774 |
@deffn Command list [connections|hosts|servers|spool|sounds] |
| 775 |
List the specified server information. |
| 776 |
|
| 777 |
@table @code |
| 778 |
@item connections |
| 779 |
the server's RPTP connections |
| 780 |
|
| 781 |
@item hosts |
| 782 |
the server's rplay.hosts. |
| 783 |
|
| 784 |
@item servers |
| 785 |
the server's rplay.servers. |
| 786 |
|
| 787 |
@item spool |
| 788 |
the server's audio spool. |
| 789 |
|
| 790 |
@item sounds |
| 791 |
the server's rplay.conf and rplay.cache. |
| 792 |
@end table |
| 793 |
|
| 794 |
This command returns one line containing the @code{message} attribute |
| 795 |
followed by zero or more lines terminated by a line containing only |
| 796 |
a @samp{.}. |
| 797 |
|
| 798 |
Example: |
| 799 |
@example |
| 800 |
list connections |
| 801 |
+message="connections" |
| 802 |
host=130.191.225.64 type=client what=idle |
| 803 |
host=127.0.0.1 type=client what="notify 00000080" idle=.06 application="Xrplay 2.0" |
| 804 |
. |
| 805 |
|
| 806 |
list hosts |
| 807 |
+message="hosts" |
| 808 |
host=mojo access=rwx |
| 809 |
host=127.0.0.1 access=rwx |
| 810 |
. |
| 811 |
|
| 812 |
list servers |
| 813 |
+message="servers" |
| 814 |
host=hercules.sdsu.edu port=5556 |
| 815 |
host=pandora.sdsu.edu port=5556 |
| 816 |
. |
| 817 |
|
| 818 |
list spool |
| 819 |
+message="spool" |
| 820 |
id=#437 state=play sound=petergun host=130.191.225.64 volume=127 \backslash |
| 821 |
priority=0 count=1 seconds=227.75 sample_rate=8000 |
| 822 |
. |
| 823 |
|
| 824 |
list sounds |
| 825 |
+message="sounds" |
| 826 |
sound=monster2.au |
| 827 |
sound=monster1.au |
| 828 |
sound=monkey-3.au |
| 829 |
sound=monkey-2.au |
| 830 |
sound=monkey-1.au |
| 831 |
. |
| 832 |
@end example |
| 833 |
|
| 834 |
@strong{Caution:} This command does not use name-value pairs as |
| 835 |
arguments. |
| 836 |
@end deffn |
| 837 |
|
| 838 |
@deffn Command pause @var{id}|@var{sound} |
| 839 |
Pause a playing sound. |
| 840 |
|
| 841 |
This command returns one line containing the @code{message} attribute. |
| 842 |
|
| 843 |
Example: |
| 844 |
@example |
| 845 |
pause sound=bogus.au |
| 846 |
+message="pause successful" |
| 847 |
@end example |
| 848 |
@end deffn |
| 849 |
|
| 850 |
@deffn Command play |
| 851 |
Play a sound. |
| 852 |
|
| 853 |
This command accepts several attribute arguments, but only the |
| 854 |
@code{sound} attribute is required and it may be repeated to play a list |
| 855 |
of sounds sequentially. |
| 856 |
|
| 857 |
The @code{sound} attribute can be preceded by any of the following |
| 858 |
attributes: |
| 859 |
@table @code |
| 860 |
@item count |
| 861 |
@item list-count |
| 862 |
@item priority |
| 863 |
@item random |
| 864 |
@item sample-rate |
| 865 |
@item volume |
| 866 |
@item input |
| 867 |
@item input-bits |
| 868 |
@item input-byte-order |
| 869 |
@item input-channels |
| 870 |
@item input-format |
| 871 |
@item input-offset |
| 872 |
@item input-sample-rate |
| 873 |
@end table |
| 874 |
|
| 875 |
This command returns one line containing the @code{id} attribute. |
| 876 |
|
| 877 |
Example: |
| 878 |
@example |
| 879 |
play sample-rate=4000 priority=255 sound=Debbie |
| 880 |
+id=#84 |
| 881 |
@end example |
| 882 |
@end deffn |
| 883 |
|
| 884 |
@deffn Command put @var{id}|@var{size} |
| 885 |
Give the server an entire sound or send flow data to a particular spool |
| 886 |
id. |
| 887 |
|
| 888 |
This command returns one line containing the @code{sound} or @code{id} |
| 889 |
and @code{size} attributes. After this line is received by the client, |
| 890 |
the server assumes the client will then send @code{size} bytes of audio |
| 891 |
data. If the specified spool id doesn't exist, the server will return |
| 892 |
an error. |
| 893 |
|
| 894 |
Example: |
| 895 |
@example |
| 896 |
put sound=bogus.au size=9574 |
| 897 |
+sound=bogus.au size=9574 |
| 898 |
|
| 899 |
or |
| 900 |
|
| 901 |
put id=#200 size=8000 |
| 902 |
+id=#200 size=8000 |
| 903 |
@end example |
| 904 |
@end deffn |
| 905 |
|
| 906 |
@deffn Command quit |
| 907 |
Terminate the RPTP session. |
| 908 |
|
| 909 |
This command returns nothing, the server simply closes the connection. |
| 910 |
@end deffn |
| 911 |
|
| 912 |
|
| 913 |
@deffn Command reset |
| 914 |
Tell the server to reset itself. A reset usually includes re-reading |
| 915 |
all configuration files, closing all connections, and removing all |
| 916 |
sounds from the spool. |
| 917 |
|
| 918 |
If possible, the server will return one line containing the @code{message} |
| 919 |
attribute. The server will probably close the connect so the line may |
| 920 |
not be sent. |
| 921 |
@end deffn |
| 922 |
|
| 923 |
@deffn Command set name[=value] ... |
| 924 |
Get and set server attributes. The current set of supported |
| 925 |
server attributes is: |
| 926 |
@table @code |
| 927 |
@item application |
| 928 |
@item level-notify-rate |
| 929 |
@item notify |
| 930 |
@item notify-rate |
| 931 |
@item position-notify-rate |
| 932 |
@item priority-threshold |
| 933 |
@item volume |
| 934 |
@end table |
| 935 |
|
| 936 |
This command returns one line containing the server's values for the |
| 937 |
specified attributes. If an attribute cannot be set, the server will |
| 938 |
return a value of @code{-1} for that attribute. |
| 939 |
|
| 940 |
Example: |
| 941 |
@example |
| 942 |
set application="Xrplay 2.0" notify=state volume=127 |
| 943 |
+application="Xrplay 2.0" notify=state volume=127 |
| 944 |
|
| 945 |
or |
| 946 |
|
| 947 |
set volume |
| 948 |
+volume=127 |
| 949 |
@end example |
| 950 |
|
| 951 |
@strong{Caution:} This command does not use name-value pairs to "get" |
| 952 |
the value of attributes. |
| 953 |
@end deffn |
| 954 |
|
| 955 |
@deffn Command skip @var{id}|@var{count} |
| 956 |
Skip around to sounds in a sound list. The sound list must be |
| 957 |
referenced by @var{id}. The number of sounds to skip (@var{count}) can |
| 958 |
be negative (skip backwards), zero (skip to the beginning of the current |
| 959 |
sound), or positive (skip forward). Skipping before the beginning of |
| 960 |
the sound list will cause the first sound to be played. Skipping after |
| 961 |
the last sound will terminate the spool entry. Skipping a paused sound |
| 962 |
will cause the next sound (the skipee?) to also be paused. |
| 963 |
|
| 964 |
This command returns one line containing the @code{message} attribute. |
| 965 |
|
| 966 |
Example: |
| 967 |
@example |
| 968 |
skip id=#0 count=1 |
| 969 |
+message="skipped" |
| 970 |
@end example |
| 971 |
@end deffn |
| 972 |
|
| 973 |
@deffn Command status |
| 974 |
Obtain a server's current status. |
| 975 |
|
| 976 |
This command returns one line containing several attributes. |
| 977 |
|
| 978 |
Example: |
| 979 |
@example |
| 980 |
status |
| 981 |
+host=mojo version=3.2.0a8 uptime=01:32 audio-bits=8 audio-bufsize=800 \ |
| 982 |
audio-channels=1 audio-device=/dev/audio audio-format=ulaw \ |
| 983 |
audio-port=speaker audio-rate=10 audio-sample-rate=8000 volume=127 \ |
| 984 |
curr-bufsize=800 curr-rate=10 |
| 985 |
@end example |
| 986 |
@end deffn |
| 987 |
|
| 988 |
@deffn Command stop @var{id}|@var{sound} ... |
| 989 |
Stop a paused or playing sound. |
| 990 |
|
| 991 |
This command returns one line containing the @code{message} attribute. |
| 992 |
|
| 993 |
Example: |
| 994 |
@example |
| 995 |
stop sound=bogus.au |
| 996 |
+message="stop successful" |
| 997 |
@end example |
| 998 |
@end deffn |
| 999 |
|
| 1000 |
@deffn Command version |
| 1001 |
Obtain the version number of the server. |
| 1002 |
|
| 1003 |
This command returns one line containing the @code{version} attribute. |
| 1004 |
|
| 1005 |
Example: |
| 1006 |
@example |
| 1007 |
version |
| 1008 |
+version=3.2.0a8 |
| 1009 |
@end example |
| 1010 |
@end deffn |
| 1011 |
|
| 1012 |
@deffn Command volume [@var{new-volume}] |
| 1013 |
Get and set the volume of the audio device. |
| 1014 |
|
| 1015 |
This command returns one line containing the volume of the audio device. |
| 1016 |
@end deffn |
| 1017 |
|
| 1018 |
@deffn Command wait @var{id}|@var{event}|@var{command} |
| 1019 |
Wait for a spool id, an event, or wait for the completion of a RPTP |
| 1020 |
command. |
| 1021 |
|
| 1022 |
This comand returns one line that always contains the event attribute. |
| 1023 |
Other attributes may also be included to provide more event information. |
| 1024 |
|
| 1025 |
Example: |
| 1026 |
@example |
| 1027 |
wait play sound=bogus |
| 1028 |
+event=done id=#267 sound=bogus.au |
| 1029 |
|
| 1030 |
or |
| 1031 |
|
| 1032 |
wait event=volume |
| 1033 |
+event=volume volume=135 |
| 1034 |
|
| 1035 |
or |
| 1036 |
|
| 1037 |
wait id=#300 |
| 1038 |
+event=done id=#300 sound=tap2.au |
| 1039 |
|
| 1040 |
or |
| 1041 |
|
| 1042 |
wait event=any |
| 1043 |
+event=play id=#360 sound=tap2.au volume=127 sample-rate=8000 seconds=0.21 count=1 |
| 1044 |
@end example |
| 1045 |
|
| 1046 |
@strong{Caution:} This command is considered obsolete and may be removed |
| 1047 |
in the future. Please use the @code{set} command instead. |
| 1048 |
@end deffn |
| 1049 |
|
| 1050 |
@node Connecting, Timeouts, Commands, Top |
| 1051 |
@chapter Connecting |
| 1052 |
An initial connection to a RPTP server is considered to be a RPTP |
| 1053 |
command. This means that the server will always send a response to |
| 1054 |
every client connection. The response sent is one line that begins with |
| 1055 |
@samp{+} for a successful connection and @samp{-} for errors. The rest |
| 1056 |
of the line consists of server attributes that can be used to find out more |
| 1057 |
information about the server. An example would be: |
| 1058 |
|
| 1059 |
@example |
| 1060 |
+host=hercules version=3.2.0b3 uptime=00:47:20 audio-bits=16 \ |
| 1061 |
audio-bufsize=2450 audio-byte-order=big-endian audio-channels=1 \ |
| 1062 |
audio-device=/dev/audio audio-format=linear-16 \ |
| 1063 |
audio-port=speaker,headphone,lineout audio-rate=10 \ |
| 1064 |
audio-sample-rate=11025 volume=120 curr-bufsize=2450 curr-rate=9 \ |
| 1065 |
priority-threshold=0 |
| 1066 |
@end example |
| 1067 |
|
| 1068 |
Note that a @samp{\} was used in the above example to split up the long |
| 1069 |
attribute line. |
| 1070 |
|
| 1071 |
@node Timeouts, Attribute Index, Connecting, Top |
| 1072 |
@chapter Timeouts |
| 1073 |
RPTP servers can be configured to close connections on idle clients. |
| 1074 |
Before the connection is closed, the server will send a timeout |
| 1075 |
notification to the client. The notification is one line that begins |
| 1076 |
with @samp{!}. The reset of the line will contain attributes which |
| 1077 |
should contain information about the timeout. For example: |
| 1078 |
|
| 1079 |
@example |
| 1080 |
!message="Connection timed out after 300 idle seconds." |
| 1081 |
@end example |
| 1082 |
|
| 1083 |
@node Attribute Index, Event Index, Timeouts, Top |
| 1084 |
@appendix Attribute Index |
| 1085 |
@printindex vr |
| 1086 |
|
| 1087 |
@node Event Index, Command Index, Attribute Index, Top |
| 1088 |
@appendix Event Index |
| 1089 |
@printindex ev |
| 1090 |
|
| 1091 |
@node Command Index, , Event Index, Top |
| 1092 |
@appendix Command Index |
| 1093 |
@printindex fn |
| 1094 |
|
| 1095 |
@summarycontents |
| 1096 |
@contents |
| 1097 |
|
| 1098 |
@bye |