1 EsounD Protocol (Draft)
2 Author: ymnk<ymnk@jcraft.com>
8 This document describes the protocol in EsounD system.
9 Unfortunately, any formal description about EsounD had not existed.
10 So the author has tried to read the source code of EsounD and written this
11 document. The author is also the author of JEsd, which is a re-implementation
12 of EsounD in pure Java and this document is based on his knowledge,
13 which had gotten in hacking JEsd.
18 The esd will wait for the TCP connection requests from EsounD compatible
19 applications. In the default, esd will listen to the TCP port 16001.
20 The client must send an initial byte of data to be authorized them-self
21 and to identify the byte order to be employed.
22 For authorization, client must send 'esd-key', which is a 16 byte data.
23 For endian-ness, client must send a 4 byte data.
24 If esd does not detect any error, '1' will be sent back and
25 '0' will be sent back in error.
33 At first, esd will check if the client has the right to lock the device
34 by esd-key. If that client has the right to do so, esd will lock the device
35 and send back true. If not, false will be sent back
41 At first, esd will check if the client has the right to unlock the device
42 by esd-key. If that client has the right to do so, esd will unlock the
43 device and send back true. If not, false will be sent back
51 All numbers are in decimal, unless prefixed with '0x', in which case
52 they are in hexadecimal(base 16).
54 The general syntax used to describe data packets is:
60 For components described in the protocol descriptions as:
67 N is the number of bytes in the data stream, and TYPE is the interpretation
68 of those bytes. For example,
73 For components with a static numeric value the encode-form is:
75 The value is always interpreted as a N-byte unsigned integer.
80 CARD8: A single byte unsigned integer.
81 CARD32: 32-bit unsigned integer
82 ARRAY8: A collection of CARD8.
83 ARRAY8(n): This is a ARRAY8, which includes 'n' elements.
84 ENDIAN: This is a ARRAY8(4), which includes 'ENDN' or 'NDNE'.
85 If the first element is 'E', data from clients is in big-endian.
86 BOOLEAN: This is a CARD32 and includes '0' or '1'. '1' means true.
87 ESDKEY: This is a ARRAY8(16), which includes 'esd-key'.
88 ESDNAME: This is a ARRAY8(128), which includes 'esd-name'.
89 ESDSTREAM: This is a infinite ARRAY8.
90 FORMAT: This is a CARD32. Each bits in this data has following semantics,
91 (format&0x000f)==0x0000 8bit data
92 (format&0x000f)==0x0001 16bit data
93 (format&0x00f0)==0x0010 mono
94 (format&0x00f0)==0x0020 stereo
95 (format&0x0f00)==0x0000 stream
96 (format&0x0f00)==0x0100 sample
97 (format&0x0f00)==0x0200 ADPCM
98 (format&0xf000)==0x1000 play
99 (format&0xf000)==0x0000 monitor for streams, stop for samples
100 (format&0xf000)==0x2000 record for streams, loop for samples
101 MODE: This is a CARD32, which is '0', '1', '2' or '3'.
113 4 ENDIAN 'ENDN' or 'NDNE'
134 ? ESDSTREAM stream of PCM sound
136 //stream-mon: This protocol is not used for the remote esd.
141 // w ? ESDSTREAM stream of PCM sound
148 w ? ESDSTREAM stream of PCM sound
157 n ARRAY8(n) stream of PCM sound
224 except for last in series
228 w 4 CARD32 left-vol-scale
229 w 4 CARD32 right-vol-scale
233 w 32 ARRAY8(32) unused
237 except for last in series
241 w 4 CARD32 left-vol-scale
242 w 4 CARD32 right-vol-scale
244 w 4 CARD32 sample-length
247 w 36 ARRAY8(36) unused
250 //subscribe: undefined
253 //unsubjcribe: undefined