My thoughts on Slackware, life and everything

Month: August 2010

Running VLC in XFCE

As you may know I am using KDE for my daily work. However, I use XFCE from time to time – for example when I have to run a remote X session over XDMCP and want to keep a fluid feel to the desktop.

When I was working in XFCE yesterday I wanted to use VLC to check a video file on my computer, and I was in for a surprise when clicking “Media > Open file” made my VLC hang indefinitely!

I remembered a discussion about this phenomenon on LinuxQuestions.org and indeed the solution as pointed out in that thread works for me.

What happens here?

The core of the issue, is that Qt4 makes an incorrect assumption about which GTK+ theme engine to use. A GTK+ theme engine makes a Qt4 application blend in nicely with a GTK+ based desktop environment such as XFCE, by using GTK+ instead of Qt4 to render all graphical components.

There are a few GTK+ theme engines available – one of them is QGtkStyle which is part of Qt4 in Slackware. However, Qt4 libraries look at the environment variable “GTK2_RC_FILES” in order to find out how to configure the GTK theme engine.

If this environment variable is not (or incorrectly) set, then Qt4 assumes that GTK+ is using GTK-QT-Engine which is not part of Slackware (GTK-QT-Engine is used to give GTK appplications a Qt feel when they are running in KDE) and it will not correctly apply the QGtkStyle engine. It sets QGtkStyle to use the GTK style Clearlooks, and outputs an error message which you will sometimes be able to see if you started a Qt-based application from a terminal:

QGtkStyle cannot be used together with the GTK_Qt engine.

This can be solved by explicitly telling Qt4 where Slackware keeps its GTK+ configuration files, and then making sure a GTK+ theme is configured there.

  • Define the environment variable “GTK2_RC_FILES” in one of these files: ${HOME}/.xinitrc (applies to just you) or in /etc/profile.d/qt4.sh (applies system-wide) by adding the follwing two lines to that file (assuming you are using bash as your default shell):
    GTK2_RC_FILES="$HOME/.gtkrc-2.0:/etc/gtk-2.0/gtkrc"
    export GTK2_RC_FILES
  • Create a new file (or edit the existing) ${HOME}/.gtkrc-2.0 (so that the GTK theme applies to just you) or /etc/gtk-2.0/gtkrc (so that it applies system-wide) and add the following line to it:
    gtk-theme-name="GTK+"

That should fix VLC’s “Media > File Open” dialog which will now appear instantly.

Note: You can choose a GTK+ theme for all your QT4 based applications if you want by running “qtconfig” and in the tab “Appearance” set the “Select GUI Style” to “GTK+” instead of “Desktop Settings (default)“.

Eric

GTK2_RC_FILES

KDE 4.5.0

KDE 4.5.0 is available!

… and I can offer you packages for KDE Software Compilation 4.5.0 for Slackware-current. The 4.5.0 packages are accompanied by a README which explains the straight-forward  installation/upgrade steps. As always, both 32-bit and 64-bit versions are available.

This marks another milestone for the KDE project with numerous improvements to the KDE 4.4 which we have in Slackware at the moment. Congratulations to everyone who helped in making this release possible, even if its release date slipped a bit instead of delivering on time as usual.  The delay allowed for the fix of a few severe application bugs, so in the end we all benefit.

You will need to run Slackware-current dated Saturday July 31, 2010 or newer. My packages for KDE 4.5.0 are not guaranteed to work on Slackware 13.1, so if you want KDE 4.5.0 you are encouraged to upgrade to Slackware-current!

The additional dependencies which you have to take care of on slackware-current (i.e. non-KDE and/or non-Slackware packages) are limited to just one package, thanks to Pat Volkerding who applied several updates to Slackware-current recently – so that the requirements for running KDE 4.5.0 would be met from the start. That single remaining dependency is libdbusmenu-qt (which does not yet exist in Slackware).  You’ll find it in the “deps” directory.

If you are adventurous and want to try this on Slackware 13.1 anyway, I think you could get lucky by installing/upgrading the packages which you will find in the “deps” directory of my KDE 4.4.5 package repository for Slackware 13.1. Basically, all those updated “deps” packages are are the real difference between Slackware-13.1 and slackware-current at this moment.

NOTE 1:

The kdepim and kdepim-runtime packages are not part of KDE 4.5.0 !!
The PIM developers decided that their applications are not yet stable enough to get included, and instead you are encouraged to keep the kdepim and kdepim-runtime packages of Slackware 13.1 (version 4.4.3) or slackware-current (version 4.4.5).
There is one caveat: the consequence is that you will only be able to use the english localization of kdepim, because the language files are contained in the kde-l10n-* packages of the old version. You can not install that in parallel with the 4.5.0 version of your language files.  Perhaps I will try and split off the kdepim language files into separate packages, if I have the time (unfortunately at this moment I do not have that luxury).

NOTE 2:

If you have been running my previous alpha or beta builds of KDE 4.5.0, and if you experience strange application or plasma behaviour in 4.5.0, try with a fresh user profile. Data migration from KDE 4.4.x to 4.5.0 should not be an issue, but there may be some incompatible changes during the early betas, as mentioned by Maciej on Aaron Seigo’s blog.

And in case you think, “what a strange location for the packages, why have they not been placed in the ‘ktown’ repository“… that is a good question! By the time  this post appears on my blog, I will not be connected to the Internet. Therefore I have scheduled this post to be published in the future after I finished compiling. And since I could not make the packages publicly available ahead of the official release, I decided to hide them in plain sight… Once I get my Internet back I will move the 4.5.0 packages to the correct location, which is indeed my ktown repository.

Update (22-aug-2010): the 4.5.0 directory has finally been moved into my ktown repository and I have updated the links in this article which point to it.

Enjoy, Eric

Adding an ALSA software pre-amp to fix low sound levels

Low sound volume in Linux?

Apparently a lot of laptop users are confronted with the issue of very low sound levels – not just in Slackware. Note that this is different from the “sound can not be un-muted” issue I experienced and which I wrote about in a previous article.

If you are among the affected users for whom the sound levels remain too low even when cranking the volume all the way up, there is away around this.

It works by enhancing the ALSA sound system with a sound pre-amplifier and adding that to the available controls. ALSA uses dmix to create the new software volume control. You can then play around with varying percentages of sound amplification. You will have to find an optimum between acceptible sound levels and the possible sound distortion which will be introduced by this pre-amp.

To add the software pre-amp system-wide you need to open the ALSA configuration file “/etc/asound.conf” in an editor (Slackware does not create that file by default, so you may have to edit a new file) and add the following definition to it (note that if you have multiple sound cards and the default is not “card 0” you may have to alter the definition a bit):

pcm.!default {
        type hw
        card 0
}
ctl.!default {
        type hw
        card 0
}
pcm.!default {
        type plug
        slave.pcm “softvol”
}
pcm.softvol {
        type softvol
        slave {
                pcm “dmix”
        }
        control {
                name “Pre-Amp”
                card 0
        }
        min_dB -5.0
        max_dB 20.0
        resolution 6
}

Then, save the file and reboot your computer (you could also try running “/etc/rc.d/rc.alsa restart” but I can not guarantee that that will re-initialize ALSA correctly).

After reboot, you will find an additional control in your mixer (alsamixer or kmix) called “Pre-Amp”. Note that KDE’s mixer does not show all controls by default and you may have to add “Pre-Amp” to the visible controls.

Eric

Addendum:

Note that initially I suggested the use of the block of code you find below. But when I installed Slackware 14 on my new desktop I experiences the same volume level issue. After adding a “pre-amp” I found that ALSA had lost its default device, which caused warning messages every time I logged into KDE and gives programs like aplay and mpg123 the fits. A comment by “d” further down in the article with the above solution worked much better for my desktop machine, so I decided to re-write this article even though I don’t usually do such a thing. I will keep the originally suggested code block below for reference – try it only if the code above does not work for you:

pcm.!default {
      type plug
      slave.pcm "softvol"
  }

  pcm.softvol {
      type softvol
      slave {
          pcm "dmix"
      }
      control {
          name "Pre-Amp"
          card 0
      }
      min_dB -5.0
      max_dB 20.0
      resolution 6
  }

If the Pre-amp control does not appear in your mixer window, you may have to replace the line that says:

type plug

with this line:

type hw

This information was taken from the unofficial ALSA Wiki: http://alsa.opensrc.org/index.php/How_to_use_softvol_to_control_the_master_volume and it was also offered as a solution in this LinuxQuestions.org post on the Slackware forum.

I received a report that the default block of code does not always work. Changing “plug” to “hw” may be necessary with some laptops.

http://www.alsa-project.org/alsalogo.gif

© 2024 Alien Pastures

Theme by Anders NorenUp ↑