Changeset 2e8b589 for gutenbach/debian
- Timestamp:
- Jun 24, 2010, 1:27:07 AM (14 years ago)
- Branches:
- master, debian, mac, no-cups, nodebathena, web
- Children:
- d988d9d
- Parents:
- e5529cd
- git-author:
- Jessica B. Hamrick <jhamrick@…> (12/12/09 18:08:33)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (06/24/10 01:27:07)
- Location:
- gutenbach/debian/lib
- Files:
-
- 11 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
gutenbach/debian/lib/README
re5529cd r2e8b589 1 sipbmp3 1 gutenbach 2 2 The SIPB MP3 Music Spooler 3 3 4 4 We would love you forever if you took this README/INSTALL document and made 5 5 a Debian package out of it. That would be uber-awesome. But otherwise, we're 6 assuming that you just want to get sipbmp3up and running on your own6 assuming that you just want to get gutenbach up and running on your own 7 7 system. Well, maybe we shouldn't assume that. 8 8 9 9 10 What does sipbmp3do?10 What does gutenbach do? 11 11 --------------------- 12 12 13 sipbmp3is a music spooler. As it turns out, streaming music is a hard13 gutenbach is a music spooler. As it turns out, streaming music is a hard 14 14 problem, with lots of proprietary protocols, client and server software. 15 15 All of these jiggety bits are kind of a pain to get working correctly, 16 so, we built sipbmp3on top of... a printer system. It's very simple:16 so, we built gutenbach on top of... a printer system. It's very simple: 17 17 you print an mp3 file to a special "printer", and it gets played on 18 18 whatever speakers you're hooked up to. … … 27 27 28 28 29 Installing sipbmp329 Installing gutenbach 30 30 ------------------ 31 31 … … 33 33 1. Configuring your sound 34 34 35 If you're installing sipbmp3on a server environment, it's highly likely35 If you're installing gutenbach on a server environment, it's highly likely 36 36 that you have a bare bones audio setup and everything is muted. Make sure 37 37 your sound works! One common problem is that the daemon user (the user which … … 48 48 2. Install some prerequisite software 49 49 50 On a vanilla Ubuntu server install, sipbmp3will also need the following50 On a vanilla Ubuntu server install, gutenbach will also need the following 51 51 packages to work properly: 52 52 … … 57 57 58 58 59 3. Setup sipbmp360 61 The Git repository for sipbmp3is located in:62 63 /afs/sipb/project/sipbmp3/ sipbmp3.git64 65 Place this in /root/ sipbmp3; the remctl scripts will assume that the59 3. Setup gutenbach 60 61 The Git repository for gutenbach is located in: 62 63 /afs/sipb/project/sipbmp3/gutenbach.git 64 65 Place this in /root/gutenbach; the remctl scripts will assume that the 66 66 scripts can be found in this location. 67 67 68 68 69 4. Configure sipbmp370 71 sipbmp3will send zephyrs during playback start and end. Since you don't69 4. Configure gutenbach 70 71 gutenbach will send zephyrs during playback start and end. Since you don't 72 72 want to be spamming sipb-auto (which is the default zephyr class these 73 73 are sent to), you should create a configuration file: 74 74 75 /etc/ sipbmp3-filter-config.pl75 /etc/gutenbach-filter-config.pl 76 76 77 77 That looks like: … … 84 84 85 85 86 5. Configure sipbmp3init scripts87 88 sipbmp3 will attempt to drop some information into /var/run/sipbmp3, which86 5. Configure gutenbach init scripts 87 88 gutenbach will attempt to drop some information into /var/run/gutenbach, which 89 89 needs to exist and you can't simply mkdir since /var/run on Ubuntu is 90 a tempfs. Thus, add the following lines to a new file, /etc/init.d/ sipbmp3:90 a tempfs. Thus, add the following lines to a new file, /etc/init.d/gutenbach: 91 91 92 92 #!/bin/sh 93 mkdir /var/run/ sipbmp394 touch /var/run/ sipbmp3/status95 chmod 0777 /var/run/ sipbmp3/status93 mkdir /var/run/gutenbach 94 touch /var/run/gutenbach/status 95 chmod 0777 /var/run/gutenbach/status 96 96 97 97 You should also run these commands yourself. :-) 98 98 99 XXX: Note from jhamrick: I would recomment actually setting this up as a nice startup script, with a switch case for {start|stop|restart} (where with stop you just remove the directory, and with restart you remove the directory and then recreate it). Also, sipbmp3won't actually run on startup unless there are scripts in the /etc/rc*.d directory, so we need to do:100 101 > ln -s ../init.d/ sipbmp3 /etc/rc2.d/S61sipbmp3102 > ln -s ../init.d/ sipbmp3 /etc/rc3.d/S61sipbmp3103 > ln -s ../init.d/ sipbmp3 /etc/rc4.d/S61sipbmp3104 > ln -s ../init.d/ sipbmp3 /etc/rc5.d/S61sipbmp3105 > ln -s ../init.d/ sipbmp3 /etc/rc0.d/K39sipbmp3106 > ln -s ../init.d/ sipbmp3 /etc/rc1.d/K39sipbmp3107 > ln -s ../init.d/ sipbmp3 /etc/rc6.d/K39sipbmp399 XXX: Note from jhamrick: I would recomment actually setting this up as a nice startup script, with a switch case for {start|stop|restart} (where with stop you just remove the directory, and with restart you remove the directory and then recreate it). Also, gutenbach won't actually run on startup unless there are scripts in the /etc/rc*.d directory, so we need to do: 100 101 > ln -s ../init.d/gutenbach /etc/rc2.d/S61gutenbach 102 > ln -s ../init.d/gutenbach /etc/rc3.d/S61gutenbach 103 > ln -s ../init.d/gutenbach /etc/rc4.d/S61gutenbach 104 > ln -s ../init.d/gutenbach /etc/rc5.d/S61gutenbach 105 > ln -s ../init.d/gutenbach /etc/rc0.d/K39gutenbach 106 > ln -s ../init.d/gutenbach /etc/rc1.d/K39gutenbach 107 > ln -s ../init.d/gutenbach /etc/rc6.d/K39gutenbach 108 108 109 109 XXX: We need better permissions for status. Also, quentin wants to put this … … 116 116 running a printer! The magic lines are: 117 117 118 :if=|/path/to/ sipbmp3-filter118 :if=|/path/to/gutenbach-filter 119 119 :lp=/dev/null 120 120 121 Which mean that we pipe the mp3 files through sipbmp3-filter (which does121 Which mean that we pipe the mp3 files through gutenbach-filter (which does 122 122 the actual playing), and then dump the rest of the output into /dev/null, 123 123 since we don't actually care about it. … … 129 129 :cm=Human Readable Printer Name 130 130 :lp=/dev/null 131 :if=|/path/to/ sipbmp3-filter131 :if=|/path/to/gutenbach-filter 132 132 :sd=/var/spool/lpd/printername 133 133 :ml=0:mx=0:sh:sf … … 148 148 in the future. 149 149 150 WARNING: On a cluster machine, get_hesiod_pcap will clobber sipbmp3151 because it sets all:all=someotherprinter, making lpr not see sipbmp3.150 WARNING: On a cluster machine, get_hesiod_pcap will clobber gutenbach 151 because it sets all:all=someotherprinter, making lpr not see gutenbach. 152 152 There are two ways of fixing this: 153 153 … … 190 190 properly, so removing the REJECT line is a must! 191 191 192 XXXXXX: sipbmp3accepts no responsibility for social faux pas that may192 XXXXXX: gutenbach accepts no responsibility for social faux pas that may 193 193 be committed with this system. It is consider good etiquette, however, 194 194 to clear the status file if you're on zsr. … … 206 206 7. Test, round one 207 207 208 The first test you should do to make sure sipbmp3is configured properly is208 The first test you should do to make sure gutenbach is configured properly is 209 209 to attempt to play an mp3 file locally, via lpr. The command you should use 210 210 is: … … 258 258 further: 259 259 260 * Check the zephyr logs of the class sipbmp3was configured to260 * Check the zephyr logs of the class gutenbach was configured to 261 261 send messages to: 262 262 … … 269 269 *software* volume. 270 270 271 - If you see a blank zephyr, that means that sipbmp3-filter died272 trying to get a handle to /var/run/ sipbmp3/status and failing.271 - If you see a blank zephyr, that means that gutenbach-filter died 272 trying to get a handle to /var/run/gutenbach/status and failing. 273 273 Check if you created the file correctly, and that daemon has 274 274 permissions to write to it. If you rebooted recently, check if … … 281 281 exiftools is not installed. 282 282 283 * Otherwise, double check the userland code in sipbmp3-filter. XXX: There283 * Otherwise, double check the userland code in gutenbach-filter. XXX: There 284 284 are some edge-cases that don't give nice error messages, for example 285 the failed write to /var/run/ sipbmp3/status285 the failed write to /var/run/gutenbach/status 286 286 287 287 … … 292 292 In order to do this, you will need to ask IS&T for a Moira pcap entry 293 293 request. Send mail to hesreq@mit.edu, specifying that you are setting 294 up a sipbmp3clone, that you want a Moira pcap entry, the printer name294 up a gutenbach clone, that you want a Moira pcap entry, the printer name 295 295 and server name of your queue, and that you want hwtype=LOCAL,ka=1. It wouldn't 296 296 hurt to also tell them where your print queue is, and a contact list. … … 326 326 Finally, edit /etc/printcap and give it information about the Kerberos: 327 327 328 sipbmp3: server328 gutenbach: server 329 329 :cm=SIPB MP3 Spooler 330 330 ... … … 351 351 You will probably need to apt-get install remctl-server. Then, replace 352 352 the /etc/remctl/conf.d directory with a Git checkout of 353 /afs/sipb/project/sipbmp3/ sipbmp3-remctl.git.353 /afs/sipb/project/sipbmp3/gutenbach-remctl.git. 354 354 355 355 Please note that remctl will NOT work without a keytab setup. 356 356 357 357 358 X. Deploying sipbmp3web358 X. Deploying gutenbachweb 359 359 ------------------------ 360 360 361 sipbmp3web provides a nice and user-friendly interface for some common361 gutenbach web provides a nice and user-friendly interface for some common 362 362 tasks. XXX: It is currently not portable beyond zsr. Stay tuned! 363 363 … … 367 367 If things are broken on a reboot, make sure you're running: 368 368 369 /etc/init.d/{ sipbmp3,zhm,debatehna-lprng}369 /etc/init.d/{gutenbach,zhm,debatehna-lprng} -
gutenbach/debian/lib/cd-cddb-get
r737d88b r2e8b589 3 3 4 4 CDDBURL="http://freedb.freedb.org/~cddb/cddb.cgi" 5 MYUSER=" sipbmp3"5 MYUSER="gutenbach" 6 6 MYHOST="zsr.mit.edu" 7 7 … … 13 13 TRACKS="$2" 14 14 15 mkdir -p /var/cache/ sipbmp315 mkdir -p /var/cache/gutenbach 16 16 17 CACHEFILE="/var/cache/ sipbmp3/$ID"17 CACHEFILE="/var/cache/gutenbach/$ID" 18 18 19 19 if [ ! -e "$CACHEFILE" ]; then -
gutenbach/debian/lib/cd-play
r737d88b r2e8b589 18 18 fi 19 19 20 echo "cdda://$(($T - 1))" | mit-lpr -P sipbmp3@localhost -J "Track $T$DESC";20 echo "cdda://$(($T - 1))" | mit-lpr -Pgutenbach@localhost -J "Track $T$DESC"; 21 21 echo "Queued Track $T$DESC"; 22 22 } -
gutenbach/debian/lib/gutenbach-filter
rf1ba976 r2e8b589 2 2 # Play the data on STDIN as an audio file 3 3 # 4 # $Id: sipbmp3-filter,v 1.26 2009/02/20 00:27:17 geofft Exp root $5 # $Source: /usr/local/bin/RCS/ sipbmp3-filter,v $4 # $Id: gutenbach-filter,v 1.26 2009/02/20 00:27:17 geofft Exp root $ 5 # $Source: /usr/local/bin/RCS/gutenbach-filter,v $ 6 6 # 7 7 # TODO … … 25 25 my $zephyr_class = "sipb-test"; 26 26 my $host = `hostname`; 27 my $queue = " sipbmp3";27 my $queue = "gutenbach"; 28 28 29 29 # Configuration 30 my $config_file = "/ etc/sipbmp3-filter-config.pl";30 my $config_file = "/usr/lib/gutenbach/gutenbach-filter-config.pl"; 31 31 if (-r $config_file) { 32 32 # Inline the configuration file … … 40 40 41 41 close(STDERR); 42 open(STDERR, ">>", "/tmp/ sipbmp3.log") or warn "Couldn't open log: $!";42 open(STDERR, ">>", "/tmp/gutenbach.log") or warn "Couldn't open log: $!"; 43 43 44 44 $ENV{"TERM"}="vt100"; … … 98 98 99 99 # For the Now Playing remctl command 100 open(STATUS, '>', '/var/run/sipbmp3/status') or die("Can't open status file /var/run/sipbmp3/status"); 100 open(STATUS, '>', '/var/run/gutenbach/status') or die("Can't open status file /var/run/gutenbach/status"); 101 102 # For the Now Playing local command 103 open(CURRENT, '>', '/var/run/gutenbach/current') or die("Can't open status file /var/run/sipbp3/current"); 101 104 102 105 print(ZEPHYR "$opts{'n'}\@$opts{'H'} is playing:\n"); 103 106 print(STATUS "User: $opts{'n'}\@$opts{'H'}\n"); 107 print(CURRENT "$opts{'n'}\@$opts{'H'} is playing:\n"); 104 108 105 109 # SIGHUP handler 106 110 sub clear_status { 107 111 # Possible race condition if the previous status is still going 108 open(STA, '>', '/var/run/ sipbmp3/status');112 open(STA, '>', '/var/run/gutenbach/status'); 109 113 close(STA); 110 114 open(ZEPH, '|/usr/athena/bin/zwrite -d -n -c '. $zephyr_class .' -i '. … … 112 116 print(ZEPH "Playback aborted.\n"); 113 117 close(ZEPH); 118 open(CURRENT, '|/usr/athena/bin/zwrite -d -n -c '. $zephyr_class .' -i '. 119 $queue.'@'.$host.' -s "SIPB LPR music spooler"'); 120 close(CURRENT); 114 121 die; 115 122 } … … 125 132 if ($magic) { 126 133 printf(ZEPHYR "%s file %s\n", $magic, $opts{'J'}); 134 printf(CURRENT "%s file %s\n", $magic, $opts{'J'}); 127 135 printf(STATUS "Filetype: %s\n", $magic); 128 136 printf(STATUS "Filename: %s\n", $opts{'J'}); 129 137 if (exists $fileinfo->{'Title'}) { 130 138 printf(ZEPHYR "\@b{%s}\n", $fileinfo->{'Title'}) if exists $fileinfo->{'Title'}; 139 printf(CURRENT "\@b{%s}\n", $fileinfo->{'Title'}) if exists $fileinfo->{'Title'}; 131 140 printf(STATUS "Title: %s\n", $fileinfo->{'Title'}); 132 141 } … … 134 143 if (exists $fileinfo->{$key}) { 135 144 printf(ZEPHYR "%s\n", $fileinfo->{$key}) if exists $fileinfo->{$key}; 145 printf(CURRENT "%s\n", $fileinfo->{$key}) if exists $fileinfo->{$key}; 136 146 printf(STATUS "%s: %s\n", $key, $fileinfo->{$key}); 137 147 } … … 150 160 $title = ""; 151 161 print ZEPHYR "YouTube video $filepath\n$title"; 162 print CURRENT "YouTube video $filepath\n$title"; 152 163 print STATUS "YouTube video $filepath\n$title"; 153 164 $filepath = <$out>; … … 157 168 print STDERR "Resolved external reference to $filepath\n"; 158 169 printf(ZEPHYR "%s\n", $filepath); 170 printf(CURRENT "%s\n", $filepath); 159 171 printf(STATUS "External: %s\n", $filepath); 160 172 } … … 163 175 split_playlist($filepath, \%opts); 164 176 close(ZEPHYR); 177 close(CURRENT); 165 178 close(STATUS); 166 179 exit 0; … … 170 183 #printf(ZEPHYR "Job priority %s\n", $opts{'C'}) if ($opts{'C'} && ($opts{'C'} ne 'A')); 171 184 close(ZEPHYR); 185 close(CURRENT); 172 186 close(STATUS); 173 187 play_mplayer_audio($filepath, \%opts); … … 291 305 292 306 close(ZEPHYR); 293 open(STATUS, '>', '/var/run/ sipbmp3/status');307 open(STATUS, '>', '/var/run/gutenbach/status'); 294 308 close(STATUS); 295 309 } -
gutenbach/debian/lib/gutenbach-get-config
r28836c2 r2e8b589 1 1 #!/usr/athena/bin/perl 2 2 use strict; 3 # Get configuration of sipbmp33 # Get configuration of gutenbach 4 4 5 5 my $zephyr_class = "sipb-test"; 6 6 my $host = `hostname`; 7 my $queue = " sipbmp3";7 my $queue = "gutenbach"; 8 8 my $mixer = "Headphone"; 9 9 my $channel = "Front Left"; 10 10 11 11 # Configuration 12 my $config_file = "/ etc/sipbmp3-filter-config.pl";12 my $config_file = "/usr/lib/gutenbach/gutenbach-filter-config.pl"; 13 13 if (-r $config_file) { 14 14 # Inline the configuration file -
gutenbach/debian/lib/status-clear
r737d88b r2e8b589 1 1 #!/bin/sh 2 2 PATH="$(dirname $0):$PATH" 3 > /var/run/ sipbmp3/status3 > /var/run/gutenbach/status -
gutenbach/debian/lib/status-get
r737d88b r2e8b589 1 1 #!/bin/sh 2 2 PATH="$(dirname $0):$PATH" 3 cat /var/run/ sipbmp3/status3 cat /var/run/gutenbach/status -
gutenbach/debian/lib/volume-get
r28836c2 r2e8b589 2 2 PATH="$(dirname $0):$PATH" 3 3 4 mixer=$( sipbmp3-get-config mixer)5 channel=$( sipbmp3-get-config channel)4 mixer=$(gutenbach-get-config mixer) 5 channel=$(gutenbach-get-config channel) 6 6 7 7 amixer get $mixer | grep "$channel" \ -
gutenbach/debian/lib/volume-is-muted
r9f0c46e r2e8b589 2 2 PATH="$(dirname $0):$PATH" 3 3 4 mixer=$( sipbmp3-get-config mixer)5 channel=$( sipbmp3-get-config channel)4 mixer=$(gutenbach-get-config mixer) 5 channel=$(gutenbach-get-config channel) 6 6 7 7 volstat=$(amixer get $mixer | grep "$channel" \ -
gutenbach/debian/lib/volume-mute
r0d16875 r2e8b589 2 2 PATH="$(dirname $0):$PATH" 3 3 4 mixer=$( sipbmp3-get-config mixer)5 channel=$( sipbmp3-get-config channel)4 mixer=$(gutenbach-get-config mixer) 5 channel=$(gutenbach-get-config channel) 6 6 7 7 amixer set $mixer toggle > /dev/null -
gutenbach/debian/lib/volume-set
r9f0c46e r2e8b589 2 2 PATH="$(dirname $0):$PATH" 3 3 4 mixer=$( sipbmp3-get-config mixer)5 channel="$( sipbmp3-get-config channel)"4 mixer=$(gutenbach-get-config mixer) 5 channel="$(gutenbach-get-config channel)" 6 6 7 7 amixer set $mixer "$2" | grep "$channel" \ -
gutenbach/debian/lib/volume-show
r9f0c46e r2e8b589 2 2 PATH="$(dirname $0):$PATH" 3 3 4 mixer=$( sipbmp3-get-config mixer)5 channel=$( sipbmp3-get-config channel)4 mixer=$(gutenbach-get-config mixer) 5 channel=$(gutenbach-get-config channel) 6 6 7 7 amixer get $mixer -
gutenbach/debian/lib/volume-zephyr
r4f58f93 r2e8b589 1 1 #!/bin/sh 2 2 PATH="$(dirname $0):$PATH" 3 class=$( sipbmp3-get-config zephyr-class)4 host=$( sipbmp3-get-config host)5 queue=$( sipbmp3-get-config queue)3 class=$(gutenbach-get-config zephyr-class) 4 host=$(gutenbach-get-config host) 5 queue=$(gutenbach-get-config queue) 6 6 instance="$queue-volume@$host" 7 7 8 mixer=$( sipbmp3-get-config mixer)9 channel=$( sipbmp3-get-config channel)8 mixer=$(gutenbach-get-config mixer) 9 channel=$(gutenbach-get-config channel) 10 10 11 11 muted=$(volume-is-muted) … … 15 15 fi 16 16 17 start-stop-daemon --stop --oknodo --pidfile / var/run/sipbmp3-zephyr >/dev/null 2>&118 start-stop-daemon --start --pidfile / var/run/sipbmp3-zephyr --make-pidfile --background --exec /bin/sh -- -c "sleep 10 && zwrite -c $class -i $instance -d -n -m 'volume changed to$(volume-get)$mute_str' > /dev/null" >/dev/null 2>&117 start-stop-daemon --stop --oknodo --pidfile /usr/lib/gutenbach/gutenbach-zephyr >/dev/null 2>&1 18 start-stop-daemon --start --pidfile /usr/lib/gutenbach/gutenbach-zephyr --make-pidfile --background --exec /bin/sh -- -c "sleep 10 && zwrite -c $class -i $instance -d -n -m '$REMOTE_USER set volume $(volume-get)$mute_str' > /dev/null" >/dev/null 2>&1
Note: See TracChangeset
for help on using the changeset viewer.