我想在Icecast2 + ices2上做播客。我的目标是在我的耳机中播放目前正在播放的音乐。我的声音服务器是脉冲音频,声音系统是阿尔萨。
Icecast2和ices2已经成功加载,根据日志,ices2连接到Icecast2。
在Icecast管理页面上,我看到了来自ices2的挂载点。在那个MP中,我有一个播放器的小部件,但是它什么也不播放。当我按下“回车”按钮时,它会更改为">",但我什么也没听到。
如果我下载m3u并大胆地打开它,我就能看到“缓冲”,仍然什么也听不见。
在挂载点统计信息中,total_bytes_read =一些In,但是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>your@address.com</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配置中更改“模块”部分,
脉冲到“默认”,"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如能提供任何帮助,将不胜感激。
发布于 2022-07-07 18:20:49
问题解决了。在我的例子中,关键是ices配置中的<encode>部分。当我加入
<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>那么一切似乎都正常了。
https://serverfault.com/questions/1105009
复制相似问题