Tuesday, May 4, 2010

Fixing sound issue on Sony vaio VPCEB1S1E

edit:The easiest solution (which is also persistent!) is explained in a newer post which can be found here!!!


This blogpost will explain how to make sound work on a Sony Vaio VPCEB1S1E. The solution is based on bug report 445889. Where Arwin Tugade posted a solution. In this post I'll try to provide a more detailed explanation.

There are 2 solutions: an easy one and a hard one. The easy one is however not persistent. So after each reboot you'll have to redo all the steps to enable your sound. The hard one on the other hand is persistent. I will explain both.

Easy (non persistent) solution



For the easy solution a python script has to be downloaded. This script is called HDA Analyzer and provides a GUI which will help us to enable the intern speaker of our notebook. (HDA Analyzers wiki can be found on:http://www.alsa-project.org/main/index.php/HDA_Analyzer)
First you'll have to download the script. This can be don by starting up a terminal and execute the following command:
wget -O run.py http://www.alsa-project.org/hda-analyzer.py

Next will have to run this script with super user privileges. This can be done by executing the next command in the terminal:
sudo python run.py

You will be prompted to enter your password. After entering your password a GUI will start up. In the GUI click on "Node[0x19] PIN" in the list on the left-side. Then in the right part you'll have to change the value of the dropdownlist next to VREF to HIZ. See picture:

Now the sound of your notebook should work!

When you close the application a popup will ask "HDA-Analyzer: Would you like to revert settings for all HDA codecs?". Answer No.

Hard (persistent) solution



Warning: The following instructions are to be used on Lucid only. If the process isn't performed right, it might break your system. And thus you will need to re-install your computer. I hereby clearly state that I won't take any responsibility for broken systems.

Before trying this you might first check out the solution above because if that won't work, this also won't work. For a persistent solution we wil create a custom kernel. This means we need to recompile the kernel. Therefore we first need to be sure the have some packages. This by entering the 2 following commands:
sudo apt-get install fakeroot kernel-wedge build-essential makedumpfile kernel-package

and
sudo apt-get build-dep linux


Then we need to download the kernel source, do this by entering the following commands:

sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)

&
apt-get source linux-image-$(uname -r)


Note: The source will be placed in your current working directory. You can use the pwd command to print this directory out. As I myself am new to building kernels I have just put it in my home folder. But there might be a better practice.

Note2:The `uname -r` command makes sure that you download the source of the kernel you are currently using

Go into the directory with the kernel source:
It's name will start with linux and contain the first part of the kernel release number.
For example when the `uname -r` command returns "2.6.32-21-generic". The kernel source will be in a map with a name like `linux-2.6.32`. In that case you want to go into that directory by executing the following command:

cd linux-2.6.32


Now we are going to change the source. Therefore we need to open the file that needs to be changed in a text-editor. You can open it with gedit by executing the following command:

gedit sound/pci/hda/patch_realtek.c


Then find “static struct hda_verb alc269_init_verbs[] = {“. In my file it was around line number 13272 but it may be different because you might have got another version of the file, depending on your current kernel. In this struct definition (thus the code between curly brackets) you must find the line stating:
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},

and you will have to change this line into:

{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},

Than save and quit the file.

Now that the source is changed we need to recompile the kernel.
This is done by executing the following 2 commands:
fakeroot debian/rules clean


And

AUTOBUILD=1 fakeroot debian/rules binary-debs-FLAVOUR

Where FLAVOUR must be changed to the flavour you wish. If you type `uname -r` in your terminal you will get the release of your kernel and normally this contains the flavour you need. For example:
if `uname -r` results in the following answer:
2.6.32-21-generic

Then your flavour is generic and the second command should have been:
AUTOBUILD=1 fakeroot debian/rules binary-debs-generic

I haven't test this because I had executed
AUTOBUILD=1 fakeroot debian/rules binary-debs

by mistake and this command builds kernels for every possible flavour. You can do this also, but I don't recommend this since building may take a while...

After the building of the kernel you will have 2 deb files. You can install them by executing the command:

sudo dpkg -i name_of_file.deb


I have first installed the header file and then the image, but I don't know if the order is important.

URLs of the webpages that helped me a lot:



The bug report that showed me the solution. (THANK YOU Arwin Tugade)
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/445889

The necessary information on Kernel compiling
https://help.ubuntu.com/community/Kernel/Compile

7 comments:

  1. Thank you!!!! it was quiet helpful.. I opted for the easy solution.

    ReplyDelete
  2. After reboot you'll have to perform the steps again. But I've modified the files somehow so that you just have to run the python script and that sound will work immediately without extra user interaction. If I find the time I will post the files.
    This will also make it possible to make easy persistent solution -> instructions will follow in new blogpost.

    ReplyDelete
  3. Yeah I realised that! I am new to this and would like to know why this change is needed.

    ReplyDelete
  4. The easy persistent solution can be found on http://ubuntu42.blogspot.com/2010/05/easiest-fix-for-sound-sony-vaio.html

    I am not 100% sure why the first solution isn't persistent but I'll try to explain (note that is only what I think and can be false). I think it has something to do with how ubuntu (linux in general) represents hardware. Hardware that is detected by linux will be 'mounted' as a node. These nodes can be found in the /dev directory. When you boot up your ubuntu installation the kernel will load the necessary drivers and will make nodes (which are like virtual devices) in the /dev directory (e.g. /dev/snd). These nodes can be used to communicate with the hardware. So when you used the easy solution of this blogpost you just changed your hardware configuration. But these configurations are volatile so when power gone, they will be lost. And after each boot of your system the nodes should be made and the necessary configuration should be performed.

    The new solution is in fact the easy non persistent solution. But I've stripped out the GUI and have hard coded the change that had to be done by the user. To make the solution persistent I've written a little script that will call the pythonscript which does the automatic configuration. Finally to make installation easy I've supplied a Install script which will do all the work!

    ReplyDelete
  5. Upgrading Alsa from 1.0.21 (Lucid Lynx default) to 1.0.23.
    fixed the sound issue on my VPCEB1S1E.

    Upgrading step-by-step:
    http://monespaceperso.org/blog-en/2010/05/02/upgrade-alsa-1-0-23-on-ubuntu-lucid-lynx-10-04/

    ReplyDelete
  6. Thanks that post was very helpful. Following your steps I patched my gentoo sources and that seemed to do the trick :D

    ReplyDelete
  7. Thanks. Can you help me to fix in similar way not working external mic in VPCS11M9R? Every time after restart I have to modify 0x23 and 0x08 in order to bring it work correctly.... Thank you. WBR, Oleksa

    ReplyDelete