Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add support for mDNSPublish, from the howl zeroconf implementation.

Howl hasn't been actively developed for some years now; their website 404s,
and the Wayback Machine archive of 2008 says it's dead.[1] Yet it's still
functional and is much smaller than dbus and avahi, which makes it useful
for embedded systems. In fact, OpenWrt has not dropped support for the howl
tools, and it's because of howl that I can fit a functional shairport and
supporting libraries and kernel onto the 4MB of flash in a TP-LINK
TL-WR703N.[2]

[1] http://web.archive.org/web/20080917182117/http://www.porchdogsoft.com/products/howl/
[2] http://embeddedtimes.blogspot.com/2011/09/tp-link-tl-wr703n-tiny-linux-capable.html
  • Loading branch information...
commit ebe637f0caaaa3c14447ce6d04526b4038df1a52 1 parent ceb2fbc
Tim Douglas authored February 26, 2012
2  INSTALL.md
Source Rendered
@@ -5,7 +5,7 @@ You need the following installed:
5 5
  * openssl
6 6
  * libao
7 7
  * Perl 5.10 or higher
8  
- * Linux: avahi
  8
+ * Linux: avahi (or, for embedded systems, howl)
9 9
  * Windows/Mac OS X: Bonjour
10 10
 
11 11
 Perl modules (install from CPAN if needed e.g. `perl -MCPAN -e 'install X'`):
7  shairport.c
@@ -181,7 +181,7 @@ int main(int argc, char **argv)
181 181
       slog(LOG_INFO, "Usage:\nshairport [OPTION...]\n\nOptions:\n");
182 182
       slog(LOG_INFO, "  -a, --apname=AirPort    Sets Airport name\n");
183 183
       slog(LOG_INFO, "  -p, --password=secret   Sets Password (not working)\n");
184  
-      slog(LOG_INFO, "  -o, --server_port=5002  Sets Port for Avahi/dns-sd\n");
  184
+      slog(LOG_INFO, "  -o, --server_port=5002  Sets Port for Avahi/dns-sd/howl\n");
185 185
       slog(LOG_INFO, "  -b, --buffer=282        Sets Number of frames to buffer before beginning playback\n");
186 186
       slog(LOG_INFO, "  -d                      Daemon mode\n");
187 187
       slog(LOG_INFO, "  -q, --quiet             Supresses all output.\n");
@@ -975,11 +975,14 @@ static int startAvahi(const char *pHWStr, const char *pServerName, int pPort)
975 975
     execlp("dns-sd", "dns-sd", "-R", tName,
976 976
          "_raop._tcp", ".", tPort, "tp=UDP","sm=false","sv=false","ek=1","et=0,1",
977 977
          "cn=0,1","ch=2","ss=16","sr=44100","pw=false","vn=3","txtvers=1", NULL);
  978
+    execlp("mDNSPublish", "mDNSPublish", tName,
  979
+         "_raop._tcp", tPort, "tp=UDP","sm=false","sv=false","ek=1","et=0,1",
  980
+         "cn=0,1","ch=2","ss=16","sr=44100","pw=false","vn=3","txtvers=1", NULL);
978 981
     if(errno == -1) {
979 982
             perror("error");
980 983
     }
981 984
 
982  
-    slog(LOG_INFO, "Bad error... couldn't find or failed to run: avahi-publish-service OR dns-sd\n");
  985
+    slog(LOG_INFO, "Bad error... couldn't find or failed to run: avahi-publish-service OR dns-sd OR mDNSPublish\n");
983 986
     exit(1);
984 987
   }
985 988
   else
9  shairport.pl
@@ -113,7 +113,7 @@ sub usage {
113 113
           "Options:\n".
114 114
           "  -a, --apname=AirPort            Sets AirPort name\n".
115 115
           "  -p, --password=secret           Sets password\n",
116  
-          "  -o, --server_port=5002          Sets Port for Avahi/dns-sd\n",
  116
+          "  -o, --server_port=5002          Sets Port for Avahi/dns-sd/howl\n",
117 117
           "  -i, --pipe=pipepath             Sets the path to a named pipe for output\n",
118 118
           "      --ao_driver=driver          Sets the ao driver (optional)\n",
119 119
           "      --ao_devicename=devicename  Sets the ao device name (optional)\n",
@@ -281,7 +281,12 @@ sub REAP {
281 281
         ".",
282 282
          $port,
283 283
         "tp=UDP","sm=false","sv=false","ek=1","et=0,1","cn=0,1","ch=2","ss=16","sr=44100",$pw_clause,"vn=3","txtvers=1"; };
284  
-    die "could not run avahi-publish-service nor dns-sd";
  284
+    { exec 'mDNSPublish',
  285
+        join('', map { sprintf "%02X", $_ } @hw_addr) . "\@$apname",
  286
+        "_raop._tcp",
  287
+         $port,
  288
+        "tp=UDP","sm=false","sv=false","ek=1","et=0,1","cn=0,1","ch=2","ss=16","sr=44100",$pw_clause,"vn=3","txtvers=1"; };
  289
+    die "could not run avahi-publish-service nor dns-sd nor mDNSPublish";
285 290
 }
286 291
 
287 292
 my $airport_pem = join '', <DATA>;

0 notes on commit ebe637f

Please sign in to comment.
Something went wrong with that request. Please try again.