Asus Xonar DG/DGX soundcard driver for FreeBSD

Hi everyone, especially those who care about high quality audio. Here I post the results of attempt to make another interesting audio device work with FreeBSD. This time it is Asus Xonar DG (DGX also tested and works fine). Interesting device, it had to rack my brains over it. At last, it's possible to watch movies with multichannel audio (gaming not tested, but should work too). This is sad, but there is no recording channel monitoring at the moment, maybe this will be added later. Another sad thing is that optical S/PDIF output was not tested, since I still do not have receiver with toslink inputs :(

The driver is tested on i386 and amd64. Both PCI (Xonar DG) and PCI Express (Xonar DGX) versions of the soundcard are supported. And yes, I remind You as usual, this is open source software, it comes WITHOUT ANY WARRANTY and licensed under BSD 2-clause license.

So download it, test, and do not forget to leave comments! Email me if bugs are discovered, they will be fixed.

1. Features
2. Download
3. How to use
4. Mixer controls
5. Boot time configuration
6. Realtime configuration
7. License

Features

This driver features:

Download

Source link Version Release date What's new
snd_xonardg_v1_source.tar.gz 1 2019.09.23 Read

How to use

All operations (except for downloading and extraction) should be done as root.


1. Download source code using link above, or use fetch (note version numbers):

% fetch https://sndbro.ru/soft/snd_xonardg/files/snd_xonardg_v1_source.tar.gz

2. Extract archive:

% tar xf snd_xonardg_v1_source.tar.gz

3. Move into created directory and build driver:

# cd snd_xonardg_v1_source
# make && make install

4. Load driver:

# kldload snd_xonardg

Enjoy! Feel free to email me (ap at sndbro.ru) with test results and suggestions on further improvements.


If make has failed, please make sure Your /etc/make.conf file doesn't have NO_MODULES=... variable set. Also make sure FreeBSD source code tree is installed under /usr/src/sys.


To make driver automatically loadable at startup, insert 'snd_xonardg_load="YES"' line into /boot/loader.conf file. I recommend doing this only after test of the driver, if it doesn't cause abnormal system behavior, such as kernel panic.

Mixer controls

Use mixer(8) to control output volume, input sensitivity, and recording source selection.

Use 'vol' device to control output volume. It is possible to enable 'pcm' device in addition to 'vol' device to increase compatibility with software, which requires 'pcm' device to control volume (see below for details). If both 'vol' and 'pcm' devices enabled, resulting volume calculated as (vol + pcm) / 2.

NOTE: Only CS4245 codec have volume attenuator, thus volume can be controlled only if headphones (or other device) connected to the HD-Audio front panel, and if headphones (or other device) connected to the rear green socket providing that stereo (not multichannel) track is playing, and sysctl(8) variable dev.pcm.X.rear_out_line set to 0. Volume cannot be changed at all while playing multichannel audio. It's up to external amplifier to adjuct volume in such case.

Use 'igain' device to adjust input sensitivity. Sensitivity varies from -12 db (igain = 0) to +12 db (igain = 100). Use igain = 50 to set sensitivity to 0 db.

Input sources are 'line' (rear input), 'mic' (front and rear inputs, mic bias voltage applied to rear port, increased sensitivity), and 'aux' (onboard 4-pin connector, used to connect of analog CD-Audio, TV tuners etc). Use mixer =rec [src] where [src] is either line, mic, or aux to select input to record from.

Boot time configuration

These variables are intended for use in /boot/devic.hints file. Settings will take effect after reboot.


hint.pcm.X.extvol 0=disabled, 1=enabled. If enabled, adds 'pcm' mixer device to control output volume in conjunction with 'vol'. Resulting volume level calculated as (vol + pcm) / 2. Used for compatibility, allows setting volume level using 'pcm' mixer device, if 'vol' is set to 100. Default value: 0.

Runtime configuration

Following sysctl(8) variables are available:


dev.pcm.X.dac_softramp 0=disabled, 1=enabled. Controls of DAC volume SoftRamp function. If enabled, actual volume level changes smoothly if adjusted using mixer(8), if disabled, actual volume level changes just in a tick. Default value: 1.
dev.pcm.X.pga_softramp 0=disabled, 1=enabled. Controls of ADC sensitivity SoftRamp function. If enabled, actual input sensitivity level changes smoothly if adjusted using mixer(8), if disabled, actual input sensitivity level changes just in a tick. Default value: 1.
dev.pcm.X.playdst 0=analog output only, 1=digital output only, 2=analog and digital outputs simultaneously. Selects playback active outputs. This setting cannot be changed while playback is in progress. Default value: 2.
dev.pcm.X.rear_out_line 0=rear green port sourced from cs4245 codec through drv601 directpath driver, volume control available and headphones can be connected to this port directly. 1=rear green port sourced from CS4361 DAC through opamp buffer, signal is line-level, volume control unavailable. All this meaningful only in case when 2-channel (stereo) stream is playing. Default value: 0.

License

Copyright (c) 2019 Aleksei Palyutin 
All rights reserved.                                                         

Redistribution and use in source and binary forms, with or without           
modification, are permitted provided that the following conditions           
are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND       
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE        
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE   
ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE      
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL   
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS      
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)        
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT    
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY    
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF       
SUCH DAMAGE.

Please take a moment and comment on this article

No comments yet...