jacksonlcrews / darkice

Automatically exported from code.google.com/p/darkice
0 stars 0 forks source link

Broken on OpenBSD #39

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
A few things i notice:

1)

you use pselect() which OpenBSD does not seem to have implemented. This is 
probably not your fault, but a workaround should be found. I was able to 
compile by using select() and converting timespec structs to timeval structs

2) Once I have a build and set a stream for /dev/audio I get the following 
crash:

(gdb) run -v10 -c /opt/darkice/etc/darkice.cfg
Starting program: /opt/darkice/bin/darkice -v10 -c /opt/darkice/etc/darkice.cfg
DarkIce 1.0 live audio streamer, http://code.google.com/p/darkice/
Copyright (c) 2000-2007, Tyrell Hungary, http://tyrell.hu/
Copyright (c) 2008-2010, Akos Maroy and Rafael Diniz
This is free software, and you are welcome to redistribute it 
under the terms of The GNU General Public License version 3 or
any later version.

Using config file: /opt/darkice/etc/darkice.cfg
11-Nov-2010 13:37:57 Using Solaris DSP input device: /dev/audio
11-Nov-2010 13:37:57 encoding
11-Nov-2010 13:37:57 POSIX scheduling not supported on this system, this may 
cause recording skips

Program received signal SIGBUS, Bus error.
0x00000000001285c4 in TcpSocket::open (this=0x20ef06c80) at TcpSocket.cpp:232
232         addr.sin_addr.s_addr = *((long*) pHostEntry->h_addr_list[0]);
(gdb) bt
#0  0x00000000001285c4 in TcpSocket::open (this=0x20ef06c80)
    at TcpSocket.cpp:232
#1  0x0000000000107ce0 in BufferedSink::open (this=0x206d20680)
    at BufferedSink.h:309
#2  0x00000000001084dc in CastSink::open (this=0x20c89a900) at CastSink.cpp:121
#3  0x0000000000122c7c in VorbisLibEncoder::open (this=0x2068fc400)
    at VorbisLibEncoder.cpp:149
#4  0x000000000010d5b0 in Connector::open (this=0x206d20c40)
    at Connector.cpp:229
#5  0x0000000000110ef0 in MultiThreadedConnector::open (this=0x206d20c00)
    at MultiThreadedConnector.cpp:153
#6  0x0000000000117a7c in DarkIce::encode (this=0x2095f1000)
    at DarkIce.cpp:1186
#7  0x0000000000117eb0 in DarkIce::run (this=0x2095f1000) at DarkIce.cpp:1216
#8  0x000000000012e88c in main (argc=4, argv=0xffffffffffff1d18)
    at main.cpp:159

Needs some love on OpenBSD it seems.

This is a sparc64 machine.

Cheers

Original issue reported on code.google.com by vex...@gmail.com on 11 Nov 2010 at 1:45

GoogleCodeExporter commented 9 years ago
I am not sure if it solves your problem but it could.
Assuming pointer size and long size is never good.
Here is a patch for proper handling of gethostbyname() and socket()

diff -ubpB TcpSocket.cpp.org TcpSocket.cpp
--- TcpSocket.cpp.org   2011-03-20 20:47:15.145339711 +0100
+++ TcpSocket.cpp   2011-03-20 20:54:58.965339490 +0100
@@ -240,7 +240,7 @@ TcpSocket :: open ( void )              
     memset( &addr, 0, sizeof(addr));
     addr.sin_family      = AF_INET;
     addr.sin_port        = htons(port);
-    addr.sin_addr.s_addr = *((long*) pHostEntry->h_addr_list[0]);
+    
memcpy(&(addr.sin_addr.s_addr),pHostEntry->h_addr_list[0],pHostEntry->h_length);
 #endif

     if ( (sockfd = socket( AF_INET, SOCK_STREAM,  IPPROTO_TCP)) == -1 ) {

Original comment by oetelaar.automatisering on 20 Mar 2011 at 7:58

GoogleCodeExporter commented 9 years ago
Is this confirmed working on all other platforms?

Original comment by rafael2k...@gmail.com on 16 Jan 2012 at 9:26