# openal-soft can't see playback device



## hedgehog (Oct 12, 2012)

I'm trying to play Diaspora game (based on Free Space 2 engine) under FreeBSD, but I can't get sound working. I have OpenAL-soft installed:

```
$ pkg info -o openal-soft-1.14
openal-soft-1.14: audio/openal-soft
```

However, openal-info show me no playback devices available:

```
$ openal-info
Available playback devices:
    !!! none !!!
Available capture devices:
    OSS Default
Default playback device: 
Default capture device: OSS Default
ALC version: 1.1

** Info for device "OSS Default" **
ALC version: 1.1
ALC extensions:
    ALC_ENUMERATE_ALL_EXT, ALC_ENUMERATION_EXT, ALC_EXT_CAPTURE,
    ALC_EXT_DEDICATED, ALC_EXT_disconnect, ALC_EXT_EFX,
    ALC_EXT_thread_local_context, ALC_SOFT_loopback
OpenAL vendor string: OpenAL Community
OpenAL renderer string: OpenAL Soft
OpenAL version string: 1.1 ALSOFT 1.14
OpenAL extensions:
    AL_EXT_ALAW, AL_EXT_DOUBLE, AL_EXT_EXPONENT_DISTANCE, AL_EXT_FLOAT32,
    AL_EXT_IMA4, AL_EXT_LINEAR_DISTANCE, AL_EXT_MCFORMATS, AL_EXT_MULAW,
    AL_EXT_MULAW_MCFORMATS, AL_EXT_OFFSET, AL_EXT_source_distance_model,
    AL_LOKI_quadriphonic, AL_SOFT_buffer_samples, AL_SOFT_buffer_sub_data,
    AL_SOFTX_deferred_updates, AL_SOFT_direct_channels, AL_SOFT_loop_points
EFX version: 1.0
Max auxiliary sends: 4
Supported filters:
    Low-pass
Supported effects:
    EAX Reverb, Reverb, Echo, Ring Modulator, Dedicated Dialog, Dedicated LFE
```
I have Asus M2N-E motherboard with on-board soundcard:

```
hdac1: <NVIDIA GT106 HDA Controller> mem 0xfbffc000-0xfbffffff irq 16 at device 0.1 on pci7
hdacc1: <NVIDIA (0x0011) HDA CODEC> at cad 0 on hdac1
hdaa1: <NVIDIA (0x0011) Audio Function Group> at nid 1 on hdacc1
pcm3: <NVIDIA (0x0011) (HDMI/DP 8ch)> at nid 5 on hdaa1
hdacc2: <NVIDIA (0x0011) HDA CODEC> at cad 1 on hdac1
hdaa2: <NVIDIA (0x0011) Audio Function Group> at nid 1 on hdacc2
pcm4: <NVIDIA (0x0011) (HDMI/DP 8ch)> at nid 5 on hdaa2
hdacc3: <NVIDIA (0x0011) HDA CODEC> at cad 2 on hdac1
hdaa3: <NVIDIA (0x0011) Audio Function Group> at nid 1 on hdacc3
pcm5: <NVIDIA (0x0011) (HDMI/DP 8ch)> at nid 5 on hdaa3
hdacc4: <NVIDIA (0x0011) HDA CODEC> at cad 3 on hdac1
hdaa4: <NVIDIA (0x0011) Audio Function Group> at nid 1 on hdacc4
pcm6: <NVIDIA (0x0011) (HDMI/DP 8ch)> at nid 5 on hdaa4
```

What could cause this problem?

I'm running FreeBSD-9.1RC1 (amd64).


----------



## SirDice (Oct 12, 2012)

Have you tried audio/openal?

And can you post the output of `$ cat /dev/sndstat`


----------



## hedgehog (Oct 12, 2012)

SirDice said:
			
		

> Have you tried audio/openal?


Not yet. I thought I should use openal-soft as it support OSS.




			
				SirDice said:
			
		

> And can you post the output of `$ cat /dev/sndstat`




```
$ cat /dev/sndstat 
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <Analog Devices AD1988B (Analog 8ch/2.0)> (play/rec) default
pcm1: <Analog Devices AD1988B (Front Analog Headphones)> (play)
pcm2: <Analog Devices AD1988B (Rear Digital)> (play)
pcm3: <NVIDIA (0x0011) (HDMI/DP 8ch)> (play)
pcm4: <NVIDIA (0x0011) (HDMI/DP 8ch)> (play)
pcm5: <NVIDIA (0x0011) (HDMI/DP 8ch)> (play)
pcm6: <NVIDIA (0x0011) (HDMI/DP 8ch)> (play)
```

Sound playback/recording work well, i.e. I can play view movies, listen to music, play games etc. Only problem is openal-soft.


----------



## SirDice (Oct 12, 2012)

hedgehog said:
			
		

> Not yet. I thought I should use openal-soft as it support OSS.


I'm not sure what the difference is but both should support OSS.


----------



## hedgehog (Oct 12, 2012)

Looks like I'm unable to build the game with audio/openal

```
In file included from ./globalincs/pstypes.h:732,
                 from sound/dscap.cpp:10:
./globalincs/vmallocator.h:149:35: warning: no newline at end of file
/usr/local/include/vorbis/vorbisfile.h:75: warning: 'OV_CALLBACKS_DEFAULT' defined but not used
/usr/local/include/vorbis/vorbisfile.h:82: warning: 'OV_CALLBACKS_NOCLOSE' defined but not used
/usr/local/include/vorbis/vorbisfile.h:89: warning: 'OV_CALLBACKS_STREAMONLY' defined but not used
/usr/local/include/vorbis/vorbisfile.h:96: warning: 'OV_CALLBACKS_STREAMONLY_NOCLOSE' defined but not used
  CXX      openal.o
In file included from ./globalincs/pstypes.h:732,
                 from sound/openal.cpp:2:
./globalincs/vmallocator.h:149:35: warning: no newline at end of file
  AR       libcode.a
  CXXLD    fs2_open_3.6.13
libcode.a(audiostr.o): In function `AudioStream::Create(char*)':
audiostr.cpp:(.text+0x2346): undefined reference to `alSource3i'
libcode.a(ds.o): In function `ds_close_channel_fast(int)':
ds.cpp:(.text+0x157a): undefined reference to `alSource3i'
libcode.a(ds.o): In function `ds_close_channel(int)':
ds.cpp:(.text+0x1c70): undefined reference to `alSource3i'
libcode.a(ds.o): In function `ds3d_play(int, int, vec3d*, vec3d*, float, float, int, float, float, int)':
ds.cpp:(.text+0x2d2e): undefined reference to `alSource3i'
libcode.a(ds.o): In function `ds_play(int, int, int, float, float, int, bool)':
ds.cpp:(.text+0x30a8): undefined reference to `alSource3i'
*** [fs2_open_3.6.13] Error code 1

Stop in /media/tmp/Diaspora_R1_Linux/fs2_open/code.
*** [all-recursive] Error code 1
```


----------



## hedgehog (Oct 18, 2012)

Does anyone have a guess why audio/openal-soft couldn't find any playback device?

Does anyone else here use this port?

Update: it work now. KittyCat on the openal-soft irc channel suggested me to use this patch: http://tinyurl.com/9agoseg

```
index 4fce1a0..3c7ace1 100644 (file)
--- a/Alc/backends/oss.c
+++ b/Alc/backends/oss.c
@@ -511,7 +511,7 @@ void alc_oss_probe(enum DevProbe type)
         {
 #ifdef HAVE_STAT
             struct stat buf;
-            if(stat(oss_device, &buf) == 0)
+            if(stat(oss_driver, &buf) == 0)
 #endif
                 AppendAllDeviceList(oss_device);
         }
```

Now it works:

```
$ openal-info
Available playback devices:
    /dev/dsp0
    /dev/dsp1
Available capture devices:
    /dev/dsp0
    Monitor of /dev/dsp0
    Monitor of /dev/dsp1
Default playback device: /dev/dsp0
Default capture device: /dev/dsp0
ALC version: 1.1

** Info for device "/dev/dsp0" **
ALC version: 1.1
ALC extensions:
    ALC_ENUMERATE_ALL_EXT, ALC_ENUMERATION_EXT, ALC_EXT_CAPTURE,
    ALC_EXT_DEDICATED, ALC_EXT_disconnect, ALC_EXT_EFX,
    ALC_EXT_thread_local_context, ALC_SOFT_loopback
OpenAL vendor string: OpenAL Community
OpenAL renderer string: OpenAL Soft
OpenAL version string: 1.1 ALSOFT 1.14
OpenAL extensions:
    AL_EXT_ALAW, AL_EXT_DOUBLE, AL_EXT_EXPONENT_DISTANCE, AL_EXT_FLOAT32,
    AL_EXT_IMA4, AL_EXT_LINEAR_DISTANCE, AL_EXT_MCFORMATS, AL_EXT_MULAW,
    AL_EXT_MULAW_MCFORMATS, AL_EXT_OFFSET, AL_EXT_source_distance_model,
    AL_LOKI_quadriphonic, AL_SOFT_buffer_samples, AL_SOFT_buffer_sub_data,
    AL_SOFTX_deferred_updates, AL_SOFT_direct_channels, AL_SOFT_loop_points
EFX version: 1.0
Max auxiliary sends: 4
Supported filters:
    Low-pass
Supported effects:
    EAX Reverb, Reverb, Echo, Ring Modulator, Dedicated Dialog, Dedicated LFE
```

I have sound in Diaspora!


----------

