Solved Chocolate Doom "Unable to set up sound.", no music or SFX

Greetings, I installed games/chocolate-doom and audio/guspat and haven't been able to get any sound out of the game. I initially thought it was because of mis-configured MIDI emulation but realized that the in-game sound effects are controlled separately. I also noticed Chocolate Doom's startup messages indicate that it's "Unable to set up sound." twice (see below). Because audio is loud and clear for a variety of other apps I've searched these forums thinking it might be related to SDL but I couldn't find anything. I tried setting SDL environment variables after reading the SDL documentation for audio config but none of them made a difference.

This seems to be a pretty popular port so I'm assuming it's just something simple I'm missing. Which steps should I take next?

Chocolate Doom output:
Code:
                         Chocolate Doom 3.0.0
Z_Init: Init zone memory allocation daemon.
zone memory: 0x801c00f00, 1000000 allocated for zone
Using /home/atc/.local/share/chocolate-doom/ for configuration and saves
V_Init: allocate screens.
M_LoadDefaults: Load system defaults.
saving config in /home/atc/.local/share/chocolate-doom/default.cfg
W_Init: Init WADfiles.
 adding /home/atc/.local/share/chocolate-doom/wads/DOOM2.WAD
===========================================================================
                         DOOM 2: Hell on Earth
===========================================================================
 Chocolate Doom is free software, covered by the GNU General Public
 License.  There is NO warranty; not even for MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. You are welcome to change and distribute
 copies under certain conditions. See the source for more information.
===========================================================================
I_Init: Setting up machine state.
Unable to set up sound.
Unable to set up sound.
NET_Init: Init network subsystem.
M_Init: Init miscellaneous info.
R_Init: Init DOOM refresh daemon - [......................................]
P_Init: Init Playloop state.
S_Init: Setting up sound.
D_CheckNetGame: Checking network game status.
startskill 2  deathmatch: 0  startmap: 1  startepisode: 1
player 1 of 1 (1 nodes)
Emulating the behavior of the 'Doom 1.9' executable.
HU_Init: Setting up heads up display.
ST_Init: Init status bar.

Chocolate Doom config:
Code:
video_driver                  ""
window_position               ""
fullscreen                    1
video_display                 0
aspect_ratio_correct          1
integer_scaling               0
vga_porch_flash               0
window_width                  1402
window_height                 1052
fullscreen_width              0
fullscreen_height             0
force_software_renderer       0
max_scaling_buffer_pixels     16000000
startup_delay                 1000
show_endoom                   1
show_diskicon                 1
png_screenshots               0
snd_samplerate                44100
snd_cachesize                 67108864
snd_maxslicetime_ms           28
snd_pitchshift                0
snd_musiccmd                  ""
snd_dmxoption                 ""
opl_io_port                   0x388
use_libsamplerate             0
libsamplerate_scale           0.650000
music_pack_path               ""
timidity_cfg_path             ""
gus_patch_path                "/usr/local/share/guspat/inst/GUS"
gus_ram_kb                    1024
vanilla_savegame_limit        1
vanilla_demo_limit            1
vanilla_keyboard_mapping      1
player_name                   "atc"
grabmouse                     1
novert                        1
mouse_acceleration            2.000000
mouse_threshold               10
mouseb_strafeleft             -1
mouseb_straferight            -1
mouseb_use                    -1
mouseb_backward               -1
mouseb_prevweapon             -1
mouseb_nextweapon             -1
dclick_use                    0
joystick_guid                 ""
joystick_index                -1
joystick_x_axis               0
joystick_x_invert             0
joystick_y_axis               1
joystick_y_invert             0
joystick_strafe_axis          -1
joystick_strafe_invert        0
joystick_look_axis            -1
joystick_look_invert          0
joystick_physical_button0     0
joystick_physical_button1     1
joystick_physical_button2     2
joystick_physical_button3     3
joystick_physical_button4     4
joystick_physical_button5     5
joystick_physical_button6     6
joystick_physical_button7     7
joystick_physical_button8     8
joystick_physical_button9     9
joystick_physical_button10    10
joyb_strafeleft               -1
joyb_straferight              -1
joyb_menu_activate            -1
joyb_toggle_automap           -1
joyb_prevweapon               -1
joyb_nextweapon               -1
key_pause                     69
key_menu_activate             1
key_menu_up                   72
key_menu_down                 80
key_menu_left                 75
key_menu_right                77
key_menu_back                 14
key_menu_forward              28
key_menu_confirm              21
key_menu_abort                49
key_menu_help                 59
key_menu_save                 60
key_menu_load                 61
key_menu_volume               62
key_menu_detail               63
key_menu_qsave                64
key_menu_endgame              65
key_menu_messages             66
key_menu_qload                67
key_menu_quit                 68
key_menu_gamma                87
key_spy                       88
key_menu_incscreen            13
key_menu_decscreen            12
key_menu_screenshot           0
key_map_toggle                15
key_map_north                 72
key_map_south                 80
key_map_east                  77
key_map_west                  75
key_map_zoomin                13
key_map_zoomout               12
key_map_maxzoom               11
key_map_follow                33
key_map_grid                  34
key_map_mark                  50
key_map_clearmark             46
key_weapon1                   2
key_weapon2                   3
key_weapon3                   4
key_weapon4                   5
key_weapon5                   6
key_weapon6                   7
key_weapon7                   8
key_weapon8                   9
key_prevweapon                0
key_nextweapon                0
key_message_refresh           28
key_demo_quit                 16
key_multi_msg                 20
key_multi_msgplayer1          34
key_multi_msgplayer2          23
key_multi_msgplayer3          48
key_multi_msgplayer4          19
 
wish i could offer any useful advice but it works as it should here, tried the default opl3 and native midi with /usr/local/share/timidity/timidity.cfg.

maybe download the sdl2 sources and play around with the test directory?
 
May I ask if you're using any particular sound settings for FreeBSD itself? I'll try swapping to opl3 and native midi/timidity and see if that helps. I may hack on the sdl2 sources a little bit but I was hoping to avoid that. Good place to go next though.
 
Interesting, when I swap to OPL3 I get a few more error lines in the chocolate-doom init. It says

Code:
OPL_init: Failed to find a working driver.
Dude.  The Adlib isn't responding.
 
i might've set this myself:
Code:
$ cat ~/.asoundrc

pcm.oss {

                   type oss

                  device /dev/dsp

          }
can't recall anything else atm.
 
Much appreciated, but that didn't help any either. Isn't .asoundrc for ALSA? I'm using OSS directly. For some applications that require a sound server I'm using SNDIO. Maybe that's where I should look next, trying out ALSA? I'll do some more reading first.
 
I did some digging in the games/chocolate-doom SDL-related source code. The innermost error that SDL could give me was No available audio device. At least I have something to debug as I try different CLI options/envvars. Not sure if it's progress but at least I know not to blame the sound patches, wads, etc. etc.
 
Got it, finally! Turns out SDL2 itself (devel/sdl20) was built with the OSS option disabled. I have no idea how I missed that and have no clue why I would have unchecked it myself. After a rebuild with the right options it works great.
 
Back
Top