<html>
  <head>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Friends:<br>
    <br>
    The icecast server is very robust, but has some goofiness with
    regard to use with cell-phone players. Has anyone else encountered
    these issues?<br>
    <br>
    When I use a Blackberry to access the icecast stream, I get orphan
    and duplicate client threads.<br>
    <br>
    Background:<br>
    > testing with Blackberry Curve 9330<br>
    > Access icecast stream by clicking on the link on the website:<br>
         <a class="moz-txt-link-freetext"
      href="http://www.airprogressive.org:8000/stream.m3u">http://www.airprogressive.org:8000/stream.m3u</a><br>
    > Stream consists of mp3 at 32kbps / 22050 Hz.<br>
    > Stock media player launches, stops at "Do you want to open or
    save the item."<br>
        > No threads started yet (viewing "List Clients" page of
    icecast admin interface).<br>
    > Click "open", stream begins playing.<br>
    > Two threads are started instead of just one, always offset by 2
    seconds.<br>
        -- but sometimes only one thread starts.<br>
    > FYI, Icecast config:
    <client-timeout>30</client-timeout><br>
    <br>
    Here is the output from the "List Clients" page of Icecast2 Admin<br>
    <br>
    <table border="1" cellpadding="5" cellspacing="0">
      <tbody>
        <tr>
          <td>
            <center><b>IP</b></center>
          </td>
          <td>
            <center><b>Seconds Connected</b></center>
          </td>
          <td>
            <center><b>User Agent</b></center>
          </td>
          <td>
            <center><b>Action</b></center>
          </td>
        </tr>
        <tr>
          <td align="center">68.7.238.55</td>
          <td align="center">406</td>
          <td align="center">WinampMPEG/5.62, Ultravox/2.1</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2690">Kick</a></td>
        </tr>
        <tr>
          <td align="center">74.82.68.16</td>
          <td align="center">6</td>
          <td align="center">Mozilla/4.8 [en] (Windows NT 5.0; U)</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2704">Kick</a></td>
        </tr>
        <tr>
          <td align="center">74.82.68.16</td>
          <td align="center">4</td>
          <td align="center">Mozilla/4.8 [en] (Windows NT 5.0; U)</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2709">Kick</a></td>
        </tr>
      </tbody>
    </table>
    <br>
    Note the last two entries with the same IP address. This is the
    Blackberry. Top entry is winamp player on PC for reference. Don't
    know why two listener threads are generated.<br>
    <br>
    > Stream is "Stopped" (i.e. click stop)<br>
    > Stream is restarted (i.e. click Play)<br>
    > A new thread is started, this time with a new +1 IP address.<br>
    <br>
    <table border="1" cellpadding="5" cellspacing="0">
      <tbody>
        <tr>
          <td>
            <center><b>IP</b></center>
          </td>
          <td>
            <center><b>Seconds Connected</b></center>
          </td>
          <td>
            <center><b>User Agent</b></center>
          </td>
          <td>
            <center><b>Action</b></center>
          </td>
        </tr>
        <tr>
          <td align="center">68.7.238.55</td>
          <td align="center">687</td>
          <td align="center">WinampMPEG/5.62, Ultravox/2.1</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2690">Kick</a></td>
        </tr>
        <tr>
          <td align="center">74.82.68.16</td>
          <td align="center">287</td>
          <td align="center">Mozilla/4.8 [en] (Windows NT 5.0; U)</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2704">Kick</a></td>
        </tr>
        <tr>
          <td align="center">74.82.68.16</td>
          <td align="center">285</td>
          <td align="center">Mozilla/4.8 [en] (Windows NT 5.0; U)</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2709">Kick</a></td>
        </tr>
        <tr>
          <td align="center">74.82.68.17</td>
          <td align="center">8</td>
          <td align="center">Mozilla/4.8 [en] (Windows NT 5.0; U)</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2718">Kick</a></td>
        </tr>
      </tbody>
    </table>
    <br>
    I can understand that the player may continue to communicate when
    "stopped" to fill the lookahead buffer, but when it is restarted, it
    should use the same connection and not start a new one.<br>
    <br>
    <br>
    > Click Stop.<br>
    > Click Play.<br>
    <br>
    <br>
    <table border="1" cellpadding="5" cellspacing="0">
      <tbody>
        <tr>
          <td>
            <center><b>IP</b></center>
          </td>
          <td>
            <center><b>Seconds Connected</b></center>
          </td>
          <td>
            <center><b>User Agent</b></center>
          </td>
          <td>
            <center><b>Action</b></center>
          </td>
        </tr>
        <tr>
          <td align="center">68.7.238.55</td>
          <td align="center">803</td>
          <td align="center">WinampMPEG/5.62, Ultravox/2.1</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2690">Kick</a></td>
        </tr>
        <tr>
          <td align="center">74.82.68.16</td>
          <td align="center">403</td>
          <td align="center">Mozilla/4.8 [en] (Windows NT 5.0; U)</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2704">Kick</a></td>
        </tr>
        <tr>
          <td align="center">74.82.68.16</td>
          <td align="center">401</td>
          <td align="center">Mozilla/4.8 [en] (Windows NT 5.0; U)</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2709">Kick</a></td>
        </tr>
        <tr>
          <td align="center">74.82.68.17</td>
          <td align="center">124</td>
          <td align="center">Mozilla/4.8 [en] (Windows NT 5.0; U)</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2718">Kick</a></td>
        </tr>
        <tr>
          <td align="center">74.82.68.18</td>
          <td align="center">24</td>
          <td align="center">Mozilla/4.8 [en] (Windows NT 5.0; U)</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2735">Kick</a></td>
        </tr>
      </tbody>
    </table>
    <br>
    > Yet another thread  is started with a new "listener".<br>
    > Click "back" to exit from browser in Blackberry.<br>
    > All threads continue.<br>
        --> I have tested this many times and the threads continue
    without being cleaned up indefinitely, even though the player is
    stopped and the stream is not "playing" on the handset.<br>
    > Turn off mobile network. Handset not communicating.<br>
    > Threads continue<br>
    > Handheld turned off.<br>
    <br>
    <table border="1" cellpadding="5" cellspacing="0">
      <tbody>
        <tr>
          <td>
            <center><b>IP</b></center>
          </td>
          <td>
            <center><b>Seconds Connected</b></center>
          </td>
          <td>
            <center><b>User Agent</b></center>
          </td>
          <td>
            <center><b>Action</b></center>
          </td>
        </tr>
        <tr>
          <td align="center">68.7.238.55</td>
          <td align="center">995</td>
          <td align="center">WinampMPEG/5.62, Ultravox/2.1</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2690">Kick</a></td>
        </tr>
        <tr>
          <td align="center">74.82.68.16</td>
          <td align="center">595</td>
          <td align="center">Mozilla/4.8 [en] (Windows NT 5.0; U)</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2704">Kick</a></td>
        </tr>
        <tr>
          <td align="center">74.82.68.16</td>
          <td align="center">593</td>
          <td align="center">Mozilla/4.8 [en] (Windows NT 5.0; U)</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2709">Kick</a></td>
        </tr>
        <tr>
          <td align="center">74.82.68.17</td>
          <td align="center">316</td>
          <td align="center">Mozilla/4.8 [en] (Windows NT 5.0; U)</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2718">Kick</a></td>
        </tr>
        <tr>
          <td align="center">74.82.68.18</td>
          <td align="center">216</td>
          <td align="center">Mozilla/4.8 [en] (Windows NT 5.0; U)</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2735">Kick</a></td>
        </tr>
      </tbody>
    </table>
    <br>
    <br>
    Finally, after over 300 seconds, the threads are finally cleaned up.<br>
    <br>
    <table border="1" cellpadding="5" cellspacing="0">
      <tbody>
        <tr>
          <td>
            <center><b>IP</b></center>
          </td>
          <td>
            <center><b>Seconds Connected</b></center>
          </td>
          <td>
            <center><b>User Agent</b></center>
          </td>
          <td>
            <center><b>Action</b></center>
          </td>
        </tr>
        <tr>
          <td align="center">68.7.238.55</td>
          <td align="center">1139</td>
          <td align="center">WinampMPEG/5.62, Ultravox/2.1</td>
          <td align="center"><a
href="http://www.airprogressive.org:8000/admin/killclient.xsl?mount=/stream&id=2690">Kick</a></td>
        </tr>
      </tbody>
    </table>
    <br>
    So, to stop icecast server from communicating with the Blackberry
    handset, you must either turn it off or disable mobile network for
    at least 5 minutes.<br>
    <br>
    It appears that the handset continues to transfer data (and
    therefore incur charges, if the user does not have an unlimited data
    plan) if the handset is not turned off or mobile network disabled
    for at least five minutes. It also runs down the battery much faster
    because the radio transmitter is actively being used, even if the
    user is not listening to the stream.<br>
    <br>
    The Blackberry network has intervening servers that continue to
    receive data from the icecast server even if the handset is off.
    This behavior likely has utility to deal with the realities of the
    cellphone network, to allow the stream to be transferred from one
    cell to another, and deal with the possibility that the handset may
    be out of range for up to 5 minutes without "interruption." However,
    it is hard to turn off the stream.<br>
    <br>
    I looked at the icecast sourcecode and there is no use of cookies or
    any identifier (that I could see) when managing the listener
    threads. <br>
    <br>
    QUESTIONS:<br>
    1. I am curious why two listener entries are created for each
    Blackberry listener. Ideas?<br>
    2. I don't have any theory as to why new threads are started even
    though the old threads persist. (they continue redundantly until the
    handset is turned off for at least 5 minutes, which appears only to
    bog down the icecast server with unnecessary listener threads).
    Ideas?<br>
    3. Is there any good way to deal with this? I was thinking the
    following might be possible:<br>
        a. maintain a cookie on the user device (Blackberry Browser)
    related to each thread that is started.<br>
        b. If the user attempts to start more than one thread, kill any
    old threads, update the cookie.<br>
        c. Provide a way to kill the thread from the browser interface,
    such as sending a message to the server when the user exits the web
    page, utilizing cookie information.<br>
        comments??<br>
    <br>
    THANKS!<br>
    <br>
    --Ray Lutz<br>
    <br>
    <pre class="moz-signature" cols="72">-- 
---------------------------------------
Raymond Lutz
Cognisys, Inc.                
1010 Old Chase Ave., Bldg B             
El Cajon (San Diego Cty), CA 92020 USA
Voice 619-447-3246
http//www.cognisys.com</pre>
  </body>
</html>