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

Closed
opened 2013-01-11 23:45:25 +01:00 by Mircea Kitsune · 18 comments

%%%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.%%%

%%%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.%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Member

%%%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.%%%

%%%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.%%%
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Author

%%%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.%%%

%%%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.%%%
Member

%%%Do you save the user preferences with SDL and restarted blender? Might be worth in case OpenAL blocks something. Regarding SDL+pulse: http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/PerfectSetup#SDL%%%

%%%Do you save the user preferences with SDL and restarted blender? Might be worth in case OpenAL blocks something. Regarding SDL+pulse: http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/PerfectSetup#SDL%%%
Author

%%%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.%%%

%%%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.%%%
Author

%%%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.%%%

%%%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.%%%

Added subscriber: @jeremyofmany

Added subscriber: @jeremyofmany

I know this is 3 years old however I am having the same issue in Mint Linux.
I have posted here:
http://blender.stackexchange.com/questions/62898/linux-unable-to-set-blender-to-correct-pulseaudio-device
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).

I know this is 3 years old however I am having the same issue in Mint Linux. I have posted here: http://blender.stackexchange.com/questions/62898/linux-unable-to-set-blender-to-correct-pulseaudio-device 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).
Member

By default Blender uses OpenAL for playback, more specifically on Linux typically OpenAL soft is used. This can be configured as shown here: https://github.com/kcat/openal-soft/blob/master/alsoftrc.sample

As you already posted it works fine with SDL too.

By default Blender uses OpenAL for playback, more specifically on Linux typically OpenAL soft is used. This can be configured as shown here: https://github.com/kcat/openal-soft/blob/master/alsoftrc.sample As you already posted it works fine with SDL too.

Added subscriber: @paul_sunyan

Added subscriber: @paul_sunyan

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.

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.

Added subscriber: @elroberto

Added subscriber: @elroberto

Thank you, Timberly. I was going nuts and that worked for me - turned off all devices except my headphones and rebooted Blender, headphones then worked. Very helpful. Masterful use of punctuation in the dialect, btw. I used google translate Texan to Northern English to extract the necessary bits, lol

Thank you, Timberly. I was going nuts and that worked for me - turned off all devices except my headphones and rebooted Blender, headphones then worked. Very helpful. Masterful use of punctuation in the dialect, btw. I used google translate Texan to Northern English to extract the necessary bits, lol

Added subscriber: @Domarius-1

Added subscriber: @Domarius-1

I still feel it's a Blender issue and should be re-opened. Blender is the only program that is not obeying which sound device is selected in my system tray (Manjaro KDE). Seems other users are having the same issue.

Going into Preferences, System, Sound, and changing the "Audio Device" to "SDL" fixed it for me, but perhaps I got lucky.
As an experiment, I then created the ~/.alsoftrc file and added "drivers = pulse" to it as in the original answer, and changed the Blender Audio Device from "SDL" back to the default value of "OpenAL - OpenAL Soft" and the sound still plays out of the correct device. To make sure, I rebooted the whole computer and it still works correctly.

However, because I did it in this order, I have no idea if the fix was creating the alsoftrc file, or changing to SDL and back. It could be that changing it to SDL and back caused Blender to change which audio device it prefers. I thought this was worth mentioning since OP said that the alsoftrc file thing didn't work for them.

Perhaps flag the issue as "minor"?

I still feel it's a Blender issue and should be re-opened. Blender is the only program that is not obeying which sound device is selected in my system tray (Manjaro KDE). Seems other users are having the same issue. Going into Preferences, System, Sound, and changing the "Audio Device" to "SDL" fixed it for me, but perhaps I got lucky. As an experiment, I then created the ~/.alsoftrc file and added "drivers = pulse" to it as in the original answer, and changed the Blender Audio Device from "SDL" back to the default value of "OpenAL - OpenAL Soft" and the sound still plays out of the correct device. To make sure, I rebooted the whole computer and it still works correctly. However, because I did it in this order, I have no idea if the fix was creating the alsoftrc file, or changing to SDL and back. It could be that changing it to SDL and back caused Blender to change which audio device it prefers. I thought this was worth mentioning since OP said that the alsoftrc file thing didn't work for them. Perhaps flag the issue as "minor"?
Member

@Domarius-1 that just means that blender is the only application that uses OpenAL on your system. I'm quite confident that it is the ~/.alsoftrc file, you can ensure by removing the file and restart blender and then put it back without ever switching to SDL.

So, even if you feel it is a blender issue, there's nothing we can do, that's simply how OpenAL works.

@Domarius-1 that just means that blender is the only application that uses OpenAL on your system. I'm quite confident that it is the `~/.alsoftrc` file, you can ensure by removing the file and restart blender and then put it back without ever switching to SDL. So, even if you feel it is a blender issue, there's nothing we can do, that's simply how OpenAL works.

Added subscriber: @JohanTriHandoyo

Added subscriber: @JohanTriHandoyo
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#33840
No description provided.