Page MenuHome

Blender defaults to "OpenAL Soft" in sound settings, regardless of saved preferences
Closed, ResolvedPublic

Description

System Information
Operating system: Ubuntu 18.04.2
Graphics card: Nvidia Titan X (Pascal)

Blender Version
Broken: ecd086ac3224, 2019-03-06. 03:53

Short description of error
When setting any sound preferences in the User Preferences, Blender ignores then and defaults to OpenAL Soft on the next startup.
Starting blender with -noaudio also exhibits the same behaviour, while starting with -setaudio (and a corresponding option) causes a hard crash when accessing the sound preferences.

Exact steps for others to reproduce the error

  • Set system > sound user preferences to anything other than "OpenAL - Soft"
  • Save User Preferences
  • Restart Blender
  • Sound is once again set to "OpenAL - Soft"

Event Timeline

Sebastian Parborg (zeddb) triaged this task as Confirmed, Medium priority.

Backtrace when going into preference with -setaudio 'NULL'

Thread 1 "blender" received signal SIGSEGV, Segmentation fault.
0x0000555558a6b703 in aud::DeviceManager::getAvailableDeviceNames[abi:cxx11]() ()
    at /home/zed/programmering/blender_master/blender/extern/audaspace/src/devices/DeviceManager.cpp:100
100			devices.push_back({pair.first, pair.second->getPriority()});
(gdb) bt
#0  0x0000555558a6b703 in aud::DeviceManager::getAvailableDeviceNames[abi:cxx11]() ()
    at /home/zed/programmering/blender_master/blender/extern/audaspace/src/devices/DeviceManager.cpp:100
#1  0x0000555558a681f6 in AUD_getDeviceNames () at /home/zed/programmering/blender_master/blender/extern/audaspace/bindings/C/AUD_Special.cpp:407
#2  0x0000555558318d34 in BKE_sound_get_device_names () at /home/zed/programmering/blender_master/blender/source/blender/blenkernel/intern/sound.c:931
#3  0x00005555585924f4 in rna_userdef_audio_device_itemf (UNUSED_C=0x7fffea058188, UNUSED_ptr=0x7fffcdb30978,
    UNUSED_prop=0x55555da898e0 <rna_PreferencesSystem_audio_device>, r_free=0x7fffffffc52c)
    at /home/zed/programmering/blender_master/blender/source/blender/makesrna/intern/rna_userdef.c:493
#4  0x00005555583ca789 in RNA_property_enum_items_ex (C=0x7fffea058188, ptr=0x7fffcdb30978, prop=0x55555da898e0 <rna_PreferencesSystem_audio_device>,
    use_static=false, r_item=0x7fffffffc540, r_totitem=0x0, r_free=0x7fffffffc52c)
    at /home/zed/programmering/blender_master/blender/source/blender/makesrna/intern/rna_access.c:1518
#5  0x00005555583ca8af in RNA_property_enum_items (C=0x7fffea058188, ptr=0x7fffcdb30978, prop=0x55555da898e0 <rna_PreferencesSystem_audio_device>,
    r_item=0x7fffffffc540, r_totitem=0x0, r_free=0x7fffffffc52c)
    at /home/zed/programmering/blender_master/blender/source/blender/makesrna/intern/rna_access.c:1544
#6  0x0000555557553d1a in ui_def_but_rna (block=0x7fffd0744608, type=2048, retval=0, str=0x0, x=0, y=0, width=200, height=20, ptr=0x7fffcdb30978,
    prop=0x55555da898e0 <rna_PreferencesSystem_audio_device>, index=-1, min=0, max=0, a1=-1, a2=-1, tip=0x0)
    at /home/zed/programmering/blender_master/blender/source/blender/editors/interface/interface.c:3655
#7  0x0000555557555053 in uiDefButR_prop (block=0x7fffd0744608, type=2048, retval=0, str=0x0, x=0, y=0, width=200, height=20, ptr=0x7fffcdb30978,
    prop=0x55555da898e0 <rna_PreferencesSystem_audio_device>, index=-1, min=0, max=0, a1=-1, a2=-1, tip=0x0)
    at /home/zed/programmering/blender_master/blender/source/blender/editors/interface/interface.c:4008
#8  0x00005555575c304d in uiDefAutoButR (block=0x7fffd0744608, ptr=0x7fffcdb30978, prop=0x55555da898e0 <rna_PreferencesSystem_audio_device>, index=-1,
    name=0x0, icon=0, x1=0, y1=0, x2=200, y2=20) at /home/zed/programmering/blender_master/blender/source/blender/editors/interface/interface_utils.c:106
#9  0x0000555557589cb6 in ui_item_with_label (layout=0x7fffd0154408, block=0x7fffd0744608, name=0x55555c019c50 "", icon=0, ptr=0x7fffcdb30978,
    prop=0x55555da898e0 <rna_PreferencesSystem_audio_device>, index=-1, x=0, y=0, w_hint=200, h=20, flag=0)
    at /home/zed/programmering/blender_master/blender/source/blender/editors/interface/interface_layout.c:857
#10 0x000055555758cb1c in uiItemFullR (layout=0x7fffd0154408, ptr=0x7fffcdb30978, prop=0x55555da898e0 <rna_PreferencesSystem_audio_device>, index=-1,
    value=0, flag=0, name=0x55555c019c50 "", icon=0)
    at /home/zed/programmering/blender_master/blender/source/blender/editors/interface/interface_layout.c:1816
#11 0x000055555858aae1 in rna_uiItemR (layout=0x7fffd0154b88, ptr=0x7fffcdb30978, propname=0x7fffcf98d5a0 "audio_device", name=0x0, text_ctxt=0x0,
    translate=true, icon=0, expand=false, slider=false, toggle=false, icon_only=false, event=false, full_event=false, emboss=true, index=-1, icon_value=0)
    at /home/zed/programmering/blender_master/blender/source/blender/makesrna/intern/rna_ui_api.c:117
#12 0x000055555858e2d8 in UILayout_prop_call (C=0x7fffea058188, reports=0x7fffffffcf50, _ptr=0x7fffcf686fd0, _parms=0x7fffffffcf00)
    at /home/zed/programmering/blender_master/blender/build/source/blender/makesrna/intern/rna_ui_gen.c:1718
#13 0x00005555583db21d in RNA_function_call (C=0x7fffea058188, reports=0x7fffffffcf50, ptr=0x7fffcf686fd0, func=0x55555da406a0 <rna_UILayout_prop_func>,
    parms=0x7fffffffcf00) at /home/zed/programmering/blender_master/blender/source/blender/makesrna/intern/rna_access.c:6920

I fixed both issues.

The crash was caused by using an invalid name (correct would be Null, not NULL, capitalization matters).

Also note that if you use -noaudio or -setaudio this is not reflected in the user preferences which still shows the user preference stored device (even though it's not used) and allows to change it (won't be effective though until blender is launched without these flags).