Public bug reported:
The snd-oxygen driver mishandles negative capture volume values on ASUS
Xonar DGX sound cards.
The driver stores capture volume values in plain char variables.
However, Ubuntu's kernel is compiled with -funsigned-char, making plain
char unsigned. The driver is meant to support a volume range of -24
through +24, but negative values are instead stored and read back as
unsigned byte values.
For example, setting a capture volume to -1 results in an ALSA control
setting of 255 instead of -1.
I reproduced this on Ubuntu 26.04 with kernel 7.0.0-44-generic.
Hardware:
Sound card: ASUS Xonar DGX
Audio chipset: C-Media CMI8788 (Oxygen HD Audio)
PCI ID: 13f6:8788
Subsystem ID: 1043:8521
Kernel driver: snd_oxygen
Software
Ubuntu: 26.04
Kernel: 7.0.0-44-generic
ALSA utilities: 1.2.15.2
Expected behavior
The Line Capture Volume ALSA control advertises a valid range of -24
through +24, in increments of 1 (0.5 dB). Setting a negative volume
should return the same negative value when the control is read back.
For example:
amixer -c 0 -- cset numid=19 '-1,-1'
should result in:
values=-1,-1
In actual behavior, running:
amixer -c 0 -- cset numid=19 '-1,-1'
results in:
values=255,255
The value remains 255 when read back with:
amixer -c 0 cget numid=19
This is not merely an alsamixer display problem; the ALSA control itself
returns the incorrect value.
When adjusting the control downward through alsamixer, the value also
exhibits an unexpected transition at zero, with channel values
temporarily becoming inconsistent.
Steps to reproduce
Boot Ubuntu 26.04 with an ASUS Xonar DGX using the snd_oxygen driver.
Identify the Line Capture Volume control:
amixer -c 0 controls
amixer -c 0 cget numid=19
Set the volume to a negative value:
amixer -c 0 -- cset numid=19 '-1,-1'
Read the control again:
amixer -c 0 cget numid=19
You will see that the returned values are 255,255 instead of -1,-1.
SOURCE CODE DIAGNOSIS:
In sound/pci/oxygen/xonar_dg.h, the driver declares:
char input_vol[4][2];
In sound/pci/oxygen/xonar_dg_mixer.c, the input volume application
function is declared:
static int input_volume_apply(struct oxygen *chip, char left, char
right)
The input volume control callbacks use these values as signed volume
settings, with a range of -24 through +24.
However, because Ubuntu kernel build uses:
KBUILD_CFLAGS += -funsigned-char
the result is that plain char is unsigned in this kernel build. Negative
volume values are therefore interpreted as unsigned byte values.
PROPOSED FIX (WHAT WORKED FOR ME):
Use explicitly signed 8-bit types for the volume values.
In sound/pci/oxygen/xonar_dg.h, change:
char input_vol[4][2];
to:
s8 input_vol[4][2];
In sound/pci/oxygen/xonar_dg_mixer.c, change:
static int input_volume_apply(struct oxygen *chip, char left, char
right)
to:
static int input_volume_apply(struct oxygen *chip, s8 left, s8 right)
After rebuilding the snd-oxygen module and rebooting with the rebuilt
module, the following command worked correctly:
amixer -c 0 -- cset numid=19 '-1,-1'
The ALSA control readback correctly returned:
values=-1,-1
The negative volume range also worked correctly, including the lower
limit of -24.
This confirms that changing the volume storage and function parameters
to explicitly signed 8-bit types fixes the problem.
Additional information
The kernel configuration includes:
CONFIG_SND_OXYGEN_LIB=m
CONFIG_SND_OXYGEN=m
The affected module is snd-oxygen.ko, which depends on snd-oxygen-lib.
ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: linux-image-7.0.0-44-generic 7.0.0-44.44
ProcVersionSignature: Ubuntu 7.0.0-44.44-generic 7.0.14
Uname: Linux 7.0.0-44-generic x86_64
ApportVersion: 2.34.1-0ubuntu0.1
Architecture: amd64
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/by-path',
'/dev/snd/controlC0', '/dev/snd/pcmC0D1c', '/dev/snd/pcmC0D1p',
'/dev/snd/pcmC0D0c', '/dev/snd/pcmC0D0p', '/dev/snd/seq', '/dev/snd/timer']
failed with exit code 1:
CasperMD5CheckResult: pass
Date: Fri Nov 20 15:13:12 2026
InstallationDate: Installed on 2026-05-03 (202 days ago)
InstallationMedia: Ubuntu-Server 26.04 "Resolute Raccoon" - Release amd64
(20260420.1)
Lsusb:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 046d:c313 Logitech, Inc. Internet 350 Keyboard
Bus 001 Device 003: ID 413c:a001 Dell Computer Corp. Hub
Bus 001 Device 004: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
MachineType: Dell Inc. PowerEdge T130
ProcEnviron:
LANG=en_US.UTF-8
PATH=(custom, no user)
SHELL=/bin/bash
TERM=xterm-256color
ProcFB: 0 mgag200drmfb
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-7.0.0-44-generic
root=/dev/mapper/ubuntu--vg-ubuntu--lv ro
crashkernel=2G-4G:320M,4G-32G:512M,32G-64G:1024M,64G-128G:2048M,128G-:4096M
PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No
PulseAudio daemon running, or not running as session daemon.
RfKill:
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 05/03/2018
dmi.bios.release: 2.5
dmi.bios.vendor: Dell Inc.
dmi.bios.version: 2.5.0
dmi.board.name: 0FGCC7
dmi.board.vendor: Dell Inc.
dmi.board.version: A01
dmi.chassis.type: 17
dmi.chassis.vendor: Dell Inc.
dmi.modalias:
dmi:bvnDellInc.:bvr2.5.0:bd05/03/2018:br2.5:svnDellInc.:pnPowerEdgeT130:pvr:rvnDellInc.:rn0FGCC7:rvrA01:cvnDellInc.:ct17:cvr:skuSKU=NotProvided;ModelName=PowerEdgeT130:pfa:
dmi.product.name: PowerEdge T130
dmi.product.sku: SKU=NotProvided;ModelName=PowerEdge T130
dmi.sys.vendor: Dell Inc.
** Affects: linux (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug resolute
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2175433
Title:
Xonar DG/DGX: snd-oxygen capture volume controls return 255 for
negative values
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2175433/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs