我想在 Icecast2 + ices2 上制作播客。我的目标是播放耳机中正在播放的音乐。我的声音服务器是 Pulseaudio,声音系统是 Alsa。
Icecast2 和 ices2 已成功加载,并且根据日志,ices2 已连接到 Icecast2。
在 Icecast 管理页面上,我看到了 ices2 的挂载点。在该 MP 中,我有一个播放器小部件,但它什么也不播放。当我按下“||”按钮时,它会变成“>”,但我什么也听不到。
如果我下载 m3u 并在 Audacious 中打开它,我可以看到“缓冲”并且仍然听不到任何声音。
在挂载点统计信息中写道,total_bytes_read = 一些千字节,但 total_bytes_sent - 始终为 0。
ices2配置:
<?xml version="1.0"?>
<ices>
<background>1</background>
<logpath>/var/log/ices</logpath>
<logfile>ices.log</logfile>
<!-- 1=error,2=warn,3=info,4=debug -->
<loglevel>4</loglevel>
<!-- set this to 1 to log to the console instead of to the file above -->
<consolelog>0</consolelog>
<!-- optional filename to write process id to -->
<!-- <pidfile>/home/ices/ices.pid</pidfile> -->
<stream>
<metadata>
<name>AlexRsk podcast</name>
<genre>blah-blah-blah</genre>
<description>blah-blah</description>
</metadata>
<input>
<module>alsa</module>
<param name="rate">44100</param>
<param name="channels">1</param>
<param name="device">pulse</param>
<param name="metadata">1</param>
<param name="metadatafilename">/home/alexrsk/ices2/metadata</param>
</input>
<instance>
<hostname>localhost</hostname>
<port>8000</port>
<password>bandersnatches</password>
<mount>/alexrsk.ogg</mount>
<reconnectdelay>2</reconnectdelay>
<reconnectattempts>5</reconnectattempts>
<maxqueuelength>80</maxqueuelength>
</instance>
</stream>
</ices>
Icecast2 配置
<icecast>
<location>Russia</location>
<admin>[email protected]</admin>
<limits>
<clients>100</clients>
<sources>2</sources>
<threadpool>5</threadpool>
<queue-size>524288</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
<burst-on-connect>1</burst-on-connect>
<burst-size>65535</burst-size>
</limits>
<authentication>
<source-password>bandersnatches</source-password>
<relay-password>bandersnatches</relay-password>
<admin-user>alexrsk</admin-user>
<admin-password>my123pass</admin-password>
</authentication>
<hostname>localhost</hostname>
<listen-socket>
<port>8000</port>
<bind-address>0.0.0.0</bind-address>
</listen-socket>
<fileserve>1</fileserve>
<paths>
<basedir>/etc/icecast2</basedir>
<logdir>var/log/icecast2</logdir>
<webroot>/etc/icecast2/web</webroot>
<adminroot>/etc/icecast2/admin</adminroot>
<alias source="/" destination="/status.xsl"/>
</paths>
<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<loglevel>4</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
<logsize>10000</logsize> <!-- Max size of a logfile -->
</logging>
<security>
<chroot>0</chroot>
<changeowner>
<user>nobody</user>
<group>nogroup</group>
</changeowner>
</security>
</icecast>
我现在已经尝试在 ices2 配置的“模块”部分中进行更改,
脉冲至“default”、“hw:0,0”、hw:0,1、plughw:0,0。结果为空。aplay -l 的输出
Card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 1/1
Subdevice №0: subdevice #0
Card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
Subdevices: 1/1
Subdevice №0: subdevice #0
任何帮助,将不胜感激
答案1
问题解决了。就我而言,关键是<encode>
ices 配置中的部分。当我添加
<encode>
<nominal-bitrate>64000</nominal-bitrate>
<samplerate>44100</samplerate>
<channels>2</channels>
</encode>
并按如下方式配置输入:
<input>
<module>alsa</module>
<param name="rate">44100</param>
<param name="channels">2</param>
<param name="device">default</param>
<param name="periods">0</param>
<param name="buffer-time">500</param>
<param name="metadata">1</param>
<param name="metadatafilename">/home/alexrsk/ices2/metadata</param>
</input>
然后一切似乎都正常了。