I have struggled for some time getting AlienBBC to work properly with my
SB1 and softsqueeze.
To summarize, here are the results of various combinations of testing
(with virus checking & firewall disabled and convertfile & mplayer
version matching)
standalone mplayer+bbcstation OK
alienbbc+virginradio+softsq OK
alienbbc+virginradio+sb1 OK
aliebbbc+bbcstation+softsq OK (if file types set to force WAV)
aliebbbc+bbcstation+softsq ERRORED (if file types set to force
FLAC or
MP3)
alienbbc+bbcstation+sb1 ERRORED (whatever file type settings)
The errors logged are
flac: state = FLAC__STREAM_ENCODER_FATAL_ERROR_WHILE_WRITING
mp3: Error writing mp3 output
Other people have also posted logs with these same errors.
Both of these errors occur whilst trying to write to the output handle
of the final child process in the socketwrapper command line. This
output is supposed to be going to a tcpip port that slimserver advises
socketwrapper in the command line. Socketwrapper opens a socket on
this port and duplicates the socket handle. This duplicate handle is
what is passed to the final process.
Socketwrapper uses the Windows API function DuplicateHandle to do the
duplication.
This is where the Windows API documentation is a bit vague as it sort
of says that socket handles can be file handles and be used with
DuplicateHandle but recommends using WSADuplicateSocket. Googling for
"DuplicateHandle WSADuplicateSocket" comes up with various other people
who have had problems related to this.
See -
http://tinyurl.com/9hdtv
http://tangentsoft.net/wskfaq/articles/passing-sockets.html
http://support.microsoft.com/default.aspx?scid=kb;en-us;150523
One possibility is that having a firewall installed (even if disabled)
affects the Winsock service provider somehow and means that
DuplicateHandle will not necessarily work.
To check this possibility I tried the following -
a) delete the following lines from socketwrapper.cpp
if (!DuplicateHandle(GetCurrentProcess(), (HANDLE)outputSocket,
GetCurrentProcess(), &outputSocketDup, 0,
TRUE, DUPLICATE_SAME_ACCESS)) {
fprintf(stderr, "SW: Error duplicating output handle: %d\n",
GetLastError());
return -1;
}
b) replace them with
WSAPROTOCOL_INFO pi;
WSADuplicateSocket( outputSocket, GetCurrentProcessId(), &pi );
outputSocketDup = (HANDLE)WSASocket( FROM_PROTOCOL_INFO,
FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, &pi, 0, 0 )
;
c) compile and replace the socketwrapper.exe in
server\Bin\MSWin32-x86-multi-thread with the newly compiled version
d) try listening to station
bingo ! - alienbbc works with mp3 on my sb1 and with flac and mp3 on
softsqueeze
I have attached a zipped version of my socketwrapper.exe for anyone mad
enough to trust binary attachments.
Note that I have no idea if this will adversely impact any other
slimserver use of socketwrapper. Please can anyone point me towards
other streams & file types to test ?
Also, if anyone else can confirm this analysis and fix and get it (with
the error checking that's missing) into the nightly releases then it'd
be much appreciated. (Or, let me know how to go about it.)
Regards
Ian
+-------------------------------------------------------------------+
|Filename: socketwrapper.zip |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=593|
+-------------------------------------------------------------------+
--
iancook
------------------------------------------------------------------------
iancook's Profile: http://forums.slimdevices.com/member.php?userid=1873
View this thread: http://forums.slimdevices.com/showthread.php?t=19641
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins