# No sound when recording video with OBS Studio or simplescreenrecorder



## PaddyMac (Apr 5, 2021)

I tried running the Linux version of Hollow Knight from GoG under FreeBSD 13-RC4. It ran great despite some Mesa-related errors in the console. I thought it would be fun to record a video as a demo of gaming on FreeBSD. I first tried simplescreenrecorder. There was some lag in the game during recording, but it recorded the video just fine. But there was no sound in the recording. A forum post and a Facebook user I discussed the issue with both suggested OBS Studio, so I tried that too. I started the game and added the source "Window Capture (Xcomposite)" and began recording. The first thing I noticed was the total or near-total lack of lag in the game due to OBS as compared to simplescreenrecorder. In any case, the video recorded fine, but, just as before, there was no sound in the recording. I tried changing the settings in OBS to record audio at 44100 instead of 48000 because I read somewhere that there at least used to be a bug in Pulseaudio regarding a mismatch in sample rates. That didn't help. I thought perhaps I just needed to add the audio stream seperately, so I added "Audio Output Capture (Pulseaudio)" to the sources list and chose /dev/dsp0 which was the only option other than "default". Again there was no audio in the recording.

So I'm stumped. Does anyone have any suggestions about the cause and fix for there being no audio in the recordings? Audio is just fine from the laptop while playing the game.


----------



## PaddyMac (Apr 5, 2021)

Well, I tinkered with this a little bit more and finally got OBS to record audio. I opened up Pulse Audio Volume Control and became suspicious when I realized that it showed no activity from Hollow Knight or any audio sources except the laptop's built-in mic. I had to obtain audio from the source "Audio Input Capture (OSS)". I don't think simplescreenrecorder even supports OSS, but that's fine because OBS works so much better anyway.

But I am wondering now -- is there no sound through Pulse Audio because the game is running through Linux emulation instead of natively? I'm fine with using OSS, but I wonder how often that might become a problem since not all software supports OSS.


----------



## PaddyMac (Apr 12, 2021)

Well, this problem is not as solved as I thought it was. It turns out that ALL of the audio being captured by the OSS sound source was from the microphone. But I thought /dev/dsp1 was the mic which I had muted. Apparently /dev/dsp0 was also capturing the mic. Okay, so I used dspmixer (since I'm use Plasma 5) to reduce the volume on the mic to 0. But now OBS isn't capturing any sound at all. I'm honestly stumped again as to why I can hear sound coming from my laptop's speakers, but when I'm trying to record audio the only source that works is the laptop's microphone.


----------



## sidetone (Apr 12, 2021)

For multimedia/obs-studio, `make config` has the option for sndio, which should work by default.

Then, setting default sounds goes to basic selecting the default inputs and outputs. Run `mixer` as well to see the volume settings.


----------



## George (Apr 12, 2021)

What I remember from using simplescreenrecorder is that I set the default audio via `sysctl hw.snd.default_unit=..`.

There is an option in `mixer` to set the recording device. However, for plugging in "speakers via one device and a microphone via another device" the FreeBSD Sound Wiki recommends virtual_oss(8) Somehow it feels quite complicated.


----------

