DJ Your Own Streaming Radio Station Using Icecast and Mixxx
This is a barebones, basic setup which should be enough for you to play around with and hit the ground running.
For expediency and testing purposes, we assume it's all being ran from the same machine. Also assuming you're a respectable individual using Linux... ;-)
# Install them
In a terminal on Debian / *buntu:
sudo apt update && sudo apt install icecast2 mixxx
Make sure the Icecast daemon is stopped before continuing:
sudo systemctl stop icecast2
# Configure Icecast
You need to change the default usernames and passwords.
Edit the icecast.xml configuration file. Use any text-editor you're comfortable with.
In a terminal:
sudo emacs -nw /etc/icecast2/icecast.xml
Scroll down to <authentication> section to configure passwords and users.
Optionally also scroll down just a bit farther to <listen-socket> / <port> section and set an alternate port.
Save the file (in emacs: Ctrl+X Ctrl+S)
(Protip: Don't reuse credentials shown in example as they're in every password dictionary...)
# Configure Mixxx
Now, open Mixxx. On first launch, it'll prompt to setup audio hardware. Do so.
Depending on audio subsystem, hardware, and config, it can be tricky...
First, try the "Query Devices" button; let it probe I/O. Hopefully all fields are populated...
If not: for Master Output, try "pulse" "sysdefault", or "default" respectively.
Edit: select dual channel output (1+2).
Click Apply.
Output is all that's needed for basic operation. Feel free to configure and test inputs, microphones and the like later on.
# Load your library
If all went well in the last step: Click the Library tab on the left and Add directories containing your audio files.
Click Apply.
At this point, one might consider playing a file from a deck to make sure audio is configured properly... You'll first need to update the library to do so: click "Library" from the Menu Bar (not the preferences window), then rescan library.
# Mixxx to Icecast
Now, in the Preferences window: Click "Live broadcasting" tab on the left. Here you plug Mixxx into Icecast.
Create a new connection with something similar to the following:
Type: Icecast 2
Host: Domain or IP pointing to the icecast server. Since they're both in the same machine, use "localhost".
Login: username used for server. default is "source"
Mount: mountpoint configured in icecast.xml. Default is "/stream"
Port: port where icecast listens/broadcasts from; configurable via icecast.xml
Password: password configured in icecast.xml
Optionally configuring the encoding options, metadata and other settings here are not required for operation, but are recommended.
Click Apply > OK.
# Restart Icecast
In a terminal, resurrect the daemon:
sudo systemctl start icecast2
Navigate to domain/IP + port of the icecast server in a Web browser to verify Icecast is running. (e.g. http://example.com:8080)
# Finishing up
In Mixxx, load files from your library into your decks (drag n' drop, or via right-click).
Click the the live broadcast button, which looks like a satellite dish, or use CTRL+L .
If no error message shows up: you're now streaming into icecast.
Press play on a deck.
Jam out!
You can toggle the Auto DJ feature to queue up tracks automatically for unattended operation.
To listen to the stream, plug the Icecast URL into media players like Transistor, VLC, or even a Web browser like Firefox.
Also recommended to setup Dyn-DNS or something via Afraid.org if planning to connect remotely. Icecast server also runs very happily on modest hardware such as a Raspberry Pi.
Possible to feed audio from a mobile device to the machine running Mixxx over a bluetooth audio sink if you wanna deal with the headaches of wrangling those pulse audio connections.
Happy Hacking!
~P















