BenQ Joybook S52 built-in sound card partially work with ALSA

Wow! It has been about 7 months since I migrated to Ubuntu Dapper in my laptop, BenQ Joybook S52, with on sound. During that time, I live with a USB sound card. As I mentioned in the past, this issue has been posted about 19 months ago. Fortunately, this issue has big progress last week or two. Congratulation for all you having BenQ Joybook S52 and S53 series!

For now, my operating system is Ubuntu 6.10 Edgy Eft. It comes with sound drivers from ALSA 1.0.11. I supposed it might be too old since discussion in the issue only confirmed to work with ALSA 1.0.14rc1 with full debugging option. Let's see what I did.

  1. Install all essential packages.

    sudo apt-get install build-essential fakeroot linux-headers-$(uname -r) alsa-source kernel-package
    
  2. Download the latest ALSA driver.

    wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.14rc1.tar.bz2
    
  3. Extract the archive.

    tar xjf alsa-driver-1.0.14rc1.tar.bz2
    
  4. Copy all debian changed to rebuild it.

    tar xjf /usr/src/alsa-driver.tar.bz2
    cp -Rp modules/alsa-driver/debian alsa-driver-1.0.14rc1
    
  5. Replace debian/rules by follows.

    #!/usr/bin/make -f
    
    # Written by Steve Kowalik <> for the New Alsa-Source.
    # Loosely based on the rules file from pcmcia-cs and the old alsa-source.
    
    KSRC ?= /usr/src/linux
    KDREV ?= unknown
    KVERS ?= unknown
    ALSA_DEBUG_LEVEL ?= detect
    
    ifeq ($(KDEP),)
            KDEPC =
    else
            KDEPC = $(KDEP),
    endif
    
    # See if we can work out the compiler used
    ifeq ($(origin CC),default)
            ifneq "$(wildcard $(KSRC)/include/linux/compile.h)" ""
                    CC = gcc-$(shell grep LINUX_COMPILER $(KSRC)/include/linux/compile.h | sed 's/.* \([0-9]\+\.[0-9]\+\).*/\1/')
            else
                    CC = gcc
            endif
    endif
    
    # Special case gcc 2.7.2
    ifeq ($(CC),gcc-2.7)
            CC = gcc272
    endif
    
    # If they didn't set $(KVERS), see if we can do it for them.
    ifeq ($(KVERS),unknown)
            ifneq "$(wildcard $(KSRC)/include/linux/version.h)" ""
                    KVERS = $(shell head -1 $(KSRC)/include/linux/version.h | sed 's/.*"\(.*\)"$$/\1/')
            endif
    endif
    
    # Clear root command if already root
    ifeq ($(shell id -u),0)
            ROOT_CMD=
    endif
    
    # Use updates/ subdirectory so that the modules in alsa-modules-$KVERS
    # are given priority (by depmod) over modules under kernel/.
    CONFIGURE_OPT = --prefix=/usr \
                    --with-kernel=$(KSRC) \
                    --with-build=$(KSRC) \
                    --with-moddir=/lib/modules/$(KVERS)/updates/alsa \
                    --with-sequencer=yes
    
    ifneq (,$(findstring 2.2.,$(KVERS)))
            MODULELOADERDEP = modutils (>= 2.3.5)
            PCMCIAMODULESSUG = kernel-pcmcia-modules-$(KVERS) | pcmcia-modules-$(KVERS)
            # See SF bug #550435
            CONFIGURE_OPT += --disable-verbose-printk
    else
            ifneq (,$(findstring 2.4.,$(KVERS)))
                    MODULELOADERDEP = modutils (>= 2.3.5)
                    PCMCIAMODULESSUG = kernel-pcmcia-modules-$(KVERS) | pcmcia-modules-$(KVERS)
            else
                    MODULELOADERDEP = module-init-tools (>= 3.1)
                    PCMCIAMODULESSUG = 
            endif
    endif
    
    
    # Read in config file, generated by debconf.
    ifeq (/etc/alsa/alsa-source.conf,$(wildcard /etc/alsa/alsa-source.conf))
            include /etc/alsa/alsa-source.conf
    endif
    ifeq ($(HOME)/.alsa-source.conf,$(wildcard $(HOME)/.alsa-source.conf))
            include $(HOME)/.alsa-source.conf
    endif
    ifeq ($(CURDIR)/debian/alsa-source.conf,$(wildcard $(CURDIR)/debian/alsa-source.conf))
            include $(CURDIR)/debian/alsa-source.conf
    endif
    
    ifeq ($(ALSA_NOPNP),y)
            CONFIGURE_OPT += --with-isapnp=no
    else
            CONFIGURE_OPT += --with-isapnp=yes
    endif
    
    ifeq ($(ALSA_DEBUG),y)
            CONFIGURE_OPT += --with-debug=$(ALSA_DEBUG_LEVEL)
    endif
    
    ifneq ($(ALSA_CARDS),)
            CONFIGURE_OPT += --with-cards=$(ALSA_CARDS)
    endif
    
    ifneq ($(ALSA_CARD_OPTIONS),)
            CONFIGURE_OPT += --with-card-options=$(ALSA_CARD_OPTIONS)
    endif
    
    ifneq ($(ALSA_OPTS),)
            CONFIGURE_OPT += $(ALSA_OPTS)
    endif
    
    ifneq ($(CONCURRENCY_LEVEL),)
            MAKE_OPT = -j $(CONCURRENCY_LEVEL)
    endif
    
    VERSION = $(shell dpkg-parsechangelog | grep ^Vers | cut -d\  -f2)
    ifneq ($(KDREV),unknown)
            ifeq ($(findstring :,$(KDREV)),:)
                    VERSION := $(subst :,:$(VERSION)+,$(KDREV))
            else
                    VERSION := $(VERSION)+$(KDREV)
            endif
    endif
    
    echo-vars:
            @echo "I've been configured using:"
            @echo " - Kernel source of $(KSRC)"
            @echo " - Kernel version of $(KVERS)"
            @echo " - Kernel revision of $(KDREV)"
            @echo " - C compiler of $(CC)"
            @echo " - Make options of $(MAKE_OPT)"
            @echo " - Version of $(VERSION)"
    
    configure: configure-stamp
    configure-stamp:
            @if [ ! -x /usr/bin/$(CC) ]; then echo "You don't have the compiler that your kernel was built with installed"; exit 1; fi
            CC="$(CC)" ./configure $(CONFIGURE_OPT)
            touch configure-stamp
    
    build: build-stamp
    build-stamp: configure-stamp
            $(MAKE) $(MAKE_OPT) compile
    
    install: install-stamp
    install-stamp: build-stamp
            $(MAKE) $(MAKE_OPT) DESTDIR=$(CURDIR)/debian/$(shell dh_listpackages) install-modules
    
    control-munge:
            for i in control postinst postrm ; do \
                    cp -p debian/$$i debian/$$i.orig; \
                    cat debian/$$i | sed \
                            -e 's/_KVERS_/$(KVERS)/g' \
                            -e 's/_KDEP_/$(KDEPC)/g' \
                            -e 's/_MODULELOADERDEP_/$(MODULELOADERDEP)/g' \
                            -e 's/_PCMCIAMODULESSUG_/$(PCMCIAMODULESSUG)/g' \
                            -e '/^Suggests:space:*$$/d' \
                            > debian/$$i.tmp; \
                    mv -f debian/$$i.tmp debian/$$i; \
            done
            touch control-munge
    
    clean-control-munge:
            for i in control postinst postrm ; do \
                    if [ -f debian/$$i.orig ]; then \
                            mv -f debian/$$i.orig debian/$$i ; \
                    fi ; \
            done
            -$(RM) control-munge
    
    clean: clean-control-munge
            -make mrproper
            $(RM) configure-stamp
            $(RM) build-stamp
    
    binary_modules: binary-modules
    binary-modules: configure-stamp build-stamp control-munge install-stamp
            dh_testdir
            dh_testroot
            dh_installdirs usr/share/bug/alsa-modules-$(KVERS)
            dh_installchangelogs debian/changelog.ALSA
            # alsa-modules-i386 adds changelog.alsa-driver.Debian
            if [ -f debian/changelog.alsa-driver.Debian ] ; then \
                    dh_installdocs debian/changelog.alsa-driver.Debian ; \
            else \
                    dh_installdocs ; \
            fi
            dh_install debian/bug/control usr/share/bug/alsa-modules-$(KVERS)
            dh_strip
            dh_compress
            dh_fixperms
            dh_installdeb
            dh_shlibdeps
            dh_gencontrol -- -v"$(VERSION)"
            dh_md5sums 
    ifeq "$(origin KPKG_DEST_DIR)" "undefined"
    ifeq "$(origin KMAINT)" "undefined"
            dh_builddeb --destdir=$(CURDIR)/..
    else
            dh_builddeb --destdir=$(KSRC)/..
    endif
    else
            dh_builddeb --destdir=$(KPKG_DEST_DIR)
    endif
    
    binary:
            @echo "Binary target not supported. Use binary-modules or make-kpkg."
            exit 1
    
    # Targets that kernel-package uses.
    kdist_configure: configure-stamp
    kdist_config: configure-stamp
    kdist_image:
            $(ROOT_CMD) $(MAKE) -f debian/rules binary-modules
            $(ROOT_CMD) $(MAKE) -f debian/rules clean
    kdist_clean: clean
    kdist:
            $(ROOT_CMD) $(MAKE) -f debian/rules binary-modules
    
    .PHONY: configure build clean binary-modules binary_modules binary kdist_configure kdist_config kdist_image kdist_clean kdist
    
  6. Build the package.

    fakeroot ./debian/rules binary_modules KSRC=/usr/src/linux-headers-$(uname -r)/ KVERS=$(uname -r) ALSA_NOPNP=n ALSA_DEBUG=y ALSA_DEBUG_LEVEL=full ALSA_CARDS=intel8x0 ALSA_CARD_OPTIONS= ALSA_OPTS=--with-oss
    
  7. You shoudl get alsa-modules-2.6.17-10-386_1.0.14rc1-0ubuntu1_i386.deb in parent directory so just install it.

    dpkg -i alsa-modules-2.6.17-10-386_1.0.14rc1-0ubuntu1_i386.deb
    
  8. Reboot your laptop. After that you are able to unmute the speaker by following command.

    $ sudo su -
    # echo 1 > /proc/asound/card0/codec97#0/ac97#0-0+regs
    

Yes!!! It works! Thanks ALSA and Conexant.

Tags: , ,

package

hello, can you put the deb file somewhere to file hosting page where i could download it?

alsa-modules package for s52 on edgy

Get it here. Note that it is i386. If you would like to build it yourself, please tell me. I will upload the whole sources.

Hi, thanks for your

Hi, thanks for your assistance. I was wondering whether i could get in contact with you through MSN or email? Cause this looks like a full blown major task.

Hi can i please get in

Hi can i please get in contact with you through msn or email. As i am very confused and have not done what you have explained. My MSN & email is :

Kernel

Hi Sugree, thank you for your assistance. My kernel version is the same as yours, did you update your kernel after you installed Edgy Eft? I was wondering whether you could guide me or assist in my quest to get my sound working. I am still quite new to linux so my level of understanding is below par. I have followed your guide, however the first instruction doesn't work. It says it can not find the source. Thank you for your assistance

hi how do i change the

hi how do i change the debian/rules file? thanks

simply replace it

See above. Just replace the whole file with the new one.

So basically by running the

So basically by running the deb file, will this also update my ALSA drivers, because i believe i am using the original ALSA driver installed through Edgy Eft's installation. Basically there is no need to treat the debian/rules file?

Hi i seem to be having

Hi i seem to be having problems installing the deb files. Here is the erro i recieved once i installed the deb file. Preparing to replace alsa-modules-2.6.17-10-386 1.0.14rc1-0ubuntu1 (using .../alsa-modules-2.6.17-10-386_1.0.14rc1-0ubuntu1_i386.deb) ... Unpacking replacement alsa-modules-2.6.17-10-386 ... Setting up alsa-modules-2.6.17-10-386 (1.0.14rc1-0ubuntu1) ... FATAL: Could not open '/boot/System.map-2.6.17-10-386': No such file or directory

different kernel

You kernel version is not the same to me.

sugree@sugree-laptop:~$ uname -a
Linux sugree-laptop 2.6.17-10-386 #2 Tue Dec 5 22:26:18 UTC 2006 i686 GNU/Linux

Umm. I think it would be better to compile the driver yourself. You have to use my debian/rules to turn on debugging option. The default rules will only turn the option to detect so it will just print out log during hardware probe. To modify registry, you need to specify debugging option to full. Above rules will let you specify debugging option at compile time, e.g., ALSA_DEBUG_LEVEL=full.

As long as you build the driver using above debian/rules, the driver will be installed in another directory which has priority over the original driver. So you have to reboot to take effect.

added

I have added you.

Hi i have tried copying the

Hi i have tried copying the foled in your guide to the designated folder; however everytime i try this: cp -Rp /usr/src/modules/alsa-driver/debian alsa-driver-1.0.14rc1 it says this folder does not exist. What should try now?

alsa source

Oops! It might be my fault that not mentioning to install alsa-source first.

apt-get install alsa-source

Hi Sugree, I have tried

Hi Sugree, I have tried running the compiled .deb file that you have guided me to prepare. However, when i run the file i get this error: davinci@davinci:~$ sudo dpkg -i alsa-modules-2.6.17-10-386_1.0.14rc1-0ubuntu1_i386.deb (Reading database ... 91539 files and directories currently installed.) Preparing to replace alsa-modules-2.6.17-10-386 1.0.14rc1-0ubuntu1 (using alsa-modules-2.6.17-10-386_1.0.14rc1-0ubuntu1_i386.deb) ... Unpacking replacement alsa-modules-2.6.17-10-386 ... Setting up alsa-modules-2.6.17-10-386 (1.0.14rc1-0ubuntu1) ... FATAL: Could not open '/boot/System.map-2.6.17-10-386': No such file or directory Is there something i must run before i run the installation.

Hi Sugree, I think i have

Hi Sugree, I think i have found the solution to my problem. However, i do not know how to solve it. When ever i run the program it looks for /boot/system.map-2.6.17-10-386. However, when i search my /boot/ directory it is labeled as /boot/system.map-2.6.17-10-generic. Now i was wondering how do i rename the write file in the .deb package to write rather as /boot/system.map-2.6.17-10-generic rather than /boot/system.map-2.6.17-10-386? Thanks for your help, i think i am getting there.

Thanks so much!

My BenQ/S52 boot to Ubuntu 1 month, it's a very happy experiance, consider I'm a 40- man with no Vi practice for more than 5 years. Of course the Benq is: 1) NO sound 2) Networking is not working perfect, It sets to Auto with DHCP, but boots with default wrong dns, and often restore to the wrong default again. I solve it by adding a setting in the networking place and click to select it each time after boot up or wake up. 3) SD/MS CardReader not tested yet 4) Wireless not checked yet. Still, as a dual-boot machine, it's basically a Ubuntu. I use it in my bedroom, Gaim people, Gmail/Doc/Canlender working, burn ISO/Ubuntu to live-boot other pc. It gets near 90% of my computer works done, though there are: 1) E-bank: they won't go with linux, I think. They even don't support Firefox 2) Stock client: they won't. 3) Online game: Bridge, Chinese online game, it's not likely. I'm going to setup the sound according to your article, and let you know later.

There's a way no doing it on .deb???

I haven't a Benq Joybook S52, I have a Packard Bell A6010, but it's exactly the same (they really are nec notebooks). There's a way for you to give the instructions without compiling everything on deb??? Because i'm using OpenSUSE 10.2 (kernel 2.6.18) and the deb package are not well suportted, even with alien or another utilities. I do it the whole procedure trying to emulate your method, but i miss something when you packaged everything on deb, so i still get no sound. Thanks in advance =D

I found the easy way =D

Forget my first post because netdiving arround i found the solution =D The Large Version... Link: https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1134 The Short One... The main task is compiling ALSA driver 1.0.14rc2 with full debug mode: # ./configure --with-debug=full --with-isapnp=no --with-sequencer=yes --with-os=yes --with-cards=intel8x0 Note: Read the README, thats why it's there :). Because i'm running OpenSUSE i typed that and add "--with-suse=yes" parameter. Then get the compiled code and installing # make # make install Now with this, typed this with root permissions. # echo 5c 0001 > '/proc/asound/card0/codec97#0/ac97#0-0+regs' And there it is. Sound, sweet sound. And enjoy, like x-server says :P (sorry for my horrofying english XDDDI Don't forget unmute with alsamixer.

Help!

Hey dude, I really like your walkthrough - and I feel like I'm super close to having sound -but i'm a bit off. If there's anyway you could add me to MSN and give me a bit of a hand - I'd be super appreciateive. thanks!!

please point me to your e-mail or msn

please point me to your e-mail or msn

At point number 6 I have

At point number 6 I have this ..... " ./rules:115: *** missing separator (did you mean TAB instead of 8 spaces?). Stop. " Why ?? Can you help me ?? Thanks...

Post new comment