Maarten Baert's website

Game Maker / C++ projects

Home Model Creator ExtremePhysics Game Maker DLLs SimpleScreenRecorder   Recent comments Search

Last modified: Tue, 4 Mar 2014
Refresh

Recording game audio


Sometimes you don't want to record your microphone, but the audio from the game you're playing. There are two ways to do this: either through PulseAudio or through JACK.

PulseAudio is enabled by default on Ubuntu (except Lubuntu) and many other Linux distributions. PulseAudio works, but is sometimes unreliable and it still has some bugs that you may run into when you try to do more advanced things with it (such as the commands needed to record a game and a microphone at the same time). If you care about reliability and sound quality, I recommend using JACK instead. JACK is harder to set up, but I think it's worth it.

Using PulseAudio

Recording only game audio

Assuming you have PulseAudio, you can follow these steps:

  1. Run SimpleScreenRecorder.

  2. Make sure that the audio backend is set to PulseAudio.

  3. Select an audio source that starts with 'Monitor of'.

If you want to switch back, just select an audio source that is not a monitor.

Recording game audio and microphone at the same time

This method is know to be buggy and will likely result in some stuttering. Consider using JACK instead.

Credit goes to Joshua Hertlein for figuring this out. There are two ways to do this: the easy one and the hard one.

Hint

Before you do any of this, I highly recommend that you set the PulseAudio setting 'flat-volumes' to 'no', otherwise you won't be able to control the volume of applications individually (or at least not in a sane way). This seems to be the default setting in Ubuntu, but not in Arch Linux, so you may want to check this. To disable 'flat-volumes', add/modify this line to /etc/pulse/daemon.conf

flat-volumes = no

There is also a bug in PulseAudio that is triggered when PulseAudio switches between 44.1kHz and 48kHz audio. The fix should be released with the next version of PulseAudio (probably version 4.1). Until then, add/modify these lines in /etc/pulse/daemon.conf to work around this bug:

default-sample-rate = 44100
alternate-sample-rate = 44100

This will force PulseAudio to use only 44.1kHz (everything else is resampled as usual). This may increase CPU usage and reduce the audio quality, but the difference is very small.

After changing these settings, you should reboot so they can take effect (or just restart PulseAudio, but that will probably break your volume control).

The easy way

Tell PulseAudio to send audio coming from the microphone to the speakers, and record the speakers with SimpleScreenRecorder as explained above. The downside is that you will constantly hear your own voice which can be a bit distracting, and you should also set your speaker volume really low (or just use headphones) to avoid echo. But it is simple. Just run this command:

pactl load-module module-loopback

And when you're tired of listening to yourself, you can stop it again with this command:

pactl unload-module module-loopback

Note that the volume of the recording does not depend on your speaker volume. So even when you think the volume of the game sound is really low, it can actually be really loud in the final recording. You should reduce the volume of the game either in the game itself or with PulseAudio Volume Control, so your voice will still be hearable. The preview in SimpleScreenRecorder can help you here, it should the actual volume of the recording.

The hard way

Create null outputs and connect them with loopback streams so the game audio is sent to the speakers, but also combined with the microphone and sent to SimpleScreenRecorder. This is what we want to achieve:

Image: pulseaudio-loopback-diagram.png

To do this, run the following commands:

pactl load-module module-null-sink sink_name=duplex_out
pactl load-module module-null-sink sink_name=game_out
pactl load-module module-loopback source=game_out.monitor
pactl load-module module-loopback source=game_out.monitor sink=duplex_out
pactl load-module module-loopback sink=duplex_out

Now you should open PulseAudio Volume Control and send the audio from the game to the second null output (game_out), and set the audio source in SimpleScreenRecorder to the first null output (duplex_out). This should be done from the input page - do not use PulseAudio Volume Control to change the audio source for SimpleScreenRecorder because the change will be lost whenever you pause and resume the recording.

Image: pulseaudio-loopback-pavucontrol-small.png

As with the previous method, you should probably reduce the volume of the game a bit, because it's usually very loud compared to the microphone volume.

When you're done, remove all the extra outputs and loopback streams with this command:

pactl unload-module module-loopback
pactl unload-module module-null-sink

Using JACK

Unlike PulseAudio, JACK must be configured manually, and while you're using it, you won't be able to use your normal audio system - everything has to go through JACK. So before you start, you should close all programs that could be using the sound system (this includes web pages with sound or video, often even when they are paused).

I recommend uninstalling PulseAudio if you are going to use JACK, because it will interfere with JACK (even when the PulseAudio daemon is not running).

Hint

JACK can be used with a normal ('generic') Linux kernel, but these kernels are not optimized for low latency. As a result, you will have to use a very large buffer to avoid xruns (stuttering). I recommend using a preemptive kernel or even a realtime kernel instead.

Linux distributions that are meant for audio processing will include a preemptive or realtime kernel by default, so there is nothing you should do. Arch Linux also comes with a preemptive kernel. On Ubuntu (and derivatives like Linux Mint), you can install a preemptive kernel with the following command:

sudo apt-get install linux-image-lowlatency linux-headers-lowlatency

After installing these packages, the preemptive ('lowlatency') kernel should show up in Grub when you restart the computer (it should be the default).

You should be able to get the latency down to 20ms or less with a preemptive kernel. You can go even further with a realtime kernel, but there is usually no need for that and it introduces unnecessary overhead.

Before you start, it's a good idea to configure your system to allow real-time threads. If you are using one of the Linux distributions meant for audio processing, this is probably already the default. If not, you have to edit the file /etc/security/limits.conf and add/edit these lines:

@audio          -       rtprio          80
@audio          -       memlock         unlimited

This tells the kernel that users in the audio group can create real time threads and lock memory to RAM. These settings will make xruns less likely, so you can use lower latencies. It is not required but highly recommended.

Next you have to make sure that you are actually in the audio group. In a terminal, run the groups command to see what groups you are in. If it includes 'audio', you are fine. If not, run this command:

sudo usermod -a -G audio yourusername

This adds you to the audio group. You have to log out and log in again before it will take effect.

Before you can use JACK, you have to start the JACK server. The easiest way to do this is with the QJackCtl GUI, which you can install from the repositories. If you have a choice, I also recommend installing jack2 instead of jack1 - they are compatible, but jack2 performs better on multi-core systems. On Ubuntu, you can install all this with the following command:

sudo apt-get install qjackctl jackd2

Now open QJackCtl, and before you do anything else, click the settings button. Most of the default settings are fine, you just have to make a few changes:

  • Make sure that the 'realtime' checkbox is checked, and the 'no memory lock' checkbox is unchecked.

  • Set the same rate to 44100, because this is what SimpleScreenRecorder will use. Other sample rates will still work, but it's not very useful since SimpleScreenRecorder will resample it to 44100 anyway.

  • Set the period size to a reasonable value, for example 512 or 1024. Lower values will decrease the latency but increase the probability that you will get xruns (clicks or short interruptions in the audio). The best value highly depends on your sound hardware and how well the Linux drivers for that hardware perform. USB sound cards usually perform better here. With a special realtime kernel and the right hardware, you can get the latency down to a millisecond, but I don't recommend actually doing that: it introduces a lot of overhead, could cause xruns, and you probably won't be able to notice the difference anyway once the latency is 10ms or less.

  • Set the number of periods to 2. If that doesn't work properly, even with very large period sizes (i.e. you still get xruns), try 3 or 4 instead.

  • Set the number of input and output channels to 2, because SimpleScreenRecorder currently only supports stereo.

Once you've chosen your settings, click the 'start' button and wait a few seconds. If everything goes well, the status display should light up and contain only green and yellow text. If things go wrong (you get xruns), the text will turn red.

You should always make sure that JACK is running before you start any application that tries to use JACK, because they may try to start JACK themselves (in the background) which will confuse QJackCtl (if this happens, you have to find the jackd process and kill it manually).

You can test JACK with any application that has JACK support (for example Audacity). Most normal applications don't have JACK support though, so you will need what's called an ALSA-to-JACK bridge. There are two ways to do this. The classic method uses an ALSA loop device. It always works, but it adds a lot of latency which is annoying. You can read how to do it here, but I won't go into it because there is a much better solution: the JACK plugin for ALSA.

In order to use the JACK plugin for ALSA, you will have to create a file called .asoundrc in your home directory, with the following content:

# override default
pcm.!default {
    type plug
    slave {
        pcm "rjack"
    }
}

# ALSA-to-JACK bridge
pcm.jack {
    type plug
    slave {
        pcm "rjack"
    }
    hint {
        description "JACK bridge"
    }
}
pcm.rjack {
    type jack
    playback_ports {
        0 "system:playback_1"
        1 "system:playback_2"
    }
    capture_ports {
        0 "system:capture_1"
        1 "system:capture_2"
    }
}

This will make the JACK plugin the default ALSA device. Most applications will simply use the default, so this is usually all you have to do. Some applications may have a way to select the sound input/output within the application, in that case you should either use 'default' or manually select 'jack_system'.

You can now use SimpleScreenRecorder with the JACK backend. SimpleScreenRecorder can automatically make connections for common use cases (recording the microphone and/or the speakers), but if you need more fine-tuned control, you can manually manage connections with QJackCtl by clicking the 'connect' button (not to be confused with the 'patchbay' button, which is used to automatically apply predefined connections).

You can also combine SimpleScreenRecorder with various other JACK applications to apply audio effects in real-time.

When you're done with JACK, you should first close all applications that use the sound system, then delete the .asoundrc file in your home folder (or just rename it so you can re-use it later), and then stop JACK through QJackCtl.


Comments

Varaz

Comment #1: Wed, 16 Oct 2013, 13:21 (GMT+1, DST)

Quote


Hi,
program is realy good but i have problems with game audio. Iam using Alsa and i dont want to use Pulse.
Can you help me how to configure Mic+Game in Alsa? I can only record Mic or nothing.
Thanks

Maarten Baert

Administrator

Comment #2: Fri, 18 Oct 2013, 18:50 (GMT+1, DST)

Quote


Quote: Varaz

Hi,
program is realy good but i have problems with game audio. Iam using Alsa and i dont want to use Pulse.
Can you help me how to configure Mic+Game in Alsa? I can only record Mic or nothing.
Thanks

That's not possible as far as I know. The next version should have JACK support for those who don't want to use PulseAudio (like me ;)). You can also set up an ALSA bridge for JACK, I've heard that this works with SSR (I never tried it myself though).

Feles

Comment #3: Sat, 19 Oct 2013, 22:00 (GMT+1, DST)

Quote


Hey thanks for this info, "The Hard Way" for recording both game and mic audio works perfectly for me, for most games. However there are a few games where I can't change the output in pavucontrol to be Null Output, or anything else actually, I just can't change it. The dropdown shows up and the two Null Outputs are there, but selecting them does nothing.

There's not much info online about this, but from the one or two things I've seen about it, it might be an OpenAL issue. I haven't figured out how to fix it properly, but I came up with a workaround. If you disable all outputs, the game will be forced to output to the second Null Output, and you can record as normal (although the game sound doesn't seems to run through the speakers anymore)

Just curious, do you have any idea on how to properly fix this? I'd be very grateful for any info.

Maarten Baert

Administrator

Comment #4: Sun, 20 Oct 2013, 0:24 (GMT+1, DST)

Quote


Quote: Feles

Hey thanks for this info, "The Hard Way" for recording both game and mic audio works perfectly for me, for most games. However there are a few games where I can't change the output in pavucontrol to be Null Output, or anything else actually, I just can't change it. The dropdown shows up and the two Null Outputs are there, but selecting them does nothing.

There's not much info online about this, but from the one or two things I've seen about it, it might be an OpenAL issue. I haven't figured out how to fix it properly, but I came up with a workaround. If you disable all outputs, the game will be forced to output to the second Null Output, and you can record as normal (although the game sound doesn't seems to run through the speakers anymore)

Just curious, do you have any idea on how to properly fix this? I'd be very grateful for any info.

If it's an OpenAL issue, you could try to change /etc/openal/alsoft.conf so it uses ALSA instead of PulseAudio. To do this, find the line starting with drivers= and replace it with drivers=alsa. There is no way to change the PulseAudio source from ALSA, so the game shouldn't be able to interfere anymore.

Last modified: Sun, 20 Oct 2013, 0:25 (GMT+1, DST)

Joozey

Comment #5: Thu, 24 Oct 2013, 21:55 (GMT+1, DST)

Quote


Quote: Maarten Baert
Quote: Feles

Hey thanks for this info, "The Hard Way" for recording both game and mic audio works perfectly for me, for most games. However there are a few games where I can't change the output in pavucontrol to be Null Output, or anything else actually, I just can't change it. The dropdown shows up and the two Null Outputs are there, but selecting them does nothing.

There's not much info online about this, but from the one or two things I've seen about it, it might be an OpenAL issue. I haven't figured out how to fix it properly, but I came up with a workaround. If you disable all outputs, the game will be forced to output to the second Null Output, and you can record as normal (although the game sound doesn't seems to run through the speakers anymore)

Just curious, do you have any idea on how to properly fix this? I'd be very grateful for any info.

If it's an OpenAL issue, you could try to change /etc/openal/alsoft.conf so it uses ALSA instead of PulseAudio. To do this, find the line starting with drivers= and replace it with drivers=alsa. There is no way to change the PulseAudio source from ALSA, so the game shouldn't be able to interfere anymore.

That's awesome, this works for me on Ubuntu 12.04. In my case Java, now loads through ALSA, which I can change to the game sink. I found you can name your sinks too for display in pulseaudio through: sink-properties=device.description="Null_Sink_Duplex_Out", which makes it easier to determine which sink you assign from the dropdown menu.

Thanks a lot for this tutorial! It makes more sense now, and works like a charm.

Bazukas

Comment #6: Mon, 6 Jan 2014, 4:18 (GMT+1, DST)

Quote


Hello!

Does JACK audio source work now? If so, could you, please, provide some instructions on how to record both
game audio and microphone using it.

Thank you.

Maarten Baert

Administrator

Comment #7: Mon, 6 Jan 2014, 19:09 (GMT+1, DST)

Quote


Quote: Bazukas

Hello!

Does JACK audio source work now? If so, could you, please, provide some instructions on how to record both
game audio and microphone using it.

Thank you.

JACK support is ready but not released yet. You have to wait until the next version (or compile from source).

Ubuntuaddicted

Comment #8: Thu, 9 Jan 2014, 3:22 (GMT+1, DST)

Quote


Quote: Maarten Baert
Quote: Bazukas

Hello!

Does JACK audio source work now? If so, could you, please, provide some instructions on how to record both
game audio and microphone using it.

Thank you.

JACK support is ready but not released yet. You have to wait until the next version (or compile from source).

are there any other new features that would make me want to compile the latest code versus just running the prepackaged deb you're providing in your PPA?

Also, i just noticed your instructions for "the hard way" are actually different than mine (more complex also) and I am able to record the game audio as well as my mic input just fine. You only need 1 null output and 2 loopbacks, that's it. I don't know why you say to create all those other null outputs and loopbacks. Here's the script I run just prior to recording or streaming.

#!/bin/bash
pactl load-module module-null-sink sink_name=virtual1 sink_properties=device.description="mic+game"
pactl load-module module-loopback sink=virtual1
pactl load-module module-loopback sink=virtual1

Then I go into pavucontrol recording tab and 1 loopback to mic+game is "monitor of Built-In analog audio stereo" (the game) and the other loopback to mic+game is my "081a analog mono" (which is the usb webcam microphone) and then within ssr, i choose mic+game as what it should record. I can provide pictures if anyone needs them.

Last modified: Thu, 9 Jan 2014, 3:33 (GMT+1, DST)

Maarten Baert

Administrator

Comment #9: Fri, 10 Jan 2014, 0:42 (GMT+1, DST)

Quote


Quote: Ubuntuaddicted

are there any other new features that would make me want to compile the latest code versus just running the prepackaged deb you're providing in your PPA?

Probably not.

Quote: Ubuntuaddicted

Also, i just noticed your instructions for "the hard way" are actually different than mine (more complex also) and I am able to record the game audio as well as my mic input just fine. You only need 1 null output and 2 loopbacks, that's it. I don't know why you say to create all those other null outputs and loopbacks. Here's the script I run just prior to recording or streaming.

#!/bin/bash
pactl load-module module-null-sink sink_name=virtual1 sink_properties=device.description="mic+game"
pactl load-module module-loopback sink=virtual1
pactl load-module module-loopback sink=virtual1

Then I go into pavucontrol recording tab and 1 loopback to mic+game is "monitor of Built-In analog audio stereo" (the game) and the other loopback to mic+game is my "081a analog mono" (which is the usb webcam microphone) and then within ssr, i choose mic+game as what it should record. I can provide pictures if anyone needs them.

I copied the instructions from someone else. The difference is that you will record everything that is played back, whereas the instructions on this page will record only a single game. For most users it probably doesn't make a difference, but I don't feel like updating those images :P.

Last modified: Fri, 10 Jan 2014, 0:42 (GMT+1, DST)

Xage

Comment #10: Wed, 12 Feb 2014, 7:12 (GMT+1, DST)

Quote


Good, don't change it since I prefer audio of only a single game and I use this page for reference. Thanks. =D

Quote: Maarten Baert

I copied the instructions from someone else. The difference is that you will record everything that is played back, whereas the instructions on this page will record only a single game. For most users it probably doesn't make a difference, but I don't feel like updating those images :P.

Ubuntuaddicted

Comment #11: Wed, 12 Feb 2014, 15:49 (GMT+1, DST)

Quote


Quote: Xage

Good, don't change it since I prefer audio of only a single game and I use this page for reference. Thanks. =D

Quote: Maarten Baert

I copied the instructions from someone else. The difference is that you will record everything that is played back, whereas the instructions on this page will record only a single game. For most users it probably doesn't make a difference, but I don't feel like updating those images :P.

have you ever played 2 games at the same time? lol

Cjcwj12

Comment #12: Thu, 20 Feb 2014, 8:30 (GMT+1, DST)

Quote


Hello
With the new update with JACK
I tried to do it but i get this message trying to start up a recording

[PageRecord::StartPage] Starting page ...
[GLInjectLauncher::Init] Full command: LD_PRELOAD=libssr-glinject.so SSR_GLINJECT_SHM=14188559 java -jar /home/cjcwj12/Minecraft/Minecraft.jar
[JACKInput::Init] Error: Could not connect to JACK!
[PageRecord::StartPage] Error: Something went wrong during initialization.
[PageRecord::StartPage] Started page.

Why can't it connect to JACK?

I am on Elementary OS

Maarten Baert

Administrator

Comment #13: Thu, 20 Feb 2014, 11:45 (GMT+1, DST)

Quote


Quote: Cjcwj12

Hello
With the new update with JACK
I tried to do it but i get this message trying to start up a recording

[PageRecord::StartPage] Starting page ...
[GLInjectLauncher::Init] Full command: LD_PRELOAD=libssr-glinject.so SSR_GLINJECT_SHM=14188559 java -jar /home/cjcwj12/Minecraft/Minecraft.jar
[JACKInput::Init] Error: Could not connect to JACK!
[PageRecord::StartPage] Error: Something went wrong during initialization.
[PageRecord::StartPage] Started page.

Why can't it connect to JACK?

I am on Elementary OS

JACK is not like PulseAudio, you need to set it up manually. You can start the JACK server with the QJackCtl GUI. You also need to set up an ALSA-to-JACK bridge (you can do that with a loop device, but I prefer the JACK plugin for ALSA because it has less latency).

Manuel

Comment #14: Fri, 28 Feb 2014, 15:20 (GMT+1, DST)

Quote


Hi

First let my say that your program is super awesome! I tried a lot like glc and others and with ssr it is now possible to make game footage videos on linux and it really works and on top of that is is really simple :-D

But unfortunately i cant get the recording to work with sound that does not stutter and background noise when i play the video.

I use the pulseaudio method and ogg vobis as codec i tried different Bits for encoding but nothing seems to work.

I hear the game sound and a low constant noise in the background and the game sound is a little stuttered but nearly not noticeable.

In the console window off ssr i get:

[PageRecord::StartPage] Starting page ...
[GLInjectLauncher::Init] Full command: LD_PRELOAD=libssr-glinject.so SSR_GLINJECT_SHM=15597620  %command%
[PageRecord::StartPage] Started page.
[PageRecord::StartOutput] Starting output ...
[Muxer::Init] Using format matroska (Matroska).
[BaseEncoder::CreateCodec] Using codec libx264 (libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10).
[BaseEncoder::CreateCodec] Using codec libvorbis (libvorbis).
[BaseEncoder::EncoderThread] Encoder thread started.
[DetectCPUFeatures] CPU features: mmx sse sse2 sse3
[DetectCPUFeatures] CPU features: mmx sse sse2 sse3
[PageRecord::StartOutput] Started output.
[PageRecord::StartInput] Starting input ...
[BaseEncoder::EncoderThread] Encoder thread started.
[GLInjectInput::InputThread] Input thread started.
[PageRecord::StartInput] Started input.
[Synchronizer::SynchronizerThread] Synchronizer thread started.
[Muxer::MuxerThread] Muxer thread started.
[PulseAudioInput::InputThread] Input thread started.
[FastResampler::Resample] Resample ratio is 1.0000 (was 0.0000).
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.

etc.

Is the cause of the problem the too many audio samples ? If so, how can i reduce them ?

Thanks

Ubuntuaddicted

Comment #15: Fri, 28 Feb 2014, 21:29 (GMT+1, DST)

Quote


Quote: Manuel

Hi

First let my say that your program is super awesome! I tried a lot like glc and others and with ssr it is now possible to make game footage videos on linux and it really works and on top of that is is really simple :-D

But unfortunately i cant get the recording to work with sound that does not stutter and background noise when i play the video.

I use the pulseaudio method and ogg vobis as codec i tried different Bits for encoding but nothing seems to work.

I hear the game sound and a low constant noise in the background and the game sound is a little stuttered but nearly not noticeable.

In the console window off ssr i get:

[PageRecord::StartPage] Starting page ...
[GLInjectLauncher::Init] Full command: LD_PRELOAD=libssr-glinject.so SSR_GLINJECT_SHM=15597620  %command%
[PageRecord::StartPage] Started page.
[PageRecord::StartOutput] Starting output ...
[Muxer::Init] Using format matroska (Matroska).
[BaseEncoder::CreateCodec] Using codec libx264 (libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10).
[BaseEncoder::CreateCodec] Using codec libvorbis (libvorbis).
[BaseEncoder::EncoderThread] Encoder thread started.
[DetectCPUFeatures] CPU features: mmx sse sse2 sse3
[DetectCPUFeatures] CPU features: mmx sse sse2 sse3
[PageRecord::StartOutput] Started output.
[PageRecord::StartInput] Starting input ...
[BaseEncoder::EncoderThread] Encoder thread started.
[GLInjectInput::InputThread] Input thread started.
[PageRecord::StartInput] Started input.
[Synchronizer::SynchronizerThread] Synchronizer thread started.
[Muxer::MuxerThread] Muxer thread started.
[PulseAudioInput::InputThread] Input thread started.
[FastResampler::Resample] Resample ratio is 1.0000 (was 0.0000).
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.

etc.

Is the cause of the problem the too many audio samples ? If so, how can i reduce them ?

Thanks

what linux distro are you using? are you using pulseaudio? have you checked his troubleshooting section for the daemon.conf file and sample rate?

Manuel

Comment #16: Fri, 28 Feb 2014, 21:52 (GMT+1, DST)

Quote


Hi

Im using Gentoo. I found a fix. I applied tsched= 0 to the default.pa from pulseaudio and the 441khz fix. This works now :-D

Very pleased!

Thanks

Maarten Baert

Administrator

Comment #17: Fri, 28 Feb 2014, 22:13 (GMT+1, DST)

Quote


Quote: Manuel

I use the pulseaudio method and ogg vobis as codec i tried different Bits for encoding but nothing seems to work.

I hear the game sound and a low constant noise in the background and the game sound is a little stuttered but nearly not noticeable.

[...]

Is the cause of the problem the too many audio samples ? If so, how can i reduce them ?

The background noise is probably just your microphone (you can verify this by recording some audio in a program like Audacity). The best solution is to use a USB microphone, those tend to have far less noise (because the analog-to-digital conversion happens in microphone itself).

The 'too many audio samples' warning is caused by bugs in PulseAudio - it sometimes produces sounds (usually short periods of silence) that aren't actually there. If you want better quality audio, I recommend JACK instead. It is harder to set up, but less buggy.

Dubslow

Comment #18: Sun, 2 Mar 2014, 2:54 (GMT+1, DST)

Quote


I've dropped by to share a discovery concerning the merged audio-game sounds process with PulseAudio.

The main issue that I've had with it is that even if the null outputs are properly configured, when I run a program (game or otherwise) that outputs sound, it defaults to the usual sink, not the one we need it on -- and this can be a problem if a game does not support Alt-Tab-ing. Since I can't set the game to the null sink without the game running, but I can't change anything while it is running, I can't record its audio.

The solution is to set the proper null sink as the *default* sink. This can be accomplished with the command

pacmd set-default-sink game_out

immediately following the four commands given above. This comes with a caveat however; in order for this command to take effect, the file /etc/pulse/default.pa must have the following line modified:

load-module module-stream-restore

should become

load-module module-stream-restore restore_device=false

Once Pulse has been restarted to reload the config file, the set-default command will work and I can record game sounds without needing to change anything while the game is running. (Note, of course, that *all* sounds, such as browser or music player sounds are also captured by the null sink as well with this default.)

Last modified: Sun, 2 Mar 2014, 2:54 (GMT+1, DST)

Ubuntuaddicted

Comment #19: Tue, 4 Mar 2014, 17:50 (GMT+1, DST)

Quote


Quote: Dubslow

I've dropped by to share a discovery concerning the merged audio-game sounds process with PulseAudio.

The main issue that I've had with it is that even if the null outputs are properly configured, when I run a program (game or otherwise) that outputs sound, it defaults to the usual sink, not the one we need it on -- and this can be a problem if a game does not support Alt-Tab-ing. Since I can't set the game to the null sink without the game running, but I can't change anything while it is running, I can't record its audio.

The solution is to set the proper null sink as the *default* sink. This can be accomplished with the command

pacmd set-default-sink game_out

immediately following the four commands given above. This comes with a caveat however; in order for this command to take effect, the file /etc/pulse/default.pa must have the following line modified:

load-module module-stream-restore

should become

load-module module-stream-restore restore_device=false

Once Pulse has been restarted to reload the config file, the set-default command will work and I can record game sounds without needing to change anything while the game is running. (Note, of course, that *all* sounds, such as browser or music player sounds are also captured by the null sink as well with this default.)

hmmm, i don't use the instructions he has written here. i only create 2 loopbacks and 1 nullsink. 1 loopback is monitor of internal audio and the other loopback is my mic, i point both those loopbacks to my null sink and tell ssr to record the null sink. So I have never came across the issue you were having, my game will always launch and it's audio will always play on the internal audio. So i never have to mess with all that stuff you have to .

Andabata

Comment #20: Wed, 12 Mar 2014, 14:47 (GMT+1, DST)

Quote


Hi Maarten, thanks for your efforts.
(I edited the post cause it was superfluos)

Last modified: Wed, 12 Mar 2014, 14:53 (GMT+1, DST)

Mrknightofthecheese

Comment #21: Wed, 16 Apr 2014, 18:12 (GMT+1, DST)

Quote


Thank you SO MUCH for putting JACK on SimpleScreenRecorder!
This made my life easier !
Thank you again!

Mrknightofthecheese

Comment #22: Sun, 20 Apr 2014, 19:35 (GMT+1, DST)

Quote


Anyway,how to record skype?

Maarten Baert

Administrator

Comment #23: Mon, 21 Apr 2014, 17:42 (GMT+1, DST)

Quote


Quote: Mrknightofthecheese

Anyway,how to record skype?

Just like any other application? If you want to record Skype with JACK, you just have to make sure that Skype is not running when you start JACK, otherwise Skype won't know that it should use JACK.

Ubuntuaddicted

Comment #24: Mon, 21 Apr 2014, 19:16 (GMT+1, DST)

Quote


Quote: Mrknightofthecheese

Anyway,how to record skype?

is that the only thing you want to record or do you also want to record your own voice as well?

Mrknightofthecheese

Comment #25: Wed, 23 Apr 2014, 17:42 (GMT+1, DST)

Quote


Quote: Maarten Baert
Quote: Mrknightofthecheese

Anyway,how to record skype?

Just like any other application? If you want to record Skype with JACK, you just have to make sure that Skype is not running when you start JACK, otherwise Skype won't know that it should use JACK.

Nope,this doesn't works.I started JACK with QjackCtl and then I started skype,but the icon of jack was red and I did not hear anything.

Last modified: Wed, 23 Apr 2014, 18:51 (GMT+1, DST)

Mrknightofthecheese

Comment #26: Wed, 23 Apr 2014, 18:33 (GMT+1, DST)

Quote


Quote: Ubuntuaddicted
Quote: Mrknightofthecheese

Anyway,how to record skype?

is that the only thing you want to record or do you also want to record your own voice as well?

I want to record skype and my voice.

Maarten Baert

Administrator

Comment #27: Wed, 23 Apr 2014, 20:57 (GMT+1, DST)

Quote


Quote: Mrknightofthecheese

Nope,this doesn't works.I started JACK with QjackCtl and then I started skype,but the icon of jack was red and I did not hear anything.

If the icon is red, it means you didn't start JACK properly. First try to get JACK working with an application that actually has JACK support (like Audacity) before you try to use it with Skype. By the way, make sure that you have installed the 32-bit JACK library since Skype is 32-bit.

Mrknightofthecheese

Comment #28: Fri, 13 Jun 2014, 20:55 (GMT+1, DST)

Quote


Quote: Maarten Baert
Quote: Mrknightofthecheese

Nope,this doesn't works.I started JACK with QjackCtl and then I started skype,but the icon of jack was red and I did not hear anything.

If the icon is red, it means you didn't start JACK properly. First try to get JACK working with an application that actually has JACK support (like Audacity) before you try to use it with Skype. By the way, make sure that you have installed the 32-bit JACK library since Skype is 32-bit.

When QjackCtl is running,I can't hear anything from any program!
:(
I don't know why!

Maarten Baert

Administrator

Comment #29: Fri, 13 Jun 2014, 21:03 (GMT+1, DST)

Quote


Quote: Mrknightofthecheese

When QjackCtl is running,I can't hear anything from any program!
:(
I don't know why!

You should set up the ALSA-to-JACK bridge as I described. You also have to uninstall PulseAudio to make this work.

Mrknightofthecheese

Comment #30: Mon, 23 Jun 2014, 17:23 (GMT+1, DST)

Quote


Quote: Maarten Baert
Quote: Mrknightofthecheese

When QjackCtl is running,I can't hear anything from any program!
:(
I don't know why!

You should set up the ALSA-to-JACK bridge as I described. You also have to uninstall PulseAudio to make this work.

THANK YOU!
FINALLY I CAN RECORD SKYPE(it was a little bit hard to calibrate alsa and to remove pulseaudio,but now it works!)!

Last modified: Mon, 23 Jun 2014, 17:21 (GMT+1, DST)

Cjcwj12

Comment #31: Thu, 3 Jul 2014, 10:38 (GMT+1, DST)

Quote


When I make the null output loops, then go to make the java sound go to the 2nd null output, I click it but it stays on what it already was on. Please help.
(BTW I also tried opening pulse volume control in terminal with sudo

Maarten Baert

Administrator

Comment #32: Fri, 4 Jul 2014, 18:35 (GMT+1, DST)

Quote


Quote: Cjcwj12

When I make the null output loops, then go to make the java sound go to the 2nd null output, I click it but it stays on what it already was on. Please help.
(BTW I also tried opening pulse volume control in terminal with sudo

The PulseAudio method is known to be buggy - I can't help you with PulseAudio bugs. That's why I recommended JACK instead.

Kovacsa

Comment #33: Mon, 4 Aug 2014, 22:24 (GMT+1, DST)

Quote


Last modified: Mon, 4 Aug 2014, 23:08 (GMT+1, DST)

Kovacsa

Comment #34: Mon, 4 Aug 2014, 22:32 (GMT+1, DST)

Quote


Quote: Cjcwj12

When I make the null output loops, then go to make the java sound go to the 2nd null output, I click it but it stays on what it already was on. Please help.
(BTW I also tried opening pulse volume control in terminal with sudo

Add the line:

Quote

allow-moves = true

to the bottom of the ~/.alsoftrc file

Source:
http://ubuntuforums.org/showthread.php?t=2146552

Kovacsa

Comment #35: Tue, 5 Aug 2014, 11:54 (GMT+1, DST)

Quote


My .asoundrc is not working. Still can't hear anything

Last modified: Tue, 5 Aug 2014, 11:56 (GMT+1, DST)

Maarten Baert

Administrator

Comment #36: Tue, 5 Aug 2014, 13:34 (GMT+1, DST)

Quote


Quote: Kovacsa

My .asoundrc is not working. Still can't hear anything

I need more information than that ...

Mrknightofthecheese

Comment #37: Fri, 15 Aug 2014, 20:26 (GMT+1, DST)

Quote


I've upgraded the skype version to 1.3 and now I have the same problem.

Last modified: Fri, 15 Aug 2014, 20:36 (GMT+1, DST)

Maarten Baert

Administrator

Comment #38: Sun, 17 Aug 2014, 14:41 (GMT+1, DST)

Quote


Quote: Mrknightofthecheese

I've upgraded the skype version to 1.3 and now I have the same problem.

Which problem? The latest Skype has dropped support for ALSA and requires PulseAudio, which causes a lot of issues that I can't fix.

Mrknightofthecheese

Comment #39: Sun, 17 Aug 2014, 19:46 (GMT+1, DST)

Quote


Quote: Maarten Baert

Which problem? The latest Skype has dropped support for ALSA and requires PulseAudio, which causes a lot of issues that I can't fix.

I can't hear anything :(

Maarten Baert

Administrator

Comment #40: Mon, 18 Aug 2014, 16:01 (GMT+1, DST)

Quote


Quote: Mrknightofthecheese
Quote: Maarten Baert

Which problem? The latest Skype has dropped support for ALSA and requires PulseAudio, which causes a lot of issues that I can't fix.

I can't hear anything :(

As I said, the latest Skype requires PulseAudio. This creates a LOT of problems. I found a workaround that's somewhat functional but it is extremely convoluted. It involves running PulseAudio and JACK at the same time, loading the PulseAudio JACK sink module, and running the 'alsaloop' program (which uses ALSA but you can use the ALSA-to-PulseAudio plugin to make this work) on your microphone.

At the moment, all I can say is don't update Skype. Because once you do, you won't be able to (easily) use it with JACK anymore.

Mrknightofthecheese

Comment #41: Wed, 20 Aug 2014, 20:38 (GMT+1, DST)

Quote


Quote: Maarten Baert

As I said, the latest Skype requires PulseAudio. This creates a LOT of problems. I found a workaround that's somewhat functional but it is extremely convoluted. It involves running PulseAudio and JACK at the same time, loading the PulseAudio JACK sink module, and running the 'alsaloop' program (which uses ALSA but you can use the ALSA-to-PulseAudio plugin to make this work) on your microphone.

At the moment, all I can say is don't update Skype. Because once you do, you won't be able to (easily) use it with JACK anymore.

wow
I think is difficult.
Maybe I will try to don't update skype.
But anyway,can you give me some istrouctions of how to do this?
Just in case.

Maarten Baert

Administrator

Comment #42: Thu, 21 Aug 2014, 20:44 (GMT+1, DST)

Quote


Quote: Mrknightofthecheese

wow
I think is difficult.
Maybe I will try to don't update skype.
But anyway,can you give me some istrouctions of how to do this?
Just in case.

Okay, but don't expect me to debug this :P.

  • Start JACK in playback-only mode (so it doesn't grab your microphone).

  • Run pactl load-module module-jack-sink; pactl set-default-sink jack_out.

  • In theory you should now be able to run alsa_in -j mic -d pulse -p 2048 -n 3 to get your microphone in JACK through PulseAudio, but this appears to be terribly buggy in practice. So I use this instead: alsaloop -C pulse -P pulse -t 100000. The obvious downside is that you will now constantly hear your own voice (you should use headphones, by the way).

    A better alternative would be to use alsa_in -j mic -d hw:Microphone,0 -p 2048 -n 3 but this fails with Skype since it can't use the microphone anymore once JACK is using it. In theory you should be able to load module-jack-source in PulseAudio and set this as the default, and let Skype use that instead. But I haven't been able to get that to work reliably either (more PulseAudio bugs it seems - I'm not surprised).

  • At this point I run this command:

    python -c '
    import subprocess
    import time
    while True:
        ports = subprocess.Popen(["jack_lsp", "-c"], stdout=subprocess.PIPE).stdout.read()
        if "mic:capture_1" in ports and "SimpleScreenRecorder:in_1" in ports and not "mic:capture_1\n   SimpleScreenRecorder:in_1\n   SimpleScreenRecorder:in_2" in ports:
            subprocess.call(["jack_connect", "mic:capture_1", "SimpleScreenRecorder:in_1"])
            subprocess.call(["jack_connect", "mic:capture_1", "SimpleScreenRecorder:in_2"])
        time.sleep(1)
    '

    It starts a Python script that will automatically connect the imported microphone to SimpleScreenRecorder. You can also use the 'patchbay' functionality in QJackCtl, which is also far more efficient, but I needed a command-line version. (Also, this microphone is mono, if you have a stereo mic you would use mic:capture_2 for the second channel.)

  • Now you can start SimpleScreenRecorder, Skype, ...

To stop, close all programs you started in reverse order (first Skype, then SSR, then the python script, ...).

Write a comment