Думаю расписывать как поднять звук и фм-тюнер не стоит, дело индивидуальное, лично у меня звук ess-1868, фм-тюнер - soundforge SF16-FMR2, все ISA. В общем начало - это звук, подняли ок, для моего тюнера подошел fmio, у него есть список поддерживаемых девайсов, тоже ок.
В тюнер воткнули антенну, соединили выход тюнера с линейным входом звуковой, на выходе слушаем радио.
После этого ставим darkice http://darkice.sourceforge.net/ для закачки потока на icecast2 http://www.icecast.org/, я поставил последние версии. icecast2 для вещания в сеть. В инструкции все подробно расписано, какие библиотеки они требуют, у меня все встало из портов без проблем. Единственно что при ./configure darkice надо указать --with-vorbis-prefix=/usr/local, иначе оно ищет либы в /usr/lib, а они у меня встали в /usr/local/lib. После установки darkice и icecast2 в /usr/local/etc появились их конфиги, darkice.cfg и icecast.xml соответственно.
У меня так:
darkice.cfg
# sample DarkIce configuration file, edit for your needs before using
# see the darkice.cfg man page for details
# this section describes general aspects of the live streaming session
[general]
duration = 0 # duration of encoding, in seconds. 0 means forever
bufferSecs = 5 # size of internal slip buffer, in seconds
# this section describes the audio input that will be streamed
[input]
device = /dev/dsp # OSS DSP soundcard device for the audio input
sampleRate = 22050 # sample rate in Hz. try 11025, 22050 or 44100
bitsPerSample = 16 # bits per sample. try 16
channel = 2 # channels. 1 = mono, 2 = stereo
# this section describes a streaming connection to an IceCast2 server
# there may be up to 8 of these sections, named [icecast2-0] ... # these can be mixed with [icecast-x] and [shoutcast-x] sections
[icecast2-0]
bitrateMode = abr # average bit rate
format = vorbis # format of the stream: ogg vorbis
bitrate = 112 # bitrate of the stream sent to the server
server = 127.0.0.1 # host name of the server
port = 8000 # port of the IceCast2 server, usually 8000
password = 111111 # source password to the IceCast2 server
mountPoint = sigma.ogg # mount point of this stream on the IceCast2 server name = FM radio Sigma # name of the stream
description =           # description of the stream
url = http://www.muzic.sigma # URL related to the stream
genre = various # genre of the stream
public = yes # advertise this stream?
quality = 0.8 # encoding quality
тут реально поиграться настройками можно sampleRate и bitrate, разницу при 22050 и 44100 заметно на слух, но и нагрузка на проц тоже выше. Кстати все равно что пень 500-й что целерон 500-й, видимо только от частоты зависит, а т.к. у меня не только радио а еще куча всего я пока ограничился худшим качеством. bitrate имхо никакой разницы, но у меня свои проблемы со слухом, наверно чтото больше медведя мне на ухо наступило :).
icecast.xml
<icecast>
    <limits>
        <clients>100</clients>
        <sources>2</sources>
        <threadpool>5</threadpool>
        <queue-size>102400</queue-size>
        <client-timeout>30</client-timeout>
        <header-timeout>15</header-timeout>
        <source-timeout>10</source-timeout>
    </limits>
    <authentication>
        <!-- Sources log in with username 'source' -->
        <source-password>111111</source-password>
        <!-- Relays log in username 'relay' -->
        <relay-password>111111</relay-password>
        <!-- Admin logs in with the username given below -->
        <admin-user>admin</admin-user>
        <admin-password>111111</admin-password>
    </authentication>
    <!-- Uncomment this if you want directory listings -->
    <!--
    <directory>
        <yp-url-timeout>15</yp-url-timeout>
        <yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url>
    </directory>
    <directory>
        <yp-url-timeout>15</yp-url-timeout>
        <yp-url>http://www.oddsock.org/cgi-bin/yp-cgi</yp-url>
    </directory>
    <directory>
        <yp-url-timeout>15</yp-url-timeout>
        <yp-url>http://yp.icecast.net/cgi-bin/yp.cgi</yp-url>
    </directory>
     -->
    <hostname>localhost</hostname>
    <!-- You can use these two if you only want a single listener -->
    <port>8000</port>
    <bind-address>127.0.0.1</bind-address>
    <!-- You may have multiple <listener> elements -->
    <listen-socket>
        <port>8000</port>
        <bind-address>192.168.100.2</bind-address>
    </listen-socket>
    <listen-socket>
        <port>8001</port>
    </listen-socket>
    <!--<master-server>127.0.0.1</master-server>-->
    <!--<master-server-port>8001</master-server-port>-->
    <!--<master-update-interval>120</master-update-interval>-->
    <!--<master-password>111111</master-password>-->
    <!--
    <relay>
        <server>127.0.0.1</server>
        <port>8000</port>
        <mount>/sigma.ogg</mount>
        <local-mount>/mystream.ogg</local-mount>
        <relay-shoutcast-metadata>0</relay-shoutcast-metadata>
    </relay>
    -->
    <!-- Only define a <mount> section if you want to use advanced options,
         like alternative usernames or passwords
      -->
    <mount>
        <mount-name>icy0</mount-name>
        <username></username>
        <password></password>
        <max-listeners>1</max-listeners>
        <!-- <dump-file>/tmp/dump-example1.ogg</dump-file> -->
        <fallback-mount>/example2.ogg</fallback-mount>
    </mount>
    <fileserve>1</fileserve>
    <paths>
        <basedir>/usr/local/icecast</basedir>
        <!-- Note that if <chroot> is turned on below, these paths must both
             be relative to the new root, not the original root -->
        <logdir>/usr/local/icecast</logdir>
        <webroot>/usr/local/share/icecast/web</webroot>
        <adminroot>/usr/local/share/icecast/admin</adminroot>
        <pidfile>/usr/local/icecast/icecast.pid</pidfile>
        <!-- Aliases: treat requests for 'source' path as being for 'dest' path
             May be made specific to a port or bound address using the "port"
             and "bind-address" attributes.
          -->
        <!--
        <alias source="/foo" dest="/bar"/>
          -->
    </paths>
    <logging>
        <accesslog>access.log</accesslog>
        <errorlog>error.log</errorlog>
      	<loglevel>1</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
    </logging>
    <security>
        <chroot>0</chroot>
        <!--
        <changeowner>
            <user>admin</user>
            <group>wheel</group>
	</changeowner>
        -->
    </security>
</icecast>
тут я особо ничего не менял, только указал куда цепляться, с каким паролем и какой поток тянуть, куда логи валить, оно их несколько может обслуживать, потоков.
запуск:
первым запускается icecast2, под юзером отличным от root-а, лично я сделал admin, группа wheel, из под него все ок.
/usr/local/bin/icecast -c /usr/local/etc/icecast.xml &
darkice можно root-ом
/usr/local/bin/darkice -c /usr/local/etc/darkice.cfg 2>&1 &
darkice слушает девайс на звуковой, включенный на запись, у меня по умолчанию почему то это микрофон, поэтому:
mixer =rec line
Тут бы и все ок, но при прослушивании потока winamp-ом (версия 2.95 и выше) (в playlist-е add->add url там пишем напр. 192.168.100.2:8000/sigma.ogg (см. mountPoint в darkice.cfg)), обнаружилось, что вещание ведется на слишком большом уровне записи, индикацию winamp-а зашкаливает, это как на древних магнитофонах,
где этот уровень при записи надо было выставлять вручную. Чем его понизить програмно я не нашел, воспроизведение тем же mixer, а вот записи... :(. Положение спас тот же принцип, что и в магнитофонах, а именно простой переменный сдвоенный (стерео все таки) резистор на 22К, включенный как делитель в цепь между выходом тюнера и линейным входом звуковой.
Это все. Замечания, поправки?
PS. еще есть желание поднять видео вещание на радость охране ночью, avi там и все такое, есть какие мысли насчет этого? Можно конечно и расшарить просто, но тогда народ все себе на локальный винт тянет...
icq 34210147