Feeds:
Posts
Comments

Archive for the ‘Audio’ Category

Howdy,

My trusted Toshiba Tecra M5 motherboard gave up on me last week. I ended up spending all my savings on a new HP ProBook 4310s from my university. But configure this baby is a pain when it comes to Linux.

I loaded Linux Mint 7 Gloria (GNOME) then switch to Kubuntu Jaunty with 4.3.1 from backport. After 1 week of tingling with the configuration, installation and uninstallation, finally I had a usable system. I will not elaborate too much at the moment, since I will have mid-term soon. Also I am going to nuke my current system when Karmic come out.

SOUND:

Add either of the line below in ‘ /etc/modprobe.d/alsa-base.conf ‘
options snd-hda-intel model=mobile
OR
options snd-hda-intel model=laptop

In KDE4 there isn’t much problem, but in GNOME, you might have to reload the alsa module from time to time, very annoying.
$ sudo alsa force-reload

Wireless:

iwl5100 needs backport module

$ sudo apt-get install linux-backports-modules-jaunty

ATI Mobility Radeon HD 4330:

This is the most painful thing when it comes to compositing.

You will probably need a no backfill patch. Some minors and tolerable corruption but no more slowness when maximized and resized.
https://launchpad.net/~ubuntu-x-swat/+archive/xserver-no-backfill

Stock fglrx-installer is the worst (install X crash when fullscreen in mplayer – both stock and from rvm ppa) . Fglrx 8.620 (CC 9.6) from x-updates is okay for generic use but XV in mplayer performance is terrible and also has scaling problems. Basically, your viewing experience in mplayer will be a horrible one. Best for me is CC 9.9 from AMD: good compositing, Xv correct scaling with default settings. http://www2.ati.com/drivers/linux/ati-driver-installer-9-9-x86.x86_64.run

Instruction for 9.9 can be found below. I used the 2nd link mainly for complete removal of the old conf.
http://wiki.cchtml.com/index.php/Ubuntu_Jaunty_Installation_Guide#Installing_the_drivers_manually
http://k3mist.com/linux/ati-catalyst-9-9-fglrx-8-650-installation/

Cheers,

Any problem please feel free to drop me a comment =)

UPDATE 1:
To install webcam viewer:
sudo apt-get install luvcview

UPDATE 2:
Upgrade to alsa 1.0.21 to have no more cracking noise with max PCM.
http://ubuntuforums.org/showthread.php?p=6589810

Advertisements

Read Full Post »

Ubuntu 9.04 Jaunty distribution release date draws near. Pulseaudio – the future is coming up as well. I admit that it works better compare to Intrepid, however, I still want to stick to the no-frills ALSA for my Intel on board card. If Pulseaudio works for you, by all means stick to it. I merely give you another option to choose. By the way, I manage to get my mic working πŸ™‚ This guide will help you to kind of disable pulseaudio from starting / avoid pulseaudio to hog the sound hardware. It also solves the problem of every boot, the master channel is turned all the way down and muted.

The Environments: Firstly, I upgrade my Intrepid to Jaunty RC 32bits PC through ‘update-manager -d’. I have only one laptop so I can’t test the vanilla Jaunty RC version. Though, I will try to match the configuration as best as I can. Secondly, I have a built-in mic. Thirdly, the soundcard is an onboard Intel STAC9200 and I don’t have 2nd soundcard. For the uninitiate, the $ in front just denote your shell, after that is the command.

Required Packages: alsa-oss; libasound2; libasound-plugins; sysv-rc-conf (optional)

$ sudo apt-get install alsa-oss libasound2 libasound2-plugins sysv-rc-conf

The Procedure:

Step 1:

When I upgrade to Jaunty, it doesn’t install any new ’70pulseaudio’ file in Xsession. If there is no such file, safely ignore this step. If it is present, move it to somewhere safe. The command below sends it to your home root folder.

$ sudo mv /etc/X11/Xsession.d/70pulseaudio ~/

Step 2:

Disable Pulseaudio service from run level. Watch out for the dot at the end. Else you can use sysv-rc-conf GUI.

$ sudo update-rc.d pulseaudio stop 50 2 3 4 5 .

Unset Pulseaudio from system and set my card from ‘asoundconf list’

$ asoundconf unset-pulseaudio
$ asoundconf set-default-card Intel

Make sure your libao.conf is using alsa. Use gedit if you like. For the uninitiate, to save in nano, press Ctrl + x.

$ sudo nano /etc/libao.conf
default_driver=alsa

Navigate from the menu: System – Preferences – Sound, make sure yours looks like the one in the screenshots below:

screenshot-sound-preferences

So far so good. Cos those steps are similar to my previous guide. Now come to the more tricky part.

Prevent Pulseaudio from daemonize. Open ‘/etc/pulse/client.conf’ with your editor again. Look for this line ‘autospawn = yes’ then change it to ‘autospawn = no’.

This folliwng step is thanks to one of my reading of Sonal Santan on the mailing list last time, but now in Jaunty then it can shine. If the just above step doesn’t work properly. Open ‘/etc/pulse/default.pa’ in an editor. Look for lines similar to the following two commented out lines:

#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0

Add the following two lines just after these two lines:

load-module module-alsa-sink device=dmix
load-module module-alsa-source device=dsnoop

The above change will force PAΒ  not toΒ  take exclusive control of sound hardware.

This step is similar to my old guide. Open ‘/usr/share/alsa/alsa.conf’ in an editor. Comment out the line which says ‘/usr/share/alsa/pulse.conf‘ by inserting a # in the beginning. After the change, the @hooks section would look something like the following.

@hooks [
    {
        func load
        files [
#           "/usr/share/alsa/pulse.conf"
            "/usr/share/alsa/bluetooth.conf"
            "/etc/asound.conf"
            "~/.asoundrc"
        ]
        errors false
    }
]

The above procedure will make sure ALSA is use system-wise. πŸ™‚

OPTIONAL (But recommended anyway): Go to this link, https://help.ubuntu.com/community/HdaIntelSoundHowto look at this section Manually Specify Module Parameters and do yourself a favour πŸ™‚Β 

Step 3:

Application specific issue is discuss here. Mplayer only at the moment.

MPlayer: 10 second wait before audio start playing.

—> Edit ‘/etc/mplayer/mplayer.conf‘, change the order to the order below (original pulse,alsa)
# Specify default audio driver (see -ao help for a list).
ao=alsa

Step 4:

THE MIC WORKS πŸ™‚ ! This step might need the optional step Manually Specify Module Parameters above.

I will give you a short tutorial on `alsamixer` which is required to get the elusive mic to work. Open alsamixer by type ‘alsamixer’ in the terminal. In alsamixer, using Tab to change View property. To MUTE/UNMUTE press m. To move the slider, use up and down key. To move to another property of same view, use right and left button. And the spacebar…

alsamixer

Now guys, you see the box right below the slider?Β  [ 00 ] == unmuted,Β  [MM] == muted. Check before you keep whining that there is no damn sound.

For the Mic to work, make sure (look at the screenshot, that’s how your should looks like)

Capture and Digital properties are not muted / not zero db. 67 is a good value. Capture should look like in my screenshot . If your capture looks like, —– then press space bar once to change it to L RΒ  Captur.

Mux should be at zero.

Select your Input Source to Mic. Fire up your gnome-sound-recorder, choose Capture the voila. The capturing quality is better than M$ Windows with noise cancellation. Bleh πŸ™‚

Step 5:

Check that you didn’t miss any step. Reboot (don’t be lazy) and make sure the damn sound is not muted =.=” .

Cheers and don’t disturb me for at least 3 weeks πŸ™‚ Let me be at peace with my exams.

TROUBLESHOOTING

If you get the message as below

“audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! gconfaudiosink: Could not open audio device for playback.”

You need todo the following to resolve it. Backup .asoundrc first =)

‘sudo /etc/init.d/alsa-utils restart’
OR/AND
‘rm ~/.asoundrc’

Btw, I set up twitter @ http://twitter.com/idyllic_tux to further disseminate any tips if I have in the future.

Read Full Post »

After upgraded to Intrepid RC, I once again fiddled with Ubuntu sound system to use ALSA instead of Pulseaudio in a non-destructive way (a.k.a no removable of Pulseaudio packages and configuration which in turn not remove ubuntu-desktop package which is needed for future distribution upgrade). It was a bit trickier to do compare to Hardy, but I managed to locate all the culpirt that plague my sound system eventually and came up with this comprehensive guide. Without further ado, let the game begin!

1. Preparation! Install the follow packages if you haven’t had them yet. First one is alsa wrapper for oss, 2nd one alsa library and 3rd one is alsa library plugins. The last one is to configure the runlevel of pulseaudio (just for a total overkill)

% sudo apt-get install alsa-oss
% sudo apt-get install libasound2
% sudo apt-get install libasound2-plugins
% sudo apt-get install sysv-rc-conf

2. Removal Procedure! Remove pulseaudio from Xsession by moving it somewhere safe just in case you want to use back Pulseaudio again. The 1st command will move it to your home folder (~/).

% sudo mv /etc/X11/Xsession.d/70pulseaudio ~/

Remove pulseaudio (sound plugin) from gnome-settings-daemon

% gconftool-2 -s -t bool /apps/gnome_settings_daemon/plugins/sound/active false

Well you can always open a UI to do this if you feel unconfortable, Alt+F2, then type “gconf-editor”, navigate to /apps/gnome_settings_daemon/plugins/sound/ then untick the active box.

Unset Pulseaudio

% asoundconf unset-pulseaudio

Remove from runlevel [Overkill, just to make sure]

% sudo sysv-rc-conf

Page down till you see “pulseaudio” entry, then untick all the box []. Save and exit.
CAUTION: I dare not ask you guys to do this oneliner “sudo update-rc.d -f pulseaudio remove” or “sudo update-rc.d pulseaudio kill 15 2 3 4 5 .” cos I think it is dangerous. If someone can update me on this then I am deeply appreciated. Just stick to sysv-rc-conf for a safe journey.

3. Configuration for ALSA! Now time to configure alsa to use the main sound card

% asoundconf list
Names of available sound cards:
Intel
% asoundconf set-default-card Intel

Make sure the libao.conf is using alsa. You can use gedit if you want to.

% sudo nano /etc/libao.conf
default_driver=alsa

Navigate from the menu: System – Preferences – Sound, make sure yours looks like the one in the screenshots below:

ALSA

non-pulse-daemon

You will have no login sound from now on 😦 . Workaround is you create your own autostart event, use “aplay” or “mpg123-alsa” or “mplayer” and path to the your log in sound.

To further overkill pulseaudio, edit your .bashrc at your home folder and put this in:

% export SDL_audiodriver=alsa
Use this line if you want alsa wrapper for OSS: % export SDL_audiodriver=aoss

Ubuntu 8.10 has flash 10 package [adobe-flashplugin] so multiple sounds and flash sound work perfectly without libflashsupport (no longer in the repository) πŸ™‚

Still with me? Haha. Give yourself a pat on the shoulder. Reboot and enjoy ALSA. Self-check, type in the terminal “pgrep pulseaudio”. If no number return, pulseaudio is disabled πŸ™‚

Future tips will come as I explore the system more πŸ˜› Till then.

TROUBLESHOOTING: 10 second time out solution below in the comment πŸ˜›

I finally figure out the 10second lag. Those applications will first look for Pulseaudio, but it is gone, so the 10 second time out before alsa kicks in.

=======
Solution:
=======

+ Edit /etc/mplayer/mplayer.conf, line 74, change the order to the order below (original pulse,alsa)
# Specify default audio driver (see -ao help for a list).
ao=alsa,pulse

+ Totem-gstreamer i can’t find the config for it yet, so work around is use totem-xine, then check that ~/.config/totem/xine_config , pulseaudio is comment out.

+ System-wide config (so far I only tested with mpg123-alsa, aplay, moc). Backup your /usr/share/alsa/alsa.conf. Then on the very top. Chage it to the following: (alternatively you can comment out /usr/share/alsa/pulse.conf or move it down the list, I prefer remove it anyway since we got a backup)

# pre-load the configuration files

@hooks [
{
func load
files [
“/usr/share/alsa/bluetooth.conf”
“/etc/asound.conf”
“~/.asoundrc”
]
errors false
}
]

=>>>>>>> Exam time!

Read Full Post »