Up
Down
Return

Nicecastでストリーミング

Debian GNU/Linuxでicecast+shoutでmp3のストリーミングの話はすでにここに書いてあるのですが、プロセッサがCeleron 400MHzでは音が途切れたりすることがあり、安心して聞くにはいまいちの状態でした。
そこで、Mac miniの方がパワーがあるので、Mac OS Xで動くストリーミング・ソフトを探し、Nicecastを見つけました。これは有償の商品なので、本来ならば選考対象外なのですが扱いやすさと音の安定性に惹かれて買ってしまいました。Nicecastは、icecast + shoutの組み合わせで言えばicecastに相当する機能を果たすソフトで、shoutに相当する機能にはiTunesが使えます。

mp3ファイルはNASに蓄積しているのですが、これをsambaでマウントしてストリーミングすると100MbpsといってもLANが混雑しそうなので、どうしたものかと思っていました。ちょうど60GのiPodを80Gのものに代えたところだったのでこれをUSB接続のHDDとして使うことにしました。理屈上、USB 2.0のHigh Speedモードは480Mbpsで転送されるようですが実態は不明。新しいアルバムをいちいちNASからiPodへコピーしないとストリーミングはできないというのはちょっと手間なのですが、これは我慢するしかない。iTunesにPlaylistを作り再生開始。

Nicecastをインストールして起動し、XMMSなどで聞こうとするとバッファにため込むところまでは行くのですが、ビビッという音だけで曲が流れないという現象が起こりました。これは開発・販売しているRogue Amoeba Softwareのサイトで「Skipping」と表現されているもののようです。マニュアルの「The 10 Second Guide to Performance Tuning Nicecast (Stop Skipping)」によれば、

Although Nicecast isn't as CPU intensive as some applications, it does require a fair amount of power, especially on older machines. While there are many aspects to Nicecast performance tuning, there are a couple simple changes that can prove effective in improving stream quality and reducing skipping.
1. Reduce Broadcast Quality
In the Quality drawer, pick your normal bitrate, but put the "CPU Usage/Audio Quality" slider all the way to the left. The Encoding Quality slider is the biggest factor when it comes to CPU usage in Nicecast. Although you can achieve some amazing feats of audio compression with it up high, down low things will still sound ok, and your CPU won't melt.
2. Reduce Broadcast Bitrate
Pick any bitrate lower then the one you are using now. Continue moving down, until performance becomes acceptable. After Encoding Quality (item #1), Encoding Bitrate is the second biggest CPU factor. Lower bitrates are always easier, and thus faster, for Nicecast to encode.
3. Turn The Nicecast Dock Icon Preferences Off
Although it looks neat, updating the Dock icon once a second comes with a small performance penalty. Turning this off will save CPU.
4. Don't Leave Stray Effects On
If you aren't using an Effect, remove it from the patch, or atleast Bypass it. Any un-bypassed Effect in the patch will have audio piped through it, and even if the Effect doesn't actually do anything (like an EQ set to flat), it still taking up cycles.
5. Perfomance Tune iTunes
iTunes has never been known for being lightweight, but with a bit of chopping you can get it running decently. First, if you haven't already, turn the Sound Enhancer off. Do the same for the inline-visualizer at the top of the main window. If you have any 3rd party plugins, you should try turning them off too. Finally, switch iTunes to mini-mode, by clicking the Zoom button.
Hopefully these tips will allow Nicecast to run reliably on your machine. It should be possible for it work fine on any G4, and even higher end G3s. As with any performance tuning work, you should spend time measuring the effect of your changes. Use Activity Monitor or top to watch Nicecast's performance both before and after changing a setting.

ということだそうで、全部やってみました。

  1. 「CPU Usage/Quality」の10ある目盛りの7つ目にセット:ってことは結構リソースを使う事になるはずですが…。
  2. Nicecastの「Quality」の「Bitrate」を64Kbpsから32Kbpsに下げ:ちょっとトホホですが聞いてみると特に差は感じられず
  3. 「Preferences」の「Dock Icon」の二項目をともにチェックを外し
  4. Effectは試しに入れてみたものを全部削除しました。
  5. iTunesはこの記述どおり重いソフトですね。もともとここに書いてあるような視覚効果などは全部外していたので 追加で行うことはありませんでした。

最後に、備忘録:延々と流し続けるには、iTunesのプレイリストを選択し「制御」-「全項目リピートする」にチェックを付けておかないと、プレイリストにある曲をすべて流すとiTunesの再生は停止しますから、Nicecastのストリーミングも停まってしまいます。