dev-serveez
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dev-serveez] icecast; yet another guile question


From: stefan
Subject: [dev-serveez] icecast; yet another guile question
Date: Fri, 24 May 2002 14:58:19 +0200 (CEST)

Hello Serveez'ers,

the CVS now contains one more guile server - a simplified
icecast-compatible server.  Can you please play around with it and tell me
how to improve it; or even bug-fix it?

You may try something like this for a voice-over-ip-setup:

$ mkfifo voip.mp3
$ sox -t ossdsp -w -s /dev/audio -t wav - | lame -a -f -b 32 - > voip.mp3

Then start the icecast server.  The client maybe xmms:

$ xmms http://host:8000

Is this setup possible?  I could not test it (no alsa; for concurrent
i/o).

Also I bumped into a guile performance problem unable to solve:  the
following piece of code reads bytes from an input port.

;; old *VERY SLOW* read
(define (icecast-readbuffer-snail port size)
  (let loop ((chars '()) (n 0))
    (let ((char (read-char port)))
      (if (or (>= n size) (eof-object? char))
          (list->string (reverse! chars))
          (loop (cons char chars) (1+ n))))))

But it is sooooooooo slow and cpu consuming.  It was unusable for the
icecast server.  At my 233mhz mobile pentium one file only locked up all
the machine (100% cpu all time).

My solution is to implement my own readfile in serveez and export it to
guile:

;; read part of a file
(define (icecast-readbuffer port size)
  (svz:read-file port size))

This routine takes as much as no time at my computer.

My question now:  Is guile file i/o meant to be slow; or did I just use
the wrong procedures?

Thanks in advance,
        address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]