<div dir="ltr">Hi there,<div><br></div><div>I am trying to use python-shout 0.2.1 to broadcast to a icecast 2.4.0 server, which result in a segmentation fault and I can't understand why. Is anyone else experiencing this problem?</div>
<div><br></div><div>Here is the config that I use with icecast 2.4.0.</div><div><br></div><div><div><font face="courier new, monospace"><icecast></font></div><div><font face="courier new, monospace"> <limits></font></div>
<div><font face="courier new, monospace"> <clients>100</clients></font></div><div><font face="courier new, monospace"> <sources>2</sources></font></div><div><font face="courier new, monospace"> <threadpool>5</threadpool></font></div>
<div><font face="courier new, monospace"> <queue-size>524288</queue-size></font></div><div><font face="courier new, monospace"> <client-timeout>30</client-timeout></font></div><div><font face="courier new, monospace"> <header-timeout>15</header-timeout></font></div>
<div><font face="courier new, monospace"> <source-timeout>10</source-timeout></font></div><div><font face="courier new, monospace"> <burst-on-connect>1</burst-on-connect></font></div>
<div><font face="courier new, monospace"> <burst-size>65535</burst-size></font></div><div><font face="courier new, monospace"> </limits></font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace"> <authentication></font></div><div><font face="courier new, monospace"> <source-password>passwood</source-password></font></div><div><font face="courier new, monospace"> <relay-password>passwood</relay-password></font></div>
<div><font face="courier new, monospace"> <admin-user>admin</admin-user></font></div><div><font face="courier new, monospace"> <admin-password>passwood</admin-password></font></div><div>
<font face="courier new, monospace"> </authentication></font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"> <hostname>thinkpad</hostname></font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"> <listen-socket></font></div><div><font face="courier new, monospace"> <port>8000</port></font></div>
<div><font face="courier new, monospace"> </listen-socket></font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"> <mount></font></div><div><font face="courier new, monospace"> <mount-name>/jukebox.ogg</mount-name></font></div>
<div><font face="courier new, monospace"> <username>source</username></font></div><div><font face="courier new, monospace"> <password>passwood</password></font></div><div><font face="courier new, monospace"> <max-listeners>10</max-listeners></font></div>
<div><font face="courier new, monospace"> <burst-size>>65536</burst-size></font></div><div><font face="courier new, monospace"> <hidden>1</hidden></font></div><div><font face="courier new, monospace"> <no-yp>1</no-yp></font></div>
<div><font face="courier new, monospace"> </mount></font></div><div><font face="courier new, monospace"> <fileserve>1</fileserve></font></div><div><font face="courier new, monospace"> <paths></font></div>
<div><font face="courier new, monospace"> <basedir>/usr/share/icecast2</basedir></font></div><div><font face="courier new, monospace"> <logdir>/var/log/icecast</logdir></font></div><div>
<font face="courier new, monospace"> <webroot>/usr/share/icecast2/web</webroot></font></div><div><font face="courier new, monospace"> <adminroot>/usr/share/icecast2/admin</adminroot></font></div>
<div><font face="courier new, monospace"> <alias source="/" dest="/status.xsl"/></font></div><div><font face="courier new, monospace"> </paths></font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace"> <logging></font></div><div><font face="courier new, monospace"> <accesslog>access.log</accesslog></font></div><div><font face="courier new, monospace"> <errorlog>error.log</errorlog></font></div>
<div><font face="courier new, monospace"> <loglevel>4</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error --></font></div><div><font face="courier new, monospace"> <logsize>10000</logsize> <!-- Max size of a logfile --></font></div>
<div><font face="courier new, monospace"> </logging></font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"> <security></font></div><div><font face="courier new, monospace"> <chroot>0</chroot></font></div>
<div><font face="courier new, monospace"> </security></font></div><div><font face="courier new, monospace"></icecast></font></div></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"># sudo -u nobody icecast -c /etc/icecast.xml</font></div>
<div><br></div><div>I use the example.py which is included in python-shout package to test the broadcast, which result in the following.</div><div><br></div><div><div><font face="courier new, monospace">#!/usr/bin/env python</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"># usage: ./example.py /path/to/file1 /path/to/file2 ...</font></div><div><font face="courier new, monospace">import shout</font></div>
<div><font face="courier new, monospace">import sys</font></div><div><font face="courier new, monospace">import string</font></div><div><font face="courier new, monospace">import time</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace">s = shout.Shout()</font></div><div><font face="courier new, monospace">print "Using libshout version %s" % shout.version()</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace">s.host = 'localhost'</font></div><div><font face="courier new, monospace">s.password = 'passwood'</font></div><div><font face="courier new, monospace">s.mount = "/jukebox.ogg"</font></div>
<div><font face="courier new, monospace">s.open()</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">total = 0</font></div><div><font face="courier new, monospace">st = time.time()</font></div>
<div><font face="courier new, monospace">for fa in sys.argv[1:]:</font></div><div><font face="courier new, monospace"> print "opening file %s" % fa</font></div><div><font face="courier new, monospace"> f = open(fa)</font></div>
<div><font face="courier new, monospace"> s.set_metadata({'song': fa})</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"> nbuf = f.read(4096)</font></div>
<div><font face="courier new, monospace"> while 1:</font></div><div><font face="courier new, monospace"> buf = nbuf</font></div><div><font face="courier new, monospace"> nbuf = f.read(4096)</font></div><div>
<font face="courier new, monospace"> total = total + len(buf)</font></div><div><font face="courier new, monospace"> if len(buf) == 0:</font></div><div><font face="courier new, monospace"> break</font></div>
<div><font face="courier new, monospace"> s.send(buf)</font></div><div><font face="courier new, monospace"> s.sync()</font></div><div><font face="courier new, monospace"> f.close()</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace"> et = time.time()</font></div><div><font face="courier new, monospace"> br = total*0.008/(et-st)</font></div><div><font face="courier new, monospace"> print "Sent %d bytes in %d seconds (%f kbps)" % (total, et-st, br)</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">print s.close()</font></div></div><div><br></div><div><font face="courier new, monospace"># ./env/bin/python example.py test.mp3</font></div>
<div><div><font face="courier new, monospace">Using libshout version 2.3.1</font></div><div><font face="courier new, monospace">opening file test.mp3</font></div><div><font face="courier new, monospace">Segmentation fault</font></div>
</div><div><br></div><div>-- <br><div dir="ltr"><div><br></div><font face="arial, helvetica, sans-serif"><b style="font-size:small">Frank Lazzarini</b><br><font size="1"><b>Email:</b> <a href="mailto:flazzarini@gmail.com" target="_blank">flazzarini@gmail.com</a> <b>Phone:</b> +352 621 314 430<br>
<b>Blog:</b> <a href="http://www.gefoo.org" target="_blank">http://www.gefoo.org</a> <b>LinkedIn:</b> <a href="http://www.linkedin.com/pub/frank-lazzarini/1a/a30/112" target="_blank">http://www.linkedin.com/pub/frank-lazzarini/1a/a30/112</a></font></font><br>
<div><div><br></div></div></div>
</div></div>