Page MenuHome

Blender uses the wrong audio device instead of the system default / prioritary, in Linux / PulseAudio
Closed, InvalidPublic


I switched from Windows 7 to Linux openSUSE a few months ago. Although in Windows sound worked well, I could not hear anything when running Blender in Linux. This makes it impossible to preview audio in an animation while playing it on the timeline, which is important since I use Speakers for 3D sound in a scene. I tried both SDL and OpenAL audio from Blender's settings, but each has the same effect. The system uses KDE and the PulseAudio sound server.

I later decided to power on my speakers which I almost never use. Surprisingly, sound is actually being output through them instead, meaning the problem is Blender choosing the wrong audio device. My primary device is a pair of wireless headphones with their USB receiver, but Blender chooses the integrated audio card. All settings (in both PulseAudio and Kmix) specify the headphones as the primary audio device. And there is no other application apart from Blender experiencing this problem. All programs use my headphones as device priority states, but Blender will only go for the integrated sound card which I don't use.

I discussed this on IRC too, and someone who looked at the source code said Blender should choose the default system device. But I looked everywhere, and the wireless headphones are the only primary device. Since for months no update fixed the problem, I decided to report it here. Given that Blender is the only application with this issue, it's likely an error on its end.

Let me know if I can help with more information on fixing this. Note that I can't make any dangerous changes to my system, and am still somewhat new to Linux. I also don't compile Blender, though I can test nightly builds if any.

Event Timeline

Which version of OpenAL have you installed?

You should add the following line to your ~/.alsoftrc (or create the file if necessary):

drivers = pulse

With this configuration OpenAL should use pulse for audio output and you can then use OpenAL inside blender. SDL has a similar feature but using an environment variable.

Closing, as this is a configuration problem on the user side, not a blender bug. Blender has no influence on the device used by SDL or OpenAL in the background.

Joerg Mueller (nexyon) changed the task status from Unknown Status to Invalid.Jan 13 2013, 7:40 PM

My version of OpenAL is 1.14.

I tried creating the .alsoftrc file in my home folder and put that line in it, but still nothing. I'm seeing multiple versions of how that file should be used on google, so I'm trying to find out if I'm doing something wrong.

But like I said, it might not be an OpenAL issue directly since SDL audio has the exact same problem, if I select that instead in Blender -> Preferences -> System. Any suggestion how to fix it for SDL as well? Also weird that Blender is the only program that has this problem if it's not an issue on this end.

Do you save the user preferences with SDL and restarted blender? Might be worth in case OpenAL blocks something. Regarding SDL+pulse:

I remember I have. I tested again to be sure, by setting Audio to SDL in Preferences -> System, saving as default, restarting Blender and previewing audio on the timeline (I checked that audio was set to SDL specifically). Just like with OpenAL, sound is output on the same wrong audio device. So choosing SDL or OpenAL makes no difference, both behave exactly the same. That's another reason why I was tempted to think it's a Blender issue.

So weird, but it seems you were right. I messed around with the PulseAudio and ALSA configuration (no need for that file any more). Now Blender is properly using the correct audio device like everything else. Why it didn't until now is beyond me. But yes, this does mean it wasn't a Blender issue.

I know this is 3 years old however I am having the same issue in Mint Linux.
I have posted here:
I have Nvidia HDMI audio controller and a separate sound card (Auzentech X-Fi Forte 7.1) for my mic.
All applications in pavucontrol (PulseAudio Volume Control) use HDMI audio and the sound works fine.
The "Built-In Audio Analog Stereo" doesn't work for any of my applications in pavucontrol so I know not to use that. Blender is the only program I have where the sound can be seen in volume control but I am unable to actually set it to the correct audio device (clicking doesn't change it).

By default Blender uses OpenAL for playback, more specifically on Linux typically OpenAL soft is used. This can be configured as shown here:

As you already posted it works fine with SDL too.

All of this nonsense isn't going to help with anything. Here's what you do. Go ahead and open up that pulse-audio type thingeymajigger y'all got going on, specifically the one with the gui. Y'all'er gon'na navigate over to that there configuration tab, then go ahead and pull down the menu for the audio device blender wont move off of. Set profile: to "Off" and reset blender. Viola! Blender has now chosen a different audio device, hopefully the one you want it to. Tell that other audio device to go fuck itself to the deepest layer of hell.