Sunday, October 27, 2013

Ora de vara/iarna - o aberatie

Nu inteleg de ce inca se mai foloseste

Adica te obisnuiesti cu lumina diminetii (de vara, sa zicem) si dupa aia bum, te-ai trezit cu o ora mai devreme...

Trenurile stau (in camp/gara?) 1h ca sa ajunga la programul stabilit?!

Muncitorii freaca duda 1h (muncesc 9) ca sa iasa "cum scrie in contract"?

Eu as pune UTC peste tot si gata. Nu de alta, dar si in software ai numai probleme daca vrei sa folosesti timpul local.

Fuck DST!

Saturday, October 19, 2013

Lubuntu, Kubuntu, Xubuntu or Ubuntu: Sound not working after resume from suspend

This post might as well be cataloged as a summary of a continuous frustration that has be fed by the lack of decent audio support in Linux.

I first saw Linux installed in 1999-2000 and it was a RedHat 6.1/6.2 from a computer magazine. From the start one of the first problems was getting the sound card working. I discovered I had to 'modprobe' and when I first heard a sound I loved it. Years went on and I switched to a Slackware 8.0 (booted from floppy :) ). I stayed for 1 month without sound until I found out what I need to do in order to make it run. To this date I consider slackware one of the best operating systems I've ever tried. Later on I switched to Ubuntu (6.04) 'cause I was tired of kernel compilations and lack of a package dependency tool. It was a miracle! Everything worked. I kept using Ubuntu and I never had any problems. I thought the desktop evolved, it was usable. But, I was wrong!

I installed the latest 13.10 Ubuntu/Lubuntu and found out that I had no sound after resume from suspend . I said to myself: "Come on, it must be a mistake, I haven't got a problem like this in years!"

But it seems that this is a known problem for quite a while. And I started searching on the Internet for (at least local) solutions.

My conclusions were that when suspended the audio card/driver remains in an inconsistent state and needs to be somehow restarted. In case of Alsa this is done via:

sudo alsa force-reload


But in my case I couldn't do that without errors that were telling me something like this:

me@WS12:~$ sudo alsa force-reload
Unloading ALSA sound driver modules: snd-hda-codec-analog snd-hda-intel snd-hda-codec snd-hwdep snd-pcm snd-page-alloc snd-seq-midi snd-seq-midi-event snd-rawmidi snd-seq snd-seq-device snd-timer (failed: modules still loaded: snd-hda-codec-analog snd-hda-intel snd-hda-codec snd-hwdep snd-pcm snd-page-alloc snd-timer).
Loading ALSA sound driver modules: snd-hda-codec-analog snd-hda-intel snd-hda-codec snd-hwdep snd-pcm snd-page-alloc snd-seq-midi snd-seq-midi-event snd-rawmidi snd-seq snd-seq-device snd-timer.

Doing a lsof on the sound devices reveals why:

me@WS12:~$ lsof /dev/snd/*
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
lxpanel 1268  ins    9u   CHR  116,6      0t0 8923 /dev/snd/controlC0

For other Ubuntu flavors (I use Lubuntu) you might get pulseaudio being the one keeping sound devices open.

What I did?

Step 1a: I killed lxpanel

killall lxpanel

OR

Step 1b: I removed the Volume Bar from the panel and made a successful 'sudo alsa force-reload' (called twice ... - see below) - seems like the volume bar keeps some /dev/snd/* devices open

Step 2: Restart the lxpanel

lxpanel --profile Lubuntu


And after this the sound works. You need to do something similar if you want to do this when using portaudio:

1. Create this file with the following contents (so that portaudio doesn't restart when killed):

me@WS12:~$ cat ~/.pulse/client.conf
autospawn = no
me@WS12:~$


2. Kill pulseaudio

pulseaudio --kill

3. Also kill other programs that have some /dev/snd/* files open

4. Then restart alsa. But make sure you type 'sudo alsa force-reload' twice because ... I don't know (maybe the module unload order is not the good one ... really don't know)

me@WS12:~$ sudo alsa force-reload
Unloading ALSA sound driver modules: snd-seq-midi snd-seq-midi-event snd-seq snd-rawmidi snd-seq-device snd-hda-codec-analog snd-hda-intel snd-hda-codec snd-hwdep snd-pcm snd-page-alloc snd-timer (failed: modules still loaded: snd-hda-codec-analog snd-hda-codec snd-hwdep snd-pcm snd-page-alloc snd-timer).
Loading ALSA sound driver modules: snd-seq-midi snd-seq-midi-event snd-seq snd-rawmidi snd-seq-device snd-hda-codec-analog snd-hda-intel snd-hda-codec snd-hwdep snd-pcm snd-page-alloc snd-timer.
me@WS12:~$ sudo alsa force-reload
Unloading ALSA sound driver modules: snd-hda-intel snd-seq-midi snd-seq-midi-event snd-seq snd-rawmidi snd-seq-device snd-hda-codec-analog snd-hda-codec snd-hwdep snd-pcm snd-page-alloc snd-timer.
Loading ALSA sound driver modules: snd-hda-intel snd-seq-midi snd-seq-midi-event snd-seq snd-rawmidi snd-seq-device snd-hda-codec-analog snd-hda-codec snd-hwdep snd-pcm snd-page-alloc snd-timer.
me@WS12:~$

5. After that remove the ~/.pulse/client.conf

rm ~/.pulse/client.conf

6. Restart pulseaudio

pulseaudio --start

You're done!

Well this is what I call "evolution"! NOT.

Other choices in my opinion would be:

1. Fix the driver (if this is really the case)
2. When executing pm-suspend do the steps that I did... (see man page for scripts executed on suspend)
3. Use a sound server (pulseaudio/jack/esd...) that when going to sleep disconnects gracefully from the /dev/snd/* files and lets the 'alsa force-reload' do the job on resume - before it connects again)

The best choice I believe it is 3 (if 1 is not the issue) because the applications using sound (playing or recording) cannot see any real difference since they are routed through the sound server.

If you know some distros that work in this scenario (after suspend+resume I can hear music), please let me know.

Friday, October 18, 2013

Booting iso files in Ubuntu

This can be achieved by following some instruction from this page.

But what I found to be extremely easy is to use grml-rescueboot.

What you do is:


sudo apt-get install grml-rescueboot


and after that you copy the iso files into /boot/grml
Once you copied/moved the files in the location you run the following command:


sudo update-grub


Reboot and choose what live iso you want to try.





Thursday, October 17, 2013

Donate for wikipedia via bank transfer/direct deposit

Direct deposit

    The Wikimedia Foundation can accept money transfers to the following two accounts: 

    US Bank
        Wikimedia Foundation 
        Citibank 
        590 Market Street 
        San Francisco, US 94104 
        415-982-2960 

        Account numbers: 
        US Domestic Wires 
        ABA/ACH# 321171184 
        A/C# 203129580 

        International 
        SWIFT code CITIUS33 
        A/C# 203129580 

    European Union Bank
        Wikimedia Foundation 
        J.P. Morgan Chase Bank, N.A., London 
        25 Bank Street 
        Canary Wharf 
        London 
        E14 5JP 

        Account number: 
        IBAN GB49CHAS60924241034730 
        BIC CHASGB2L 
 
 
All the information can be found at this link.

Friday, October 11, 2013

Loialitate si concedieri

Am dat peste un interesant articol semnat David Brady si numit Loyality and Layoffs. Il consider o perspectiva cat se poate de reala referitoare la echilibrul dintre "viata intr-o companie" si viata reala/personala.

Parerea mea e ca trebuie sa tinem cont de cativa indicatori (sa le zicem):

  • ce dorim noi (1)
  • ce trebuie sa facem pentru o companie (2)
  •  ce putem face pentru companie astfel incat sa ne dezvoltam si noi (3)


Din astea trei eu zic ca putem spune ca oamenii loiali (cu tendinte spre fanatic) sunt cei care uita de 1 si exagereaza pe 2, ignorand intr-o mare masura 3.

Poti sa te dezvolti intr-o companie insistand mai mult pe punctul 3. Daca nu ti se permite … your call.

La servici ai sansa sa cunosti oameni, sa iti faci amici buni, sa faci conexiuni; dar cel mai important(pentru firma) e sa aduci ceva firmei. Altfel nu ai ce cauta acolo …

E normal sa fii dat afara daca afacerea nu mai merge sau daca nu aduci ceva firmei.

Firmele sunt ca niste fiinte fictive care functioneaza cu bani reali. Nu exista relatie cu firma precum relatia cu oamenii.

Firmele vor profit, de aia dau oameni afara. Nu au profit, e logic ca nu ai ce sa mai doresti de acolo (salariu, perks etc).

Dar ai si 8+ ore pierdute la firma. Dar e si mai comod decat sa ai tu grija de anumite chestii (taxe, asigurari, other perks).

Nu stiu cum e mai bine. Asta o consider o decizie personala.

Eu doar tin sa precizez ca e bine sa te implicit in ceva (pastrand in limite rationale indicatorul 2). Doar cand te implici ramai cu ceva.

Calea cea mai buna pentru majoritatea noastra e probabil pe undeva pe la mijloc (intre liber si in firma). Si e treaba noastra sa tindem acolo.

Si ca sa nu uit: o amica tocmai si-a dat demisia dintr-o maricica corporatie si mi-a zis asa: “Nici nu stii cat suntem de legati de sistemul asta”. Nu stiu cati constientizeaza adevarul asta in momentul actual.