[Bug 184314] Re: Headphone jack does not work in NC1502

embedded_developer roninracer at gmail.com
Sat Mar 6 06:09:34 UTC 2010


HI folks!

I just ran into this bug on my Everex NC1502 with the default install of
9.10 (Karmic Koala).

Anyway many thanks to those of you who identified the problem in the
previous versions of the Alsa driver as it greatly helped me identify
the area in the current driver where the problem still exists.
Thankfully, and frustratingly, the Alsa driver (specifically the
'patch_via.c' file) had a structure change which looks like part of a
driver cleanup. The good news is that they are doing a much better job
with the vt1708 chipset support as a result. The bad news is that the
headphone bug is still there. So I spent some quality time to understand
what the updated driver is doing, what the previous patches did and how
to apply those changes in a way that makes sense. The other good news is
that the Alsa folks cleaned up a lot of stuff that needed to be changed
before. Now all that needs to be put in is the pin assignment and the
other items are not required.

@ Robert Gardner, This bug is in the Alsa driver and not as such a
problem for Canonical per se. It's really the Alsa folks who need to get
this put into their driver and make it stick.

Before you start make sure you read the following page and install the kernel headers so you don't get stuck later.
http://ubuntuguide.org/wiki/Ubuntu:Karmic#Installing_a_package_from_source

Here's what I did in the order I did it in:

Download the latest Alsa driver:
ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.22.1.tar.bz2

You can also find this link at their main page:
http://www.alsa-project.org/main/index.php/Main_Page

My file ended up in my home directory after downloading.

I extracted the tarball into my home directory
cd ~

tar xvf alsa-driver-1.0.22.1.tar.bz2

Then I went into the extracted driver directory.

cd alsa-driver-1.0.22.1

Now typically the first thing I do is to configure and build anything
new before I modify it so I do that here.

./configure

If the configure runs good, then we build it.

make

Providing there's no errors in building, then you can proceed to patch the file.
The file to modify is found in this path:
~/alsa-driver-1.0.22.1/alsa-kernel/pci/hda/

The name of the file is patch_via.c

So I open it as such:

gedit ~/alsa-driver-1.0.22.1/alsa-kernel/pci/hda/patch_via.c &

once gedit loads the file, press CTRL+F to get the search dialog and
enter in the following:

vt1708_auto_create_hp_ctls

This should bring you to the function we want to modify but double check
to make sure. It should look like the following at the beginning:

static int vt1708_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin)
{
	int err;

	if (!pin)
		return 0;

	spec->multiout.hp_nid = VT1708_HP_NID; /* AOW3 */
	spec->hp_independent_mode_index = 1;


Once you see that then modify it as follows:

static int vt1708_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin)
{
	int err;

	if (!pin)
		pin = VT1708_HP_PIN_NID; //to fix bug on nc1502
		//return 0;

	spec->multiout.hp_nid = VT1708_HP_NID; /* AOW3 */
	spec->hp_independent_mode_index = 1;


Then press CTRL+S to save (or click the save button)

Now you can go back to your terminal window and type

make

It will go much faster now and will only need to compile the files that
changed.

Once it finishes then type:

sudo make install

This will install it to the proper place (which is different in the newer versions of Ubuntu as noted in other posts in this thread). 
On my machine the drivers installed to: /lib/modules/2.6.31-20-generic/kernel/sound 

Reboot your system and your newly installed driver should now take
effect.

At the end of the 'make install' the following warning is printed out
and should be noted:

WARNING!!! The mixer channels for the ALSA driver are muted by default!!!
**************************************************************************
You would use some ALSA or OSS mixer to set the appropriate volume.


I hope this info helps someone :)
Chris

-- 
Headphone jack does not work in NC1502
https://bugs.launchpad.net/bugs/184314
You received this bug notification because you are a member of Kernel
Bugs, which is subscribed to linux in ubuntu.




More information about the kernel-bugs mailing list