Labels

Linux (39) Thinkpads (4) lego (12) pi (20)

Tuesday, 20 November 2012

Lost audio playback after unplugging headphones


Audio/sound worked fine through the Thinkpad's speaker, I then plugged in headphones which worked fine, but then after unplugging the headphones, audio/sound did not play through the speaker, and plugging the headphones back in confirmed there was no audio / sound through them.

The fix is to restart the alsa-utils service.

/etc/init.d/alsa-utils restart

Playback through both speakers and headphones was fixed.


UPDATE:

This appears to be happening on all my Thinkpads (X20, X21, X22, X23, X24, X60, X60s, X61, X61s, X61T, T420) ever since Update Pack 5 for LMDE (Linux Mint Debian Edition) [affects Update Pack 6 as well].  I'm not certain if it is an issue with LMDE or Debian Wheezy.

The issue is that if you hardware or software (using volume control) mute the sound, you cannot unmute the sound via hardware or software volume control.  The sound will appear unmuted but there is no sound.

The solution is to run alsamixer (it's a XTerm GUI app, so run from a terminal session).  You should see a sound control for PulseAudio.  You can toggle the sound on/off by pressing m (for mute/unmute).

This is the only way I have found to be able to unmute the sound.

Monday, 15 October 2012

My Proven Method for Upgrading on LMDE

I've had mixed results when using the GUI updater.

What has never failed me is this method:

1) triple check your sources.list
2) run (as root), apt-get update
3) run (as root), apt-get upgrade -d
4) run (as root), apt-get upgrade
5) [if any errors in #4], run (as root), apt-get upgrade -f
6) run (as root), apt-get dist-upgrade -d
7) run (as root), apt-get dist-upgrade
8) [if any errors in #4], run (as root), apt-get dist-upgrade -f
9) reboot and test!

Always resulted in successful upgrades. I've been down the "destroyed" system route when upgrading before.

But like always, I do a quick clonezilla of my /root partition. I consider that critical. Even if the upgrade goes smooth, you never know what show-stoppers you'll run into after the upgrade (such as a particular critical application you use is not compatible with some of the updates). You always want a rollback strategy.

Monday, 10 September 2012

Using Compiz with LMDE (updated pack 4 or later)

I used Compiz with LMDE with GNOME 2 since starting to use LMDE.

With update pack 4, the choices of window managers has changed with GNOME 2 being replaced with GNOME 3, Cinnamon and MATE (fork of GNOME 2).  I tried Cinnamon for a while, and yes it is indeed impressive, it is still too early to start using it to replace Compiz w/ GNOME 2.

To get Compiz working with MATE, there is one additional issue than with GNOME 2.  With GNOME 2, you can simply run "compiz --replace" to activate Compiz.  In MATE, this works, but then then some MATE processes end up pegging the CPU high (constant running 50% CPU on a dual core -- I would assume this would be 100% on a single core system or 25% on a quad core system).  To   stop the CPU from running high, you run a "killall -9 marco" after activating Compiz.  However, as I found, it doesn't seem to work very well from a script.  I've always had "compiz --replace" as a startup script in "Startup Application", but simply adding the kill directly after didn't seem to have the desired effect.  Even when ensuring Compiz was starting up as a background process with a &, the killall immediately after still didn't appear to be having any effect.  I also tried putting a sleep inbetween steps.

The ultimate solution is to prevent the marco from starting completely.

With that said, here is the ultimate workaround to get Mate with Compiz running as your desired Window Manager.

First, you will need to install mateconf-editor (sudo apt-get install mateconf-editor).  This will add a red-icon version of Configuration Editor to your Programs (not to be confused with gconf-editor which you may have previously installed as well).  Start mateconf-editor from a terminal or from the Programs menu.

Second, navigate to /desktop/mate/session/required_components.  Locate the windowmanager setting, and change it to either blank or compiz.  I actually went with leaving it blank and continuing my prior tradition of having a "compiz --replace" execute via "Startup Applications", rather than changing the default to Compiz.

That's it.  Now have fun with CompizConfig (ccsm) to edit and configure your Compiz environment.

If you don't have Compiz installed, install the components via Synaptic.  I prefer to install all the plugins as well to fully customize Compiz.  I use compiz-gtk, compiz-dev, libdecoation0, compiz-plugins, compiz-core, compiz-fusion-plugins-unsupported, libcompizconfig0, compizconfig-backendgconf, compiz-fusion-plugins-main, compiz-fusion-plugins-extra, compiz-fusion-bcop, and compizconfig-settings-manager.

Tuesday, 14 August 2012

SSD Efficiency: Moving .xsession-errors

The .xsession-errors file normally resides in your home directory and it gets written to very often.  There is very little purpose to this file, unless you are troubleshooting a particular X application.

For the sake of reducing writes to the hard drive (prevent waking a spinning disk, prolong the life of a SSD), I have tried to relocate the file to /tmp, which is a ramdisk.  I located the entry, ERRFILE, responsible for the file within /etc/X11/Xsession, and tried changing it,

from:

ERRFILE=$HOME/.xsession-errors
to:
ERRFILE=/tmp/.xsession-errors

However, the system keeps writing to a .xession-error file in the home directory (regardless if I delete this file or not, it gets regenerated).  The issue has persisted for weeks including after many reboots.

I came across this post http://ubuntuforums.org/showthread.php?t=1946716 which suggested making the file immutable by:


rm ~/.xsession-errors
touch ~/.xsession-errors
sudo chattr +i ~/.xsession-errors


I've done this, and now at least the file is not being written to, but likewise, there is no file generated in /tmp/.

I'll have to keep this for the time being and then remove the flag if I ever need to make use of the .xsession-errors file.

Saturday, 21 July 2012

Google Chrome popping sound in Linux


I was forced to recently upgrade my Google Chrome from Chrome 16.x to Chrome 20.x on account of LastPast simply stopped working one-day with releases < 20.x (Chrome doesn't auto-update on Linux, unless you allow it to, but LastPass forces auto-download of the latest extension each time you launch the application against your will [aside: maybe figuring out the update URL and blocking it on the router or in the Linux routing tables on the machine would prevent this]).

Obviously, the popping sound comes about from the sound card going in and out of on mode.  I noticed it immediately after upgrading, and would be prevalent on sites such as gmail.com which has many hidden flash objects in the background.  Gmail and other sites with oodles of flash were essentially making chrome pop nonstop, as if it were cooking popcorn.

I found this thread: http://forums.linuxmint.com/viewtopic.php?f=47&t=107339

Google appeared to post a fix.  I don't know why they would post a clearly Windows fix into a clearly Linux thread -- since when do .dll files exist in Linux.  I thought at least the libraries would exist in some form (.so) and the fix may still apply.  But only 1 out of the 3 referenced libraries even exist.

I tried upgrading to the unstable Chrome 22.x version (since someone in the thread posted that the problem appeared to be fixed in 21.x which is against not exactly what Google is saying).  It is still happening for me in Chrome 22.x.

Shockwave Flash will show as the current version 11.3.x.  You need to disable it and leave only 11.0 d1 enabled.

This is what I figured out actually works:
- Type about:plugins in your address bar
- Click Details on the upper right corner
- Locate the entry for libpepflashplayer.so
-- Click Disable
- Locate the entry for libflashplayer.so
-- The entry should already, if not enable it, or you'll lose flash support.

Restart Chrome and you'll be popping-free.  But you will get the annoying "there is an flash update" dialogues.  Better than the popping.

To prevent the flash update dialogues, for your shortcut that you use to start Chrome, append the following --allow-outdated-plugins.  So your shortcut may resemble the following command:
/opt/google/chrome/google-chrome --allow-outdated-plugins

UPDATE 11/20/2012:

Chrome 23+ does not suffer this "popping" issue.  I have migrated to Chrome 23.0.1271.64 on several  32bit and 64bit systems and switched back to the original default settings (to use the more up to date  libpepflashplayer.so).

Wednesday, 9 May 2012

Was going to replace the existing WLAN card in the X61T with a newer, more linux friendly version, but I couldn't get the screws loose, and ended up stripping them in the process. So in the end, I decided to hack the second WLAN card by covering pin 20 with electrical tape, adding a 4th antenna into the palm rest, and viola. Now the machine has two WLAN connections, one that is newest technology that is very linux friendly. Plus there is some signal loss due to the digitizer and touchscreen interfaces causing interference with the antennas, so the added antenna in the palm rest make the connections more reliable.

Thursday, 26 April 2012

Changing Default Browser in Linux

Whenever I have an application spawning a web page, it always either opened in winebrowser (which doesn't work, and just causes the machine to spike on cpu) or Firefiox (which I don't regularly use unless something doesn't work in chrome). For some reason clicking Make Google Chrome Default Browser in Chrome has no effect. So I ran sudo update-alternatives --config x-www-browser Which presented me some choices Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/google-chrome 200 auto mode 1 /opt/firefox/firefox 70 manual mode 2 /usr/bin/google-chrome 200 manual mode 3 /usr/bin/iceweasel 70 manual mode Chrome was already set but wasn't working. Perhaps the "auto mode" had something to do with it. I entered the choice 2 at the prompt and now chrome opens as the default browser.