Inertia's picture

OpenAL Device Choices

I've recently bought a Creative Labs Soundblaster X-Fi Platinum Fatal1ty Champion Series (TM)(C)(R) card (hope I did not forget any buzzwords) and getting the impression that it finally works as it should, but AudioContext is giving me some troubles porting the old Alut code. (I want to confirm that OpenTK's X-Ram class works as advertised by me :P)

The card did not ship with a driver CD, I've installed latest drivers and oalinst right from creative labs website.

My impression is that AudioContext uses the wrong tokens to select it's device, here's c&p from some AlcGetString queries.

Mind the "Detected by OpenTK" is simply what AudioContext.AvailableDevices returns. Also I have nothing connected to the SPDIF Out, so it's correctly recognizing Speakers to use for output.

Using Creative Labs driver (result identical for x32 and x64):

Quote:

Detected by OpenTK:
Generic Software
Returned by AlcGetString.DefaultDeviceSpecifier:
Generic Software
Returned by AlcGetString.DefaultAllDevicesSpecifier:
Generic Software on Speakers (Creative SB X-Fi)
Returned by AlcGetStringList.DeviceSpecifier:
Generic Software
Returned by AlcGetStringList.AllDevicesSpecifier:
Generic Software on Speakers (Creative SB X-Fi)
Generic Software on SPDIF Out (Creative SB X-Fi)

using OpenAL Soft drivers (copied to app dir, result identical for x32 and x64)

Quote:

Detected by OpenTK:
DirectSound Software
Wave File Writer
Returned by AlcGetString.DefaultDeviceSpecifier:
DirectSound Software
Returned by AlcGetString.DefaultAllDevicesSpecifier:
DirectSound Software on Speakers (Creative SB X-Fi)
Returned by AlcGetStringList.DeviceSpecifier:
DirectSound Software
Wave File Writer
Returned by AlcGetStringList.AllDevicesSpecifier:
DirectSound Software on Speakers (Creative SB X-Fi)
DirectSound Software on SPDIF Out (Creative SB X-Fi)
Wave File Writer

------------------------------------------------

However when I run the EfxEnumerateWin32.exe from the OpenAL SDK I get these device choices:

Quote:

Enumerate EFX Application

Select OpenAL Device:
1. SB X-Fi Audio [E800](DEFAULT)
2. Generic Software

Running EfxEnumerateWin64.exe gives:

Quote:

Enumerate EFX Application

Select OpenAL Device:
1. Generic Software(DEFAULT)

---------------------------------------------

Running openal-info.exe (with OpenAL Soft in it's dir) returns

Available playback devices:
    DirectSound Software on Speakers (Creative SB X-Fi)
    DirectSound Software on SPDIF Out (Creative SB X-Fi)
    Wave File Writer
Available capture devices:
    WaveIn on Line-In 2/Mic 2 (Creative SB X-
    WaveIn on Digital-In (Creative SB X-Fi)
    WaveIn on S/PDIF-In (Creative SB X-Fi)
    WaveIn on Auxiliary (Creative SB X-Fi)
    WaveIn on Microphone (Creative SB X-Fi)
    WaveIn on Auxiliary 2 (Creative SB X-Fi)
    WaveIn on Line-In (Creative SB X-Fi)
Default device: DirectSound Software
Default capture device: WaveIn on Line-In 2/Mic 2 (Creative SB X-
ALC version: 1.1
ALC extensions:
    ALC_ENUMERATE_ALL_EXT, ALC_ENUMERATION_EXT, ALC_EXT_CAPTURE, ALC_EXT_EFX
OpenAL vendor string: OpenAL Community
OpenAL renderer string: OpenAL Soft
OpenAL version string: 1.1 ALSOFT 1.8.466
OpenAL extensions:
    AL_EXTX_buffer_sub_data, AL_EXT_EXPONENT_DISTANCE, AL_EXT_FLOAT32,
    AL_EXT_IMA4, AL_EXT_LINEAR_DISTANCE, AL_EXT_MCFORMATS, AL_EXT_OFFSET,
    AL_EXTX_source_distance_model, AL_LOKI_quadriphonic
EFX version: 1.0
Max auxiliary sends: 2
Available filters:
    Low-pass
Available effects:
    EAX Reverb
    Reverb
    Echo

Running openal-info.exe without OpenAL Soft returns:

Available playback devices:
    SB X-Fi Audio [E800]
    Generic Software on Speakers (Creative SB X-Fi)
    Generic Software on SPDIF Out (Creative SB X-Fi)
Available capture devices:
    Line-In 2/Mic 2 (Creative SB X-
    Digital-In (Creative SB X-Fi)
    S/PDIF-In (Creative SB X-Fi)
    Auxiliary (Creative SB X-Fi)
    Microphone (Creative SB X-Fi)
    Auxiliary 2 (Creative SB X-Fi)
    Line-In (Creative SB X-Fi)
Default device: SB X-Fi Audio [E800]
Default capture device: Line-In 2/Mic 2 (Creative SB X-
ALC version: 1.1
ALC extensions:
    None
OpenAL vendor string: Creative Labs Inc.
OpenAL renderer string: SB X-Fi Audio [E800]
OpenAL version string: OpenAL version 1.1
OpenAL extensions:
    EAX
EAX1.0
EAX2.0
EAX3.0
EAX4.0
EAX5.0
 
EFX version: 1.0
Max auxiliary sends: 2
Available filters:
    Low-pass
Available effects:
    EAX Reverb
    Reverb
    Chorus
    Distortion
    Echo
    Flanger
    Frequency Shifter
    Vocal Morpher
    Pitch Shifter
    Ring Modulator
    Autowah
    Compressor
    Equalizer

openal-info is most likely an x86 app (came with the OpenAL Soft x86 driver), could it be that my x64 driver is simply broken?

I kinda miss the "Generic Hardware" device, which is probably the "SB X-Fi Audio [E800]". (mind the device name is identical to "OpenAL renderer string: SB X-Fi Audio [E800]" returned by openal-info)

Either way I think AudioContext should use AlcGetString.DefaultAllDevicesSpecifier to select the default device. With both drivers it selects the most appropriate device.

Edit: Could it be that the problem is related to either a) the disabled onboard sound or b) the graphic card's HDMI out? Another solution might be http://icculus.org/alextreg/wiki/ALC_ENUMERATE_ALL_EXT currently AudioContext uses ALC_ENUMERATE_EXT only.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

There's a good chance that the alsa driver doesn't support frequency=16K. I'll have to try with 44K or other common frequencies to make sure, but there's a good chance this is behind the error.

Inertia's picture

Here's a little toy to try out some setups. Mono 16 Bit is hardcoded, because 8 Bit sounds so bad that you don't want to know whether it works or not.

AttachmentSize
Parrot Release x86.rar49.85 KB
Mincus's picture

Works with my setup (Windows 7 RC x64, oalinst that came with UT3). It's a bit noisy but I think that's just the cheap onboard mic picking up the laptop's fan through the case. Probably doesn't help that I have the lid closed as well (I use an external monitor and keyboard with it at home).

the Fiddler's picture

@Mincus: Thanks for testing. The 16K capture frequency probably doesn't help with noise either, but the point is it works!

@Inertia: I've built and tested OpenAL Soft 1.8, which works flawlessly - Audio-info output attached. Parrot works perfectly with 1.8 (will be the default on next Ubuntu release). With 1.4 (current Ubuntu) only works with the 'OSS Capture' device. If I select 'ALSA Capture on default', it fails with 'The handle returned by Alc.OpenCaptureDevice is null.' and changing frequency doesn't help.

This looks like an OpenAL Soft issue, as the newest version work perfectly no matter what. As long as the user gets to choose a device this won't be a problem, so I wouldn't worry too much about this.

Parrot is a great little application, by the way!

AttachmentSize
audio-info-oalsoft-1.8-ubuntu.txt3.71 KB
Inertia's picture

Thanks for testing, this is looking good :)

[noise]
If getting some noise at 16KHz, try using 22050 or 44100 Hz and turn off all other sound sources off (radio, TV, gf, etc.) in the room for best results. Depending on the microphone even the PC fans can be heard, this is out of OpenTK's (and OpenAL's) influence though. Some audio codecs include filtering of frequencies that cannot be produced by human voices, which may help remedy this problem.

[driver bugs]
The only action I'm willing to take is creating some const string[] that holds AL Version strings of known buggy drivers, afaik (==wikipedia) OSS is the predecessor of ALSA and I don't think it's a good idea considering it a candidate to be a default device.

[device choice]
It is the right course of action to give the user a choice which device is best. There may be a surround system connected to SPDIF, but at the same time a headset connected to 3.5mm jacks. How can the application make a choice which one I'd like to use?

[parrot]
Just hacked this together yesterday, but if you have no objections we should add it to the examples launcher. It'll need some comments though and I have to make it more newbie proof (atm it assumes you click "Stop recording" before you exit the app, etc). It does not give you any choice which playback device you'd like (simply uses default) because the scope of the app is to test the AudioCapture class.