You are not logged in.

#1 2009-03-02 19:43:23

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Hacking around jack-sense

I seem to be one of those unfortunate souls for whom headphone jack-sense does not work.

[boring details]
The hardware is Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 03), which is detected by alsa as Intel ICH6 with unknown codec at irq 17. This happily loads snd_intel8x0 but that's it. No quirks or module parameters work. I did a little more digging and found that the particular chipset in my laptop is Conexant CX20468. I dug some more and found the hardware manual for that chip and skimmed through it, but I did not find anything resembling headphone jack sensing. Also, there does not seem to be any code for jack sense in the respective alsa code for that chipset (but I may be mistaken here, this code was too hard for me).
[/boring details]

I found a bug filed for this hardware in Alsa's bugtracker, added my commentary and waited several months. Nothing. Not even a comment. I noticed, however, that if I plug in my headphones, a certain register in /proc/asound/card0/codec97#0/ac97#0-0+regs  changes from 0000 to 8000 and back to 0000 if I unplug them. I guess you already see where I am going with this.

I need your help here archers, what in your opinion would be the simplest way to implement jack-sensing in userspace, using the register mentioned above?

Offline

#2 2009-03-21 15:00:14

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: Hacking around jack-sense

So... I wrote a daemon smile

This is actually the first time I have written anything interfacing with the system. It's in python and it's ugly, but works.

http://fijam.eu.org/other/headd

Every two seconds it parses ac97 registers for the line that changes when I plug/unplug the headphones and either mutes Master and unmutes Headphone or otherwise with amixer. I use PCM system-wide for volume control.

I have yet to write a rc.d script (and since I am not able to catch the pid with pidof I'll need to add some pid action to the daemon itself) and perhaps un-hardcode amixer commands.

And knowing Murphy's laws I already prepared a template for the next poster:
"You needn't have done this, all you have to do to get your jack sense working is set <some obscure option> in <place I'd never look into> to <hWhat?>"

Anyway, you might find it useful if you have a laptop with ac97-based audio chip for which jack-sense does not work out of the box but some of the ac97 registers change when you plug/unplug the headphones. Cheers.

Offline

Board footer

Powered by FluxBB