събота, 23 април 2011 г.

How to remove pulseaudio

Since the last 1 or 2 kernels I have horrible problems with pulseaudio. It's a very annoying bug that causes KDE to freeze for 15-20 minutes by loading whatever program is using sound with 2GB RAM. Which makes the system to start placing stuff in the swap and the whole situation becomes very ugly.
The actual error is:
"snd_pcm_avail() returned a value that is exceptionally large"
and obviously is some bug in pulseaudio. I discovered some sites claiming to have a solution (like this) but nothing helped.
So last night I decided to remove the annoying pulseaudio.
I did as suggested in this site. Note, I did backup ~/.asoundrc, ~/.pulse and /etc/asound.conf just to be on the safe side.
Then use:
touch ~/.pulse-a11y-nostart
echo autospawn = no|tee -a ~/.pulse/client.conf
killall pulseaudio

to kill pulseaudio and tell it to please do not appear again. If you happen to want it back, you can use:
rm .pulse-a11y-nostart ~/.pulse/client.conf .asoundrc
.

Unfortunately, it continued to start on reboot. I tried to uninstall it, but it turned out that the whole KDE depends in some mystical way on it, so I found the other solution:
mv /usr/bin/pulseaudio /usr/bin/pulsestop
That removes the bin file of pulseaudio and it cannot start even if it wants to. Oh, well.
Next thing was that I had problems with amarok not wanting to play music. It turned out that my first backend is "vlc" and not "xine". After putting "xine" on fist place, sound appeared.
I also used the .asoundrc suggested in the file above:

pcm.dsp {
    type plug
    slave.pcm "dmixer"
}
pcm.!default {
    type plug
    slave.pcm "dmixer"
}
ctl.!default {
        type hw
        card 0
        }
pcm.dmixer  {
        type dmix
        ipc_key 1024
        slave {
            pcm "hw:0,0"
            period_time 0
         #   period_time 84000
         #   period_size 2048
         #   buffer_time 340000
              rate 44100
         #   rate 48000
              period_size 1024
         #    buffer_size 2052
              buffer_size 4096 # this is the size of buffer I use
        #   buffer_size 8192
        #   buffer_size 16384
        }
        bindings {
            0 0
            1 1
        }
    }
    ctl.dmixer {
        type hw
        card 0
    }
Now everything seems to work fine. Amarok plays music. Juk plays music. If you stop Amarok and then run Flash, it has sounds. They won't work simultaneously, even though Amarok and Juk work in the same time. Anyway, this is very small problem compared to the disastrous bug in pulseaudio that made me lose hours in the recent weeks. Now everything is calm and nice. :)

вторник, 5 април 2011 г.

How to install skype for android directly

Today, I decided I need skype on my phone, because I didn't have mic on the computer. It turned out that you can install it trough skype.com/m but only after a "free sms". I don't care how free is that sms, I'm just very suspicious towards services which want my phone or address for no reason at all. So after some digging, I found this site, where you can install skype mobile directly.
What you do is to open this site trough Opera, and click on the link skype3G.apk. Then when Opera downloads it, you click open and install it happily. And that's it. Nice and easy. And no Android Market, no Skype dependence.
Enjoy!