summaryrefslogtreecommitdiff
path: root/doc/README.network_dvd
blob: b6491619085f33290ff19f76aaf1c48bb3922cf7 (plain)
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

Playing DVDs / Audio CDs over the network
=========================================

xine can be used to play DVDs and Audio CDs over the network.

ok, but.... why?

there are some reasons people want to do that:

- because you may have a 200 discs DVD changer on your garage and you
  want to watch them on your room.

- because you don't want to have a lousy cdrom driver around when
  listening to your favorite music.

- because the computer that is hooked to the TV doesn't have a dvdrom.

- because you can :)


network block devices
---------------------

yes, network block device (nbd) could be an option for that. however:

- they don't support ioctls which are needed for cd audio playback and
dvd key exchange. (obs: one may write a custom ioctl code for enbd)

- a completely user space solution is more portable.

- the user space solution can handle failures more gratefuly and gives
better control of closing/opening the device.


installation for audio cds
--------------------------

- you must compile the cdda_server.c that comes with xine-lib sources:

  xine-lib$ cd misc
  xine-lib/misc$ make cdda_server
  gcc -W -Wall -g -o cdda_server cdda_server.c -ldl

  Your xine-lib source tree needs to be configured for that, so please
  run ./configure in the toplevel sourcedir on a fresh tree.

- start cdda_server at the machine that has the cdrom drive:

  xine-lib/misc$ ./cdda_server /dev/cdrom 3000

  note: 3000 is the port number to listen.

- start xine on the client machine with:

  $ xine cdda://server_address:3000/1

  that will play the first track of the CD. in order to use the
  GUI button for "CD" you have to change the setting media.audio_cd.device
  to point to the server.


installation for dvds
---------------------

- compile and run cdda_server (see above).

  note: you may also need to install libdvdcss or some equivalent
  library on your server.

- patch libdvdcss on the client.

  note: no CSS code is needed at all, so it would be possible to use a
  kind of "dummy" dvd library that is API compatible with libdvdcss.

  a sample patch is provided for libdvdcss-1.2.6, install it as follow:

  libdvdcss-1.2.6$ patch -p1 < ../xine-lib/misc/libdvdcss-1.2.6-network.patch
  libdvdcss-1.2.6$ ./bootstrap
  libdvdcss-1.2.6$ make
  libdvdcss-1.2.6$ make install

- start xine on the client machine with:

  $ xine dvd://server_address:3000/

  (don't forget the trailing slash)

  
protocol details
----------------

the network protocol is pretty simple. it consists of text-based commands
and replies over a TCP stream.

command format:

  <command> <arg0> <arg1> <arg2> ... \n

reply format:

  <error code> <n> <value0> <value1> ... \n
  followed by n bytes of binary data (like cd or dvd sectors)

cdda commands:

  cdda_open
  <error code> 0

  cdda_read <start_frame> <num_frames>
  <error code> <n>
  <n bytes (frames)>
  
  cdda_tochdr
  <error code> 0 <first_track> <last_track>

  cdda_tocentry
  <error code> 0 <track_mode> <first_frame_min> <first_frame_sec> <first_frame_frame>
  
dvd commands:

  dvd_open
  <error code> 0

  dvd_error
  <error code> <n>
  <n bytes (error string)>

  dvd_read <blocks> <flags>
  <error code> <n>
  <n bytes (blocks)>

  dvd_seek <block> <flags>
  <error code> 0

  dvd_title <block>
  <error code> 0

---
version of this file:
 $Id: README.network_dvd,v 1.3 2004/12/12 22:00:48 mroi Exp $