Thursday, April 22, 2010

Fixing a problem with pulseaudio

I had a problem on my new machine - after bootup there was no sound. Starting "pulseaudio volume control" (= pavucontrol) I could see in the "Output Devices" tab, that the sound was muted. Just clicking on the mute button would enable sound.

However each time I would boot the sound was muted again. Also in the system log I found this:

alsa-mixer.c: Your kernel driver is broken: it reports a volume range from 18.00 dB to 18.00 dB which makes no sense.

(Not quite certain if that's actually related to the mute issue, but perhaps pulseaudio turns the output off because the driver reports an invalid volume range.)

Anyway I didn't want to unmute this all the time, so I figured out how to let pulseaudio do the job:

First enable sound manually via pavucontrol, then in a terminal window enter:

pacmd "dump" | grep set-sink

This will give a list of commands which pulseaudio has executed on your system. In my case the list looked like this:

set-sink-volume alsa_output.pci-0000_00_07.0.analog-stereo 0x3068
set-sink-mute alsa_output.pci-0000_00_07.0.analog-stereo no


That means that my audio "sink" (the part which plays the sound on my PC) is named alsa_output.pci-0000_00_07.0.analog-stereo and it was unmuted with:

set-sink-mute alsa_output.pci-0000_00_07.0.analog-stereo no

(Your sink will likely have a different name.)
So now this command just needs to be added to /etc/pulse/default.pa which pulseaudio executes automatically on startup.

The file can be edited like this:

sudo kate /etc/pulse/default.pa
(kate is just a texteditor, use vi if you are able or any other editor which is available on your system.)

At the end of the file just add this:

### disable MUTE
set-sink-mute alsa_output.pci-0000_00_07.0.analog-stereo 0


(Of course here you need the name of the sound sink on your system, I put mine there only as an example.)

And that's it, after the next reboot the sound is automatically on.

Thursday, September 10, 2009

Installing xv on Ubuntu

The following worked for me in Kubuntu 9.04:

Become superuser:
sudo su
(alternatively just add sudo in front of each "apt-get")

Then install these packages - a lot of these were already up-to-date on my system, but I've installed other software, so maybe they are not always included per default:

apt-get install dpkg-dev
apt-get install xlibs-dev
apt-get install zlib-bin
apt-get install zlibc
apt-get install libc6-dev
apt-get install libjpeg62-dev
apt-get install libpng-dev zlib1g-dev
apt-get install libtiff4-dev
apt-get install zlib1g-dev
apt-get install libpng3
apt-get install libpng12-dev
apt-get install libpng12-0
apt-get install x11proto-core-dev
apt-get install libx11-dev
apt-get install libxt-dev
apt-get install libjasper-dev

Additionally I added a link

sudo ln -s /usr/lib/libjasper.a /usr/local/lib/libjasper.a


Then I got the xv source:

wget ftp://ftp.cis.upenn.edu/pub/xv/xv-3.10a.tar.gz

The patches and diffs from here: http://www.gregroelofs.com/greg_xv.html

wget http://prdownloads.sourceforge.net/png-mng/xv-3.10a-jumbo-patches-20070520.tar.gz
wget http://www.gregroelofs.com/code/xv-3.10a-enhancements.20070520-20081216.diff



Unpack everything
tar xvzf xv-3.10a.tar.gz
tar xvfz xv-3.10a-jumbo-patches-20070520.tar.gz

Go into the directory, patch and compile:
cd xv-3.10a
patch -p1 < ../xv-3.10a-jumbo-fix-enh-patch-20070520.txt

make


This gives you the executable xv in the current directory,
test it by running:
./xv

Monday, August 10, 2009

Blog started

I'll write a proper blog post tomorrow.