Setting Up BpmDj


BpmDj can work with two soundcards or with one soundcard. These soundcards can be either located local or remote. In case two soundcards are used an external mixing desk is required, otherwise the bpmdj mini mixing desk will help you out. Below we will go through the different steps. Be sure to read everything carefully because some important program designs are explained.

First off you should have installed the software through specific packages or from source.

Setting Up

The Directory Structure

BpmDj requires extra information (meta-information) to be present for every song. This information includes title, author, tempo, sound color and other information that might be useful. Normally, ID3 tags can be used for this. However, because not all mp3's can be modified (because they are on cdrom or are located on a shared medium), BpmDj will store this extra information in separate files. These files are stored in a directory ./index. The music files must be stored in a directory ./music.  Once a song has been indexed and a meta-file exists in the index directory, then the song must not move any more within the music directory. Of course the music directory can contain soft links to other locations within the filesystem. Also, when a meta-description of a song is available that is not within the music directory, the program will silently ignore the index file. At the moment the song is again available, it can be used again.

To summarise, create at some place in your filesystem two directories.

./music
./index

A First Start

Find some Mp3's

The program is centered around the use of Mp3's, hence without Mp3's there is nothing too demonstrate. Therefore, find some songs and move them to the music directory.  Beware, once a song is known to bpmdj, it should not move anymore within the music directory. Thus, if you have multiple cdrom filled with songs, you might use a convention to create cd<xyz> directories within the music directory:
music/cd001
music/cd002
music/cd003

Start The Program

Now, go to the directory where the music and index directories are located. Start bpmdj by typing
bpmdj
The program will open and verify that all necessary components are available. (this should go smooth). Now, the file selector will pop up and we can start with importing the unknown songs.

Import Mp3's

To import new mp3's go to the SongManagement|Import MP3's. Now a box will pop up which will scan all the directories within the music directory. For every unknown mp3 file a  new index file will be created and the song will pop up in the main listbox.

Configuring

BpmDj starts a different process for every song (called bpmplay). This allows you to configure every player seperately. E.g, it is possible to start a player on the first soundcard or on the second soundcard. It is also possible to start a player on a remote machine, or to start a player and send the output to a special 'local mixing' device. Below we will first discuss how a DSP device can be set up. Afterward we ellaborate on how remote playing works and how Local playing to the same soundcard works.  Finally we wrap up the configuration by covering the decoder programs used.

Setup the DSP Devices

Depending on how you compiled the program, the player will be able to work with either ALSA, OSS or JACK devices. IF a specific device driver was not compiled in that specific tab will be greyed out. To inform the player which driver and device to use go to Program|Preferences and modify the parameters of the first two players. To do so click on the configure button and select an appropriate device. The different devices are:
  1. Oss - Will use the OSS driver code to play sound. If you have an OSS driver select this an fill in the correct device in the OSS Tab. Please be aware that the OSS driver of ALSA will not work very well.
  2. Alsa - Will us the ALSA driver. This driver is quite good in the sense that it has accurate timing. If you select this device you must also select the correct hardware output in the Alsa Tab.
  3. Jack - This one requires that jackd is running and that a number of appropriate outputchannels have been instigated. See here for more information,
The above three drivers are available when you choose the standard player. You could also choose the cmms player in the bpmdj configuration, but that will only queue the selected song into xmms. There is no true dj support with this option.

The decoder software

During configuration of  the bpmplayer (reached through bpmdj Program|Preferences, the analyzers or players tabs, then the configure button), make sure to also click on the 'Decoder' image. There you need to select which decoder programs you don't want to use. If you don't the prorgam will fail with a 'one of the enabled capacities could not be found' kind of error.

Once, the parameters are correct, the player should start playing the selected song.

Local Playing: two cards, one machine

In case you want to play at two different cards, make sure that you can play every card independently. Afterwards test whether you can play simultaniously. 

Troubleshooting Tips:

  • Check the permissions of the dsp device
  • Check the permissions of the mixing device
  • If it really doesn't work, check whether the song can be played by mplayer, alsaplayer and/or xmms
  • Check whether there is enough free disk space
  • Go to the bpmdj root  and remove any left over raw files by doing 'rm *.raw'
  • If your working on one machine and are using ALSA drivers, make sure you can play two songs over the two DSP devices simultaneously. alsa-config is your friend.
  • Remote Playing: two cards, two machines

    In order to play remote, bpmplay will use ssh and scp. Nervertheless, quite a number of requirements should be satisfied. However once all the requirements are satisfied, playing itself is straightforward, just as if you were playing locally. In the checklist below we will assume that the remote host is called 'remote' and that the account under which we will work is called 'user'. The machine that will run the bpmdj main program is called the 'master'

    1- Install sshd on the remote machine.

    Configure it such that it allows public key or RSA key identification.
    The configuration file is probably located in /etc/ssh/sshd_config. The two options are

    RSAAuthentication yes
    PubkeyAAuthentication yes

    Also make sure that the sshd allows forwarding of X11 requests

    X11Forwarding yes

    2- Install ssh on the master machine.

    Create a local key for the user under which you run bpmdj. (ssh-keygen)
    Put the master public key in the  remote user .ssh/authorized_keys file.
    This can be done simply by concatinating the master key to it.
    Once this is done the following should immediatelly log in the master user on the remote machine without asking for a password.

    bpmdj@master:~$ ssh user@remote
    user@remote:~$

    3- Install the necessary binaries on the remote machine

    Install bpmdj on the remote machine, or copy the necessary binaries to it. These are (only for playing) bpmplay and bpmdj-raw.

    scp bpmplay user@remote:
    scp bpmdj-raw user@remote:

    Make sure to make them executable (chmod 755 ...) and
    directly accessible from a ssh (put export PATH=<wherever they are located>:$PATH) in your .bash_rc at the remote site. It seems that recent versions of bash are shipped with an 'interactive' shell test. If the shel is non interactive all other commands are ignored. As such it is importatnt to place the PATH directives in the beginning of the .bash_rc script.

    After this step, the following command (at the master side) should work

    ssh -X user@remote bpmplay

    should give an error box. If the display cannot be opened issue an

    xhost +

    command at the master.

    4- Test the Remote Player

    Now, everything should work for the remote player. However, before we do so, you must understand how the program works because it might remove files which you do not want to remove ! There are two modes of operation. One in which the music directory is assumed to be shared accross all machines and one in which the music direcotyr will receive a copy.

    Mode 1: Shared music body

    This is the normal mode of operation for bpmplay. It will initiate a call to the remote host, start bpmplay, which will try to find the provided song in the ./music/ directory. If it doesn't exist then there will be no analyzis or no sound. This is the safest option to work with.

    Remark though that the music directory must be completely shared. If one host write to a file in ./music/ then the other participating host must see the appearance of this file.

    Mode 2: Copy music before playing/Analysis

    This mode is enabled by checking 'copy music' in the preference box of bpmdj. This cvan be choosen for each individual player/analyzer once a remote host has been set.. When the player/analyzer works remote in this mode it will
    Now that you understand this, you can test the remote player by doing:

    ./bpmplay --alsa --remote user@remote index/<somemusicindex>.idx

    5- Inform BpmDj of the setup

    Go to the preferences box, select players, and create a new player command. The device you should select is the device at the remote site. So if your remote machine uses alsa or oss, then you must select this as a driver. Afterward, fill in the remote box by putting user@remote in it.

    Local Playing: one card, one machines

    In the past there was a program called bpmmix, which was part of bpmdj. We removed it since it was not the main purpose of bpmdj. If you want to play with a cone-sound-card, one-computer setup, please check this section.

    Decoder Configurations

    The BpmDj Player (bpmplay) is responsible for decoding a sound file before playing it. To achieve this the program relies on different decoders, including mpg123, mpg321, ogg123, mplayer and eventually others. This of course brings a problem with it. First - not all files are playable by the same decoder. E.g; some mpg3 files can be played by mpg123 but nog by mpg321, or other files can be played with mplayer but not with ogg123 and so on. Secondly - since multiple machines can be used, it might be possible that not all decoder programs are available at every host. To fix these problems bpmdj will asign a 'prohibited decoder' list to every song as well as remember which decoders can not be used on which host. The per-file prohibited decoders can be reached through Song|Info. The unavailable decoders on a per/player basis can be found in each player its setup section.


    Copyright (c) Werner Van Belle 2000-2010
    e-mail: werner@yellowcouch.org
    http://bpmdj.yellowcouch.org/