个人的Linux唠叨——音乐播放器

捡起来唠叨一次:),发现看我blog的人(都是google来的啦),大部分关注我那个ati显卡的,可惜……那个没有啥教程性的内容……其次就是一个kimpanel的faq啦,就是希望用kimpanel的人能够少走些弯路:)

进入正题

我用linux也蛮久了,听歌始终是一个重要需求,首先和往常一样,先列出吐嘈对象,然后再吐嘈。

用过的:MPD,quodlibet,Amarok,Juk,rythmbox,songbird,xmms,mplayer

没用过的,就不提了:banshee,deadbeef,lxmusic

我用linux开始,一开始搜索教程时就看见了xmms,于是拿来用,中文支持好差,设置字体竟然要输入一长串不知道是什么的东西描述字体,使用体
验奇差无比……而且正好赶上fedora中xmms mp3支持从官方移除……郁闷的要死。

然后用了什么我都不记得了,有段时间用了rythmbox,无语了它的编码,我无限次改了一首歌的编码,结果就是搞不定,扔了扔了。

期间有段时间实在不记得了,抱歉……然后貌似就是用起了mpc,mpc不得不说是个好东西,各种前段满足需求,用过的前端有
sonata,qmpdclient,都不错,sonata相当顺手,不过后来还是不用了……不过mpc最大的功能就是:远程听歌!我在我实验室的电脑上
配置了mpd+icecast,由于我笔记本硬盘太小,没空装我这些歌,于是就用了这个功能,呆会给个配置教程:)

用起了quodlibet之后,发现这才是万能解决mp3编码问题的专家,实在很爽!各种功能都不错,插件也不少,很能满足我的需求,不过我后来小
小的洁癖发作,还是用起了amarok。

转向kde之后就在amarok和juk之间游移,juk最让我不爽的就是有时候界面会完全混乱掉,后来也就不用了,这个实在太鸡肋。

有段时间听说songbird不错,实验之后没少崩溃,就扔了……现在也许好了……

amarok始终是我的最爱,最喜欢的就是它的动态播放列表,看一看我的设置是这样的:

这样就让我喜欢的歌占大多数了:)

amarok也曾让我抛弃了几次,就是因为编码问题,不过现在我使用quodlibet解决编码,amarok播放,一直不错:)

下面说一说icecast和mpd的配置:

<icecast>
<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>
<!– If enabled, this will provide a burst of data when a client
first connects, thereby significantly reducing the startup
time for listeners that do substantial buffering. However,
it also significantly increases latency between the source
client and listening client.  For low-latency setups, you
might want to disable this. –>
<burst-on-connect>1</burst-on-connect>
<!– same as burst-on-connect, but this allows for being more
specific on how much to burst. Most people won’t need to
change from the default 64k. Applies to all mountpoints  –>
<burst-size>65535</burst-size>
</limits>

<authentication>
<!– Sources log in with username ‘source’ –>
<source-password>hackme</source-password>
<!– Relays log in username ‘relay’ –>
<relay-password>hackme</relay-password>

<!– Admin logs in with the username given below –>
<admin-user>admin</admin-user>
<admin-password>hackme</admin-password>
</authentication>

<!– set the mountpoint for a shoutcast source to use, the default if not
specified is /stream but you can change it here if an alternative is
wanted or an extension is required
<shoutcast-mount>/live.nsv</shoutcast-mount>
–>

<!– 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>
–>

<!– This is the hostname other people will use to connect to your server.
It affects mainly the urls generated by Icecast for playlists and yp
listings. –>
<hostname>localhost</hostname>

<!– You may have multiple <listener> elements –>
<listen-socket>
<port>8000</port>
<!– <bind-address>127.0.0.1</bind-address> –>
<!– <shoutcast-mount>/stream</shoutcast-mount> –>
</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>hackme</master-password>–>

<!– setting this makes all relays on-demand unless overridden, this is
useful for master relays which do not have <relay> definitions here.
The default is 0 –>
<!–<relays-on-demand>1</relays-on-demand>–>

<!–
<relay>
<server>127.0.0.1</server>
<port>8001</port>
<mount>/example.ogg</mount>
<local-mount>/different.ogg</local-mount>
<on-demand>0</on-demand>

<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>/example-complex.ogg</mount-name>

<username>othersource</username>
<password>hackmemore</password>

<max-listeners>1</max-listeners>
<dump-file>/tmp/dump-example1.ogg</dump-file>
<burst-size>65536</burst-size>
<fallback-mount>/example2.ogg</fallback-mount>
<fallback-override>1</fallback-override>
<fallback-when-full>1</fallback-when-full>
<intro>/example_intro.ogg</intro>
<hidden>1</hidden>
<no-yp>1</no-yp>
<authentication type=”htpasswd”>
<option name=”filename” value=”myauth”/>
<option name=”allow_duplicate_users” value=”0″/>
</authentication>
&nbs
p;      <on-connect>/home/icecast/bin/stream-start</on-connect>
<on-disconnect>/home/icecast/bin/stream-stop</on-disconnect>
</mount>

<mount>
<mount-name>/auth_example.ogg</mount-name>
<authentication type=”url”>
<option name=”mount_add”       value=”http://myauthserver.net/notify_mount.php”/>
<option name=”mount_remove”    value=”http://myauthserver.net/notify_mount.php”/>
<option name=”listener_add”    value=”http://myauthserver.net/notify_listener.php”/>
<option name=”listener_remove” value=”http://myauthserver.net/notify_listener.php”/>
</authentication>
</mount>

–>

<fileserve>1</fileserve>

<paths>
<!– basedir is only used if chroot is enabled –>
<basedir>/usr/share/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>/log</logdir>
<webroot>/web</webroot>
<adminroot>/admin</adminroot>
<!– <pidfile>/usr/share/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”/>
–>
<!– Aliases: can also be used for simple redirections as well,
this example will redirect all requests for http://server:port/ to
the status page
–>
<alias source=”/” dest=”/status.xsl”/>
</paths>

<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<!– <playlistlog>playlist.log</playlistlog> –>
<loglevel>3</loglevel> <!– 4 Debug, 3 Info, 2 Warn, 1 Error –>
<logsize>10000</logsize> <!– Max size of a logfile –>
<!– If logarchive is enabled (1), then when logsize is reached
the logfile will be moved to [error|access|playlist].log.DATESTAMP,
otherwise it will be moved to [error|access|playlist].log.old.
Default is non-archive mode (i.e. overwrite)
–>
<!– <logarchive>1</logarchive> –>
</logging>

<security>
<chroot>1</chroot>
<changeowner>
<user>nobody</user>
<group>icecast</group>
</changeowner>
</security>
</icecast>

几乎就是默认配置,不过使用了一个group

然后看看我的mpd配置:

music_directory       “/home/saber/音乐/”         # Your music dir.
playlist_directory    “/var/lib/mpd/playlists”
db_file               “/var/lib/mpd/db”
log_file              “/var/log/mpd/mpd.log”
error_file            “/var/log/mpd/mpd.error”
pid_file              “/var/run/mpd/mpd.pid”
state_file            “/var/lib/mpd/mpdstate”
user                  “mpd”

audio_output {
type        “shout”
encoding    “ogg”
name        “my cool stream”
host        “localhost”
port        “8000”
mount       “/mpd.ogg”

# This is the source password in icecast.xml
password    “hackme”

# Set either quality or bitrate
#   quality     “5.0”
bitrate     “64”

format      “44100:16:1”

# Optional Paramters
user        “source”
#   description “here’s my long description”
#   genre       “jazz”
} # end of audio_output

audio_output {
type            “null”
name            “My Null Output”
}

# Need this so that mpd still works if icecast is not running
#audio_output {
#    type “alsa”
#    name “fake out”
#    driver “null”
#}

怎么样,是不是很简单:)

这两个都是利用系统服务启动的,如果是用户态还请自行修改。

安装了mpd,icecast,平时只要上http://ip:8000/就可以用m3u播放歌曲啦~

在宿舍听歌时用sonata控制,虽然有10秒钟的切换歌曲的延迟不过也ok:)

mplayer有时拿来临时播放,没有管理功能还是不喜欢……

以后再慢慢捡起来这个系列的文章喽

This entry was posted in 个人Linux唠叨 and tagged , , , , . Bookmark the permalink.

3 Responses to 个人的Linux唠叨——音乐播放器

  1. qii says:
    Unknown Unknown

    一开始看好amarok2,wiki都写了(http://wiki.ubuntu.org.cn/Amarok),在经历几个版本升级后,尤其是最新版预览视频的隐藏菜单栏/状态栏欺骗了我,我坚定的认为amarok2是渣。

    [Reply]
  2. CS Slayer says:
    Unknown Unknown

    平时听歌都是系统托盘状态……界面爱怎么地怎么地……
    -_-+

    [Reply]
  3. Lynx says:
    Firefox 3.6.13 Ubuntu 10.04

    有一个播放器您没有提到,不过建议用一下试试。
    叫moc, music on console
    在X下的虚拟终端完美支持中文和日文//当然我是指utf8编码的
    在tty下通过zhcon也可以较好的支持中文和日文。
    命令行名称是mocp

    [Reply]

Leave a Reply

Your email address will not be published. Required fields are marked *

Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).

This site uses Akismet to reduce spam. Learn how your comment data is processed.