How can I play simulteanously two different audio using headphones for one and internal speakers for the other?

Solution 1:

The easiest way is to use a USB headphone (or a $5 USB audio device to plug your headphone) , and to select this USB sound device for deck2 in Mixxx sound preferences.


Another way depends on your sound card: There is a possibility to create a new audio device just by activating "independent HP" in Alsamixer.

First, run alsamixer in a maximized terminal and search if you have a fader called independent (the name is under the fader, see screen capture at the end). (Sometimes if you see only one fader you have to press F6 and select your main sound card if it is not the default.) If no independent fader, no chance. Else, follow the following steps after disconnecting you headphone jack and closing all audio software (close also the previous alsamixer pressing Esc in its terminal):

  1. Stop pulseaudio copying and running successively these 3 commands in a terminal:

    mkdir ~/.pulse
    echo autospawn=no > ~/.pulse/client.conf
    pulseaudio -k
    
  2. Relaunch alsamixer in a terminal, use left/right arrows keys to move to the independent fader, change its state to enabled using up arrow key.

    Also verify speaker and headphones fader are not muted (MM under the fader means "muted", 00 is ok.)

    Now, as in independent mode, a new audio output is created for headphone only (called hw:0,2), in addition to the default device (hw:0,0) which is for speaker.

  3. Go to the Mixxx sound preferences and select soundcard_name (hw:0,0) for deck1, soundcard_name (hw:2,0) for deck2, "none" for main and headphones.

  4. Later, you can revert to pulseaudio running

    echo autospawn=yes > ~/.pulse/client.conf
    pulseaudio -D
    

(source)

mixxx alsamixer