Closed VincentGijsen closed 13 years ago
The same problem on Debian Squeeze.
somehow it runs after some messing arrount with avahi-daemon.config. It's not yet working but it's listening, guess it's avahi.conf that needs more configuring. Is there a service xml which needs to be configured?
Try with my small patches. You should get some more meaningful output.
So, in Debian you need to install avahi-utils packet, after that it seems to be working good (I use this code https://github.com/rjyo/shairport , try it). Now I have a triangle-in-rectangle airtunes logo in itunes, but can't pick it. When I click on HairPort in itunes nothing happens. It doesn't switch to another speakers. http://img62.imageshack.us/img62/3773/screenshot20110411at194.png
To albertz: thank you very much, but I can't compile your code, this error appear:
gcc hairtunes.c alac.c -D__i386 -lm pkg-config --cflags --libs openssl
-lportaudio -o hairtunes
hairtunes.c: In function ‘init_output’:
hairtunes.c:675: error: ‘PaStreamParameters’ undeclared (first use in this function)
hairtunes.c:675: error: (Each undeclared identifier is reported only once
hairtunes.c:675: error: for each function it appears in.)
hairtunes.c:675: error: expected ‘;’ before ‘outputParameters’
hairtunes.c:676: error: ‘outputParameters’ undeclared (first use in this function)
hairtunes.c:692: warning: passing argument 2 of ‘PaOpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325: note: expected ‘PaDeviceID’ but argument is of type ‘void ’
hairtunes.c:692: warning: passing argument 5 of ‘Pa_OpenStream’ makes pointer from integer without a cast
/usr/include/portaudio.h:325: note: expected ‘void ’ but argument is of type ‘int’
hairtunes.c:692: warning: passing argument 7 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325: note: expected ‘int’ but argument is of type ‘void ’
hairtunes.c:692: warning: passing argument 8 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325: note: expected ‘PaSampleFormat’ but argument is of type ‘void ’
hairtunes.c:692: error: too few arguments to function ‘Pa_OpenStream’
make: _* [hairtunes] Error 1
Hacker News reports this as not working on OS X. I just pushed the 0.0.3 release that may fix the issue.
The problem with PaStream.. is because you probably have a very old PortAudio version. I have seen that Debian Lenny comes with some PortAudio from 2000.
Cheers! With last update it works! Thank you everybody!
errors in OSX with latest source.
RSA.xs:178: OpenSSL error: no start line at shairport.pl line 88. listening... Avahi publishing failed! at shairport.pl line 72, line 23.
Snow Leopard 10.6.6:
Installed every package via macports and perl. make works fine but starting doesn't work. following error message:
bash-3.2# make
gcc hairtunes.c alac.c -D__i386 -lm pkg-config --cflags --libs ao openssl
-o hairtunes
bash-3.2# perl shairport.pl
Scalar found where operator expected at shairport.pl line 220, near ")$/"
(Missing operator before $/?)
syntax error at shairport.pl line 220, near "if ($ip =~ /("
(Might be a runaway multi-line // string starting on line 204)
syntax error at shairport.pl line 220, near "+)"
Execution of shairport.pl aborted due to compilation errors.
Sounds like possibly a wrong version of Perl? I'm not sure.
hm 'perl -v' brings out 5.8.9. too old isn't it?
So.. after line 67 i added the following to get bonjour discover working in osx..
exec 'dns-sd', '-R', join('', map { sprintf "%02X", $_ } @hw_addr) . "\@$apname", "_raop._tcp", ".", "5000", "tp=UDP","sm=false","sv=false","ek=1","et=0,1","cn=0,1","ch=2","ss=16","sr=44100","pw=false","vn=3","txtvers=1"; die "could not run avahi-publish-service nor dns-sd";
now i can click on the speaker in itunes.. but when i push play i get errors from itunes and the script dies.
itunes:
An error occurred while connecting to the remote speaker “ShairPort 19773 on mine.local”. The network connection failed.
perl script:
FATAL: can't bind control socket _CHILD EXITED_ Expected port number from decoder; got at shairport.pl line 298.
@n8o: Try with my fork.
@albertz Works great! thank you!
@albertz: getting closer but now with ur version following comes out:
MacMediaPro:albertz-shairport-faaa60c david$ perl shairport.pl Registering Service 00958C0D9F58@ShairPort 2280 on MacMediaPro.local._raop._tcp port 5000 TXT tp=UDP sm=false sv=false ek=1 et=0,1 cn=0,1 ch=2 ss=16 sr=44100 pw=false vn=3 txtvers=1 killed
@derd3000: I'm on OSX 10.6.7. That comes with a newer Perl. Maybe it will work for you. Otherwise, I don't really have an idea what is failing for you.
@albertz: hm i'm using activeperl 5.12. do u think this is the problem?! hmm..
well just updated to 10.6.7 and shareport gets still killed at once. so it's not the perl version :(
the rjyo is working and is also detected by iphone4 and macbook pro but in itunes it says that the version is not compatible and on iphone the mac server doesn't play any music :(
@derd3000 What is the version on 10.6.7 ? On 10.6.6 it should be ran with :: perl5.10.0 shairport.pl (default is 5.8.9)
I 'perl -W shairport.pl' provides some useful information in these cases. My install (Debian based distro) also died with the informative message 'Killed'
executing with -W provides descent information:
vincent@mail:~/downloads/shairport-0.05$ perl -W shairport.pl Can't exec "avahi-publish-service": No such file or directory at shairport.pl line 87. Killed
"sudo apt-get install avahi-utils" is like a miracle worker ;) after that it's like a sleeping baby
After successful compilation, I cannot start it.
running ./hairtunes gives error that it misses iv and key. So i guess it's starting ok.
running perl shairport.pl only prints 'Killed'
searching the code for the word 'Kill' doesn't give any results
my specs: atom N450, Opensuse 11.4, kernel 2.6.37
what can cause this issue? is Avahi not properly configured perhaps? it's daemon is running btw
thanks and complements to your great work!