Soundblaster Audigy front panel MIDI fails to initialize
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Triaged
|
Low
|
Unassigned |
Bug Description
This bug has been around for a while. I have seen it in the forums circa 2007, and I have provided a solution in 2009. Since the modified code never found its way into the mainstream kernels, I am issuing the fix as a bug report.
The bug concerns the Soundblaster Audigy cards with the emu10k1 chip in both i386 and amd64 architectures, in any kernel (standard, RT etc). They have on-board joystick MIDI. There is an optional front-panel module, which provides its own MIDI UART. Under Linux, the front MIDI does not work. People with dual-boot systems have reported that booting Windows first, then rebooting into Linux makes the UART function properly.
The cause for the bug lies in the fact that the front panel MIDI is routed through a microcontroller (resides in the front panel module), and this microcontroller needs a defined reset signal once after power-up. Up to this point, the GPIO _levels_ are initialized correctly, but the reset _pulse_ is never issued. Essentially, the emu10k1 chip's GPIO2 needs to be pulled high for a brief interval.
WORKAROUND: The bug can be fixed in the file linux-source-
int snd_emu10k1_
{
struct snd_emu10k1_midi *midi;
int err;
unsigned int val; /* Needed in GPOUT2 pulse initialization */
midi = &emu->midi;
if ((err = emu10k1_
return err;
midi->tx_enable = INTE_MIDITXENABLE;
midi->rx_enable = INTE_MIDIRXENABLE;
midi->port = A_MUDATA1;
midi->ipr_tx = IPR_MIDITRANSBU
midi->ipr_rx = IPR_MIDIRECVBUF
midi->interrupt = snd_emu10k1_
midi = &emu->midi2;
if ((err = emu10k1_
return err;
midi->tx_enable = INTE_A_
midi->rx_enable = INTE_A_
midi->port = A_MUDATA2;
midi->ipr_tx = IPR_A_MIDITRANS
midi->ipr_rx = IPR_A_MIDIRECVB
midi->interrupt = snd_emu10k1_
/*** NEW CODE *** Pulse reset line for the second UART */
val = inl(emu->port + A_IOCFG);
outl (val | A_IOCFG_GPOUT2, emu->port + A_IOCFG);
udelay(10); /* udelay is a bad kludge, but remember that this is called only once on startup */
outl (val, emu->port + A_IOCFG);
return 0;
}
I suspect that my use of udelay would make a real kernel hacker cringe, but the level of GPOUT2 needs to remain high for a few microseconds to provide a stable RESET signal.
Anyway, this fixes the problem. I have applied the patch for pretty much every major upgrade of the kernel. It is sufficient to compile the module snd-emu10k1.ko and replace it in the module tree.
---
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: amd64
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/
/dev/snd/
/dev/snd/
CRDA: Error: [Errno 2] No such file or directory
CurrentDesktop: KDE
DistroRelease: Ubuntu 14.04
EcryptfsInUse: Yes
HibernationDevice: RESUME=
InstallationDate: Installed on 2013-12-31 (161 days ago)
InstallationMedia: Kubuntu 12.04.3 LTS "Precise Pangolin" - Release amd64 (20130822)
IwConfig:
eth1 no wireless extensions.
lo no wireless extensions.
MachineType: BIOSTAR Group TA970
NonfreeKernelMo
Package: linux (not installed)
ProcFB: 0 VESA VGA
ProcKernelCmdLine: BOOT_IMAGE=
ProcVersionSign
RelatedPackageV
linux-
linux-
linux-firmware 1.127.2
RfKill:
Tags: trusty
Uname: Linux 3.13.0-29-generic x86_64
UpgradeStatus: Upgraded to trusty on 2014-06-07 (3 days ago)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
_MarkForUpload: True
dmi.bios.date: 01/14/2013
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 4.6.4
dmi.board.
dmi.board.name: TA970
dmi.board.vendor: BIOSTAR Group
dmi.chassis.
dmi.chassis.type: 3
dmi.chassis.vendor: BIOSTAR Group
dmi.modalias: dmi:bvnAmerican
dmi.product.name: TA970
dmi.sys.vendor: BIOSTAR Group
description: | updated |
This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:
apport-collect 1328746
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.