Bug 15943

Summary: Xonar D1 front panel microphone cannot be activated
Product: Drivers Reporter: Peter (phercek)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Severity: normal CC: clemens, florian, rjw
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: Yes Bisected commit-id:
Bug Depends on:    
Bug Blocks: 14885    
Attachments: alsa-info output from the vanilla (mic not working)
alsa-info output, vanilla with sound/pci/oxygen @ 362bc24d6746bcd49bb4853fc5aa7d4c728b3f9e (last working)
set FMIC2MIC bit

Description Peter 2010-05-08 18:17:14 UTC
Hardware: ASUS Xonar D1 PCI 7.1 Audio Card
Distribution: archlinux
Kernel version: (vanilla kernel, not ARCH kernel)
Alsa-lib version: 1.0.23-1
Alsa-utils version: 1.0.23-2
alsa-info.sh outputs of both working  and broken kernel driver versions will be attached.

It is not possible to record anything from my front panel microphone jack after I updated kernel to 2.6.33.

It still works OK with kernel, but does not work with The front panel switch in alsamixer switches only output but not input (mic) now. Before, the switch had impact on both output and input.
When I activate the back panel on the card then everything is working well (back panel connectors are active, front panel connectors are inactive). When I activate the front panel then the front panel microphone is not working (back panel microphone works). The alsamixer front panel switch does not have impact on the microphone any more and no switch was added to control the microphone separately from the output.

I use 32 bit kernels. My brother uses 64 bit kernels and the problem is the same for him too. Although he uses Xonar DX.

I tried to limit the commit which introduced the error. Here is the result:

* I cloned the git tree of vanilla kernel (the one which I use and has the broken front panel microphone)

* I checked out sound/pci/oxygen drivers to the latest one working (git checkout 362bc24d6746bcd49bb4853fc5aa7d4c728b3f9e -- sound/pci/oxygen); built them, added them to my modules as updates and loaded to my kernel; verified that the front panel microphone works

* then I checked out the next revision (65c3ac885ce9852852b895a4a62212f62cb5f2e9) of sound/pci/oxygen; built them, added them to my modules as updates and loaded to my kernel; verified that the front panel microphone does not work

From this I assume this is the commit which broke front panel microphone:
Commit: 65c3ac885ce9852852b895a4a62212f62cb5f2e9
Name: "sound: virtuoso: split virtuoso.c"
Author: Clemens Ladisch <clemens@ladisch.de>  2009-09-28 11:11:27

I posted to alsa-devel list too but nobody responded. I assume that means this is a kernel error and not user space error.
Comment 1 Peter 2010-05-08 18:19:12 UTC
Created attachment 26284 [details]
alsa-info output from the vanilla (mic not working)
Comment 2 Peter 2010-05-08 18:22:18 UTC
Created attachment 26285 [details]
alsa-info output, vanilla with sound/pci/oxygen @ 362bc24d6746bcd49bb4853fc5aa7d4c728b3f9e (last working)
Comment 3 Clemens Ladisch 2010-05-10 07:26:35 UTC
Thank you for finding the offending commit.
I'll look into this.
Comment 4 Clemens Ladisch 2010-05-11 09:32:50 UTC
Created attachment 26334 [details]
set FMIC2MIC bit

Please try the patch.
Comment 5 Peter 2010-05-11 13:51:06 UTC
I tried the patch against vanilla
The difference is that now both front and back panel microphones are active regardless of "Front Pannel" switch in alsamixer. This is not the same behavior as the one before virtuoso.c split (when the switch controlled both output and microphone).
Not being able to have only the front mic or only the back mic active does not seem good since the unused one can add noise. Although I did not notice any significant noise differences. 
I would say the patch makes it different but not fixed. Either the front panel switch should switch both microphone and output (as it worked before the split) or there should be two switches in alsamixer - one for microphone and the other one for output. Or maybe even three switches: backMic activate, frontMic activate, output front/back switch; since it looks like both front and back microphone can be active at the same time.
Comment 6 Clemens Ladisch 2010-05-11 14:53:43 UTC
Even before the split, the driver never changed the FMIC2MIC bit after initialization, so both microphone inputs must always have been active.
Comment 7 Peter 2010-05-11 19:57:41 UTC
It probably depends on something else too. Something I do not know about.
I'm using with sound/pci/oxygen @ 362bc24d6746bcd49bb4853fc5aa7d4c728b3f9e (just before the split) now and when I deactivate "Front Panel" switch in alsamixer then gnome-sound-recorder does not record anything from front panel microphone. But the fact that gnome-sound-recorder's level indicator is changing while recording supports what you are saying. The sound card detects activity of the front panel microphone but mutes it later so nothing is recorded ... or maybe gnome-sound-recorder or alsa mutes it. And this muting does not happen at with your patch applied. Maybe some other added feature makes gnome-sound-recorder or alsa or whatever behave differently. My knowledge of linux sound system is very user level at best :-)
Thanks for helping with this ... even if it stays as it is now with your patch as it is. Definitely better with the patch.
Comment 8 Florian Mickler 2010-12-08 08:57:07 UTC
Fixed in 2.6.34 by 
commit 6a45f7822544c54a2cf070d84f4e85f2fb32ec02
Author: Clemens Ladisch <clemens@ladisch.de>
Date:   Tue May 11 16:34:39 2010 +0200

    ALSA: virtuoso: fix Xonar D1/DX front panel microphone