HOWTO – Another Sound Fix in Kubuntu 7.10…

I occasionally get sound system error messages from arts, usually fatal, that the system cannot be started, or some such nonsense. Usually after a Flash website is left loaded in a browser for a long time, or many games have been played over time by one of the kids.

I finally did a quick search for an answer and found this on the Ubuntu forums. The solution needed slight tweaking, since the script listed did not provide sound. By troubleshooting (running the script in konsole), I got it to work in short order and adjusted the default volume, then logged in on each user account and made the required user changes.

Here is the script:

#! /bin/sh
# sox_play script for knotify
sox -v 2.9 -q "$@" -t alsa default &

Hopefully this will make sound a little more reliable. Still having issues with YouTube videos and Flash locking up and becoming unplayable. Will keep working this and post whatever fix I can find.

Update:  After  three days of constant multi-user use, I can say that this fix is a definite improvement over using arts.  No more sound-server fatal errors, no more lost sound, regardless of who used what application.  I guess sox …uh…rox.  (Sorry, couldn’t resist – I am a weak man.)

The only thing that was not resolved regarding sound was the occasional loss of the ability to play multimedia files (MPEG, AVI, FLV mostly), following YouTube lockups (Firefox freezes).  I do not think these are related to the sound server, however.  I am using the latest Flash player (from the Adobe web site, not the Ubuntu package).  Nothing seems to fix that but a reboot.  Google has yet to provide a better answer than that.
Strange.

If anyone has any ideas for a fix, please, indulge me…  I’ll be happy to detail any real fix and give credit where it is due, of course.

Advertisements

HOWTO (Repost) – Vanilla Kernel 2.6.24.2, VMware Server, and Kubuntu 7.10…

Since my article on rolling a vanilla kernel on Kubuntu (HOWTO – Vanilla Kernel 2.6.23.1 on Gutsy Gibbon…) has gotten most of the visits lately, I thought I would report it updated for kernel 2.6.24.2, with a couple minor changes, and I included some VMware steps as well. Hopefully, this is a little easier to read…

  1. Download the latest full kernel (2.6.24.2 at the time of this writing).
  2. sudo -i
  3. apt-get install build-essential kernel-package (I did not get the linux-source package, because that is what was downloaded in step 1.)
  4. cd /usr/src
  5. mv (path/to/)linux-2.6.24.2.tar.bz ./
  6. tar xvfj linux-2.6.24.2.tar.bz
  7. rm -f linux (if it exists)
  8. ln -s linux-2.6.24.2 linux
  9. cd linux
  10. cp /boot/config-2.6.22-14-generic (or your latest config-2.6.2x.x file) .config (this step copies the current running kernel config into place for building the new kernel)
  11. make oldconfig – this steps you through all the changes from your current kernel version, and skips everything that has not changed.
  12. make menuconfig (you need to have ncurses packages installed for this to work) – I prefer this to make xconfig, for no good reason
  13. VMWARE MUST DOGeneral setup –> change from SLUB to SLAB – Choose SLAB allocator (SLAB).
  14. VMWARE MUST DOProcessor type and features –> uncheck Tickless System (Dynamic Ticks). OPTIONAL performance settings I like – select the Processor family (mine is Opteron/Athlon64/Hammer/K8), set Preemption model to Preemptable kernel (Low Latency desktop), set Timer frequency (1000 Hz).
  15. OPTIONALKernel hacking –> check Use 4Kb for kernel stacks instead of 8Kb. This is a performance setting.
  16. OPTIONAL – Device Drivers –> Sound –> Advanced Linux Sound Architecture –> PCI Devices –> set Intel HD Audio to M (module) -this was in Sean’s Blog, and I did not get sound working until I set this. YMMV.
  17. Exit and save the new .config file – I also like to save a copy of this file under a descriptive name somewhere else as a backup (cp .config /home/gutsy-2.6.24.2.config, for example)
  18. make-kpkg clean – refer to man make-kpkg to see what this does
  19. make-kpkg kernel_image --initrd binary – this step rolls up the old “make, make modules” steps into one, so it could take a while before it is finished, depending on how much horsepower your computer has
  20. cd .. (go up one directory to where the new files are after compiling is completed)
  21. ln -s /lib/firmware/2.6.22-14-generic /lib/firmware/2.6.24.2 (to preclude any firmware issues that might pop up)
  22. dpkg -i linux-image-2.6.24.2*.deb linux-headers-2.6.24.2*.deb (installs the kernel and modules)
  23. update-initramfs -u

Afterthoughts:

Before you reboot, look at /boot/grub/menu.1st. You should see two entries for the new 2.6.24.2 kernel there (one is a recovery entry). Next, you may want to set your video driver to vesa, otherwise you might just get a console login after rebooting instead of KDE, GNOME, etc. Most likely, you will have to reinstall your video driver (NVidia and ATI users), and it’s a heck of a lot easier to troubleshoot if you have console and GUI environments. To do this, just:

  1. sudo -i
  2. vi /etc/X11/xorg.conf
  3. In Section “Device”, add in the line Driver “vesa” and comment out (#) the previous driver line.
  4. In Section “Modules”, comment out the line that says Load”glx”.
  5. Write and quit (:wq), and you are set. Remember, this will get you basic, unaccelerated graphics, so you will want to restore your old driver after rebooting to the new kernel.

If you use VMWare, you will also have to reconfigure it to use the new kernel. After you reboot and restore your video driver, follow these steps from Peter Velichkov’s Blog:

How-to Install Vmware Player / Workstation on 2.6.24 Kernel – Assuming you already have VMware Player/Workstation/Server loaded, follow from Step 5. Although it does not mention Server, these steps work for installing VMware Server as well.  This article also has the link to vmware-any-any-update116.

As long as you have not removed the old kernel, you can always boot back into it if the new kernel fails to boot for some reason (hit ESC when prompted at bootup to select a non-default kernel entry). I always keep the previous version available, and remove the older versions after a week or two of smooth computing.

Ubuntu Forum Article – HOWTO: Wireless Security – WPA1, WPA2, LEAP, etc…

Found this while mindlessly surfing around – this is a very good read if you are troubleshooting wireless on Ubuntu (or Linux in general).

Here is the link – HOWTO: Wireless Security – WPA1, WPA2, LEAP, etc.

Hope this helps!

Howto – Troubleshooting Sound in Kubuntu…

Mentioned in an earlier post was a problem I was having with sound. I have two sound cards, both recognized well by Kubuntu 7.10. One is onboard – a VIA VT8233/A/8235/8237 AC97 Audio Controller (rev 60). The other is a PCI card from C-Media – a CM8738 (rev 10), and is the one I prefer to use.

In kmix, both cards would be visible in a drop-down list, and I would make sure the C-Media card was selected after logging into KDE. I have been having issues, however, with the default sound card switching from the C-Media card to the VIA card. When this would happen, nothing I did in the sound server or kmix would make any difference, not even logging off and logging back on. I would have to reboot and actually go into the BIOS and toggle the onboard card to either on or off – changing its state made the difference (usually).

I found some good tips in the Ubuntu forums that helped. These and the module blacklisting I did seem to have permanently fixed the problem. I also rebooted back into the BIOS and disabled the onboard sound card to ensure there were as few variables running amuck as possible.

The links I found helpful were:

The commands I found useful were:

  • cat /proc/asound/modules
  • sudo asoundconf list
  • sudo asoundconf set-default-card <desired card name from the preceding list command> – sets across the system
  • asoundconf set-default-card <desired card name from the preceding list command> – sets for the user running the command

Files that were useful in this were:

  • /etc/modprobe.d/alsa-base – shows card-slots, modules and options
  • /etc/modprobe/blacklist – take out modules that keep stepping on your toes

Some caveats here – be familiar with your hardware and modules.  Use lspci and lsmod.  Take your time and go slow, making one-change-at-a-time if you are unsure or uncomfortable.  Document what you do, so in the worst case, you can reboot into rescue mode and undo what ya done did.

Or you can be like me and gun it till you throw a rod.  ^______^

(Way more fun that way, IMHO).

    Howto – Blacklisting Modules in Kubuntu…

    I was having some trouble with my default sound card selection and wireless modules (Broadcom bcm43xx) that were  complaining.  Since I am not using wireless on this, I decided to do some spring-cleaning (it’s never too early) and pull those and other modules I am not using.  For this, I went into the blacklist file under /etc/modprobe.d and added the offending modules (determined by a quick run of lsmod and lspci in konsole):

    • lsmod and lspci – look for those modules tied to error messages in your logs, compare to lspci output to make sure you are really identifying the modules for the hardware you do not want to use, so you do not remove something you need.
    • sudo vi /etc/modprobe.d/blacklist – I like vi, but feel free to use vim, nano, pico, etc.
    • At the bottom of the file, I added a comment line for 18 Feb 08 – basic documentation for later if I need to fix something
    • Following the comment line, I added multiple lines, each starting with the word “blacklist” and followed by a space, then the module name as shown in lsmod.  Example:  blacklist bcm43xx

    After I was done, I had pulled not only all the wireless (including the ieee80211 modules), but had also removed the ipv6 module, and the modules related to my onboard soundcard (which I do not use and suspected of conflicting with the card I am using).  After a reboot, sound worked much better, there was no mixer dropdown list to select between sound cards, there was no ipv6 module loaded, and the wireless complaints stopped.  lsmod revealed that indeed the modules were no longer loaded, and things seem to be running more smoothly now.

    VMware-any-any-update116…

    Found it – Peter Velichkov has a link on his blog. After updating to kernel 2.6.24.2 (which worked fine), I ran the script (runme.pl) and fired up VMware Server. It seemed to work fine, with no real issues, even after rebooting the VM, other than being a little sluggish, however.

    To fix this, I reinstalled the vmware tools (VM menu, Install VMware Tools) – this has to be done while the Windows VM is running. After a little churning, the VM presented me with three choices – I chose to Repair. This required a reboot of the VM, but I noticed an immediate improvement in the VM’s performance. Not sure if it was because I updated VMware tools after going to the update116 patch, or if it was due to VMware having stuff buffered in memory, but I will bet on the side of the tools repair.

    Security Vulnerability with Kernel 2.6.24.1?

    After catching site of a story on SANS – see this link – and reading the linked articles, I could not tell if kernel version 2.6.24.1 was vulnerable or not – the wording is a little ambiguous. Reading the changelog for 2.6.24.2 indicated a fix for a pointer issue, which *looks* related to the problem affecting all kernels prior to (and possibly including, I cannot tell) 2.6.24.1. I am tired and not too bright today, so I just gave in and updated to 2.6.24.2 as a “just in case”.

    Of course, this means reinstalling the nvidia driver and reapplying vmware-any-any-update115a. Oh well.

    Update:  Tag Surfer fed this blog up on the same thing.