• Welcome to SCdev.org. Please log in.

Welcome to the new SCdev forums!

Setup your own Shoutcast Proxy for Streaming in DSOrganize

Started by liquoredonlife, September 07, 2006, 07:56:20 PM

Previous topic - Next topic

liquoredonlife

Updates
09/07/2006 - Initial Post

Liquoredonlife's Current setup:

DS Lite
SuperKey
Supercard Lite v1.63
Sandisk 1GB microSD
D-Link DI-524 wifi router (fixed IP, unsecured)
DS Organize Blue 2.25 patched with Moomshell patcher

Summary:

One of my favorite radio streams is hosted on DigitallyImported and it streams mp3 quality at 96kbps. It worked fine with the supplied stream pls file for about 5 seconds before having to rebuffer again. I didn't want to tweak the IP fragmentation and RTS threshold in my wifi router (because it appears this affects all network traffic, not just wireless), so I figured out a workaround.

Essentially, the following explains how to setup a server to buffer the steam and allow you to reencode at a lower bitrate before allow your DS to grab the stream off your comp (like a proxy). Then you download the stream.pls file through your browser (navigated to your computer) and put it on your DS to open in DSOrganize.

Walkthrough:

1) Download Winamp - here (lite version)

2) Install Winamp Lite.

3) Download Shoutcast DSP plugin - here

4) Install it into the same directory as Winamp - usually c:\program files\winamp

5) Download Shoutcast Server - here

6) Install Shoutcast Server, Run shoutcast server

7) Configure Shoutcast Server - click "Edit config" in the title bar. It will load a text editor with the config file. I changed the maxUsers to 3, password, and PortBase to 80. 80 is the default port for webtraffic and won't work if you're also running a webserver. You can generally leave it at the default 8000 though. Save, close and restart the shoutcast server.

8) Open winamp and open your stream.pls file. Play it and hear it through your speakers just to make sure it works. Here is a sample. Leave it playing.

9) Now go to preferences (CTRL+P), navigate to Plug-ins -> DSP/Effect. You should see Nullsoft SHOUTcast Source DSP v1.9.0 [dsp_sc.dll]. Click this, and a new window will open.

10) At the top are 4 tabs- Main, Output, Encoder, Input

Click the Output tab, select Output1. Use the following:

Address: localhost
Port: 8000 (or what you set in the shoutcast server preferences)
Password: changeme (or what you set in the shoutcast server preferences)
Encoder: 1

Click Encoder tab, select Encoder1. Select MP3Encoder as Encoder Type.

Now here's where things may take some experimentation. Currently I have my stream encoding at 48kbps, 22.050kHz, Stereo. Try this for now, but be prepared to mess with this later on.

Okay, now go to the Input tab and make sure Input Device is set on Winamp. You should see the Input Levels rising up and down. Then go back to Output and click Connect.

Under Status, it should show you connected with data transferring.

11) Now you need the local IP address of your computer. If you're behind a router, it's probably something like 192.168.xxx.xxx. To find out, click start, run, type cmd. Then type: ipconfig and write down your IP Address. E.g., mine is 192.168.0.103.

Okay, so now start up your browser. Recall your Shoutcast port number. If you left it at 8000, go to: http://localhost:8000. A webpage should show up with SHOUTcast D.N.A.S. Status at the top. Save the file from "Listen." It is named listen.pls.

12) Edit listen.pls in a text editor like notepad. It will probably look something like:

[playlist]
NumberOfEntries=1
File1=http://localhost:8000/

You need to change localhost to your IP address.

[playlist]
NumberOfEntries=1
File1=http://192.168.0.103:8000/

So something like that.

13) Save the file, and now put it on your DS. Open it up in DSOrganize and start listening! Course, you probably want to turn off the volume from your PC to hear your DS, but now you can literally stick on some headphones, put the DS in your pocket and listen. :]

14) You could technically make it so you can access the stream elsewhere, from wifi hotspots or whatnot, but that is a bit beyond the scope of this article. It requires knowing how to configure your router for port forwarding. I may address this later when I have time to thoroughly test it.

Notes from the field:

Currently as stated, I'm using 48kbps, 22khz, Stereo. This seems to generally work fine, and my buffer stays over 100% in DSO. After a 5-15 minutes, it starts to dwindle very slowly and rebuffering occurs. The quality through canal earphones is pretty good though. Sometimes the stream will stop altogether and not play sound again upon attempting to start it up again. This requires a restart of DSO and everything works again. I get better, less interrupted music with the shell closed and listening through earphones.

So far, I haven't been able to stream for longer than 30 minutes uninterrupted, but this is likely due to the wifilib. As it improves, this should too. :]

ShinaKitsune

Awesome writeup, thanks a ton.
I do have a question though. I am using the same settings for the reincode downgrade (48kbps, 22khz, stereo) but i get tons of crackles and pops. have any idea why?
b]~VisualKei J-Rock Fanatic~[/b]
Electric Blue DS "phat" + supercard minisd + 1gb kingston
Coral Pink DSLite + supercard microsd + 1gb a-data

liquoredonlife

I'm assuming you don't get this sort of distortion while listening to the stream in Winamp through your PC speakers, so my guess is that if you look in the Input tab in the SHOUTcast plugin, the Input levels are near max. If they are, you may have to adjust your volume somewhere - either in winamp itself or sound volume preferences (double click speaker icon).

bitblt

Nice work. I think this is good enough to go in the FAQ/How To forum. Moved.

ShinaKitsune

Quote from: "liquoredonlife"I'm assuming you don't get this sort of distortion while listening to the stream in Winamp through your PC speakers, so my guess is that if you look in the Input tab in the SHOUTcast plugin, the Input levels are near max. If they are, you may have to adjust your volume somewhere - either in winamp itself or sound volume preferences (double click speaker icon).
err, thanks i didn't even think about that, and yes in winamp they were maxed.
edit: no matter what i do with the sound settings it has the input levels hovering at around -2db.
b]~VisualKei J-Rock Fanatic~[/b]
Electric Blue DS "phat" + supercard minisd + 1gb kingston
Coral Pink DSLite + supercard microsd + 1gb a-data

liquoredonlife

Yeah, this happened on my desktop computer too. Couldn't figure out how to get it 'unstuck' from being at 0db. So I moved it to my laptop and it worked fine. I'm still not sure exactly what is causing it, though there's plenty of room to speculate. I use my desktop plenty for voicechat so I didn't want to keep it on there.

Vanit

Great tutorial and that... but one of the major problems is that its very hard to maintain a stream and every 30 seconds your DS will get cut off the music. Additionally everytime it reconnects from that it takes up another slot in the server so in a matter of minutes you find yourself still listening to music in a painful manner with a full shoutcast server stopping you from reconnecting.

SO. I highly recommend as an alternative to this tutorial using a program called SylphAMP written by ficedula which adds a plugin to winamp which simply streams what music your listening to in winamp to your DS. No annoying server setup at all, just start up winamp with the music you want and click play, then load up the receiving program on your DS. There are no streaming errors at all or anything and fice said he could get up to a 3000 song playlist so no problems there.

Of course the shoutcast method will be needed if you wish to stream music to your DS when you're at a random AP, but for local purposes SylphAMP is definitely the winner. Sorry, liquoredonlife.

ShinaKitsune

It doesn't cut off every 30 seconds if you downgrade the encoding. Once you get this way set up its pretty painless the next time. I don't thing sylphamp is a "winner" they both work, one is easier for local, one has a scope of listening to your music thats on your comp on your ds from a remote AP.
edit: i just tried SylphAMP its kinda neat, but it freezes alot for me and keeps randomly going to the next song on my playlist. (which could be all my doing because I have a lot of songs titles in japanese) Will be interesting to see where the project goes. I also like the shoutcast way because you can just set it up and forget about it and still listen to your music on your computer, and not have to remember to rechoose the output when your about to leave the computer.
b]~VisualKei J-Rock Fanatic~[/b]
Electric Blue DS "phat" + supercard minisd + 1gb kingston
Coral Pink DSLite + supercard microsd + 1gb a-data