I'm trying to steam some Dota 2 (via Wine) casts to Twitch using this shell script I found online:



avconv \
  -f x11grab -s $INRES -r "$FPS" -i :0.0 \
  -f alsa -ac 2 -i pulse \
  -vcodec libx264 -s $OUTRES -preset $QUAL \
  -acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b 712000 -bufsize 512k \
  -f flv "rtmp://live.justin.tv/app/$STREAM_KEY"

It streams the video fine, but I only get audio from my plugged in microphone and no audio from Dota 2. This wouldn't be terrible if I only cared about getting the sound effects, but I am sometimes co-casting with other people using the built-in voice chat, and since I am not getting any of their audio, it sounds like I am a madman.

I could try and use an external program for voice chat, but I don't really want to force any of my random co-casters to set it up on their end. So I'd like to be able to pipe both the Wine audio and my microphone audio to the stream.


You can do this by creating a null-sink and two loopback connectors:

pactl load-module module-null-sink
pactl load-module module-loopback
pactl load-module module-loopback

To configure those channels you need the pavucontrol tool (sudo apt-get install pavucontrol).

  • On the Playback tab select "All streams" and redirect the loopback streams to "Null output".

  • Then go to the "Recording" tab and also select "All streams". You should see both loopbacks again.

  • Set one to "Analog Stereo Internal Audio" (the microphone) and set the other one to "Analog Stereo Internal Audio Monitor" (the audio output).
  • After running your script you should see the avconv process in the list on the "Recording" tab. Set it to recording from "Null Output Monitor".


|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.