Mar 112013
 

I recently started using the awesome window manager again. Running into some issues, I wanted to try out the git master version, but not replace my stable installation.

The recipe is:

  1. Build it for installation in $HOME and install it.
    cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME/opt/awesome
    make install
    
  2. Create a testing wrapper script awesome-xephyr and put it into $PATH:
    #!/bin/bash
    
    if [ -z "$AWESOME" ]; then
    AWESOME=awesome
    fi
    
    $AWESOME -k "$@" || exit 1
    
    Xephyr :1 -ac -br -noreset -screen 1152x720 &
    xephyr_pid=$!
    
    sleep 1
    
    DISPLAY=:1.0 $AWESOME "$@" &
    awesome_pid=$!
    
    echo "Press ENTER to kill Xephyr"
    read a
    kill $awesome_pid
    kill $xephyr_pid
    
  3. Run it
    #!/bin/bash
    
    # ;; means the default lua search path
    export AWESOME_PREFIX=$HOME/opt/awesome
    export RC=$HOME/.config/awesome/git.lua  # copied from .build.../awesomerc.lua and adjust the beautiful.init theme path
    
    LUA_PATH=";;$AWESOME_PREFIX/share/awesome/lib/?.lua;$AWESOME_PREFIX/share/awesome/lib/?/init.lua" \
    AWESOME=$AWESOME_PREFIX/bin/awesome \
    exec awesome-xephyr -c $RC
    

P.S. You can possibly tweak this to work without the make install directly from the .build directory.

Sep 232012
 

The biggest confusion that I had when getting this to work is that you can only manipulate the UEFI boot loader when booted in UEFI mode. Since my existing Debian installation, as well as the installer CD booted in BIOS emulation mode, I failed to set up the boot loader at first. Key is the efi shell, which I can conveniently access on my ASUS motherboard by hitting Exit in the EZ mode to get to the Advanced mode, then hitting Exit again.

Links

Update: For proper kernel configuration, see [https://www.kernel.org/doc/Documentation/x86/x86_64/uefi.txt] . Starting with 3.7 I had no kernel output any more without these settings.

Nov 092010
 

Many thanks to wishie from #alsa, who wrote most of this file!

# 2008-11-15
#
# This .asoundrc will allow the following:
#
# - upmix stereo files to 5.1 speakers.
# - playback real 5.1 sounds, on 5.1 speakers,
# - allow the playback of both stere(oupmixed) and surround(5.1) sources at the same time.
# - use the 6th and 7th channel (side speakers) as a separate soundcard, i.e. for headphones
#   (This is called the "alternate" output throughout the file, device names prefixed with 'a')
# - play mono sources in stereo (like skype & ekiga) on the alterate output
#
# Make sure you have "8 Channels" and NOT "6 Channels" selected in alsamixer!
#
# Please try the following commands, to make sure everything is working as it should.
#
# To test stereo upmix :      speaker-test -c2 -Ddefault -twav
# To test surround(5.1):      speaker-test -c6 -Dplug:dmix6 -twav
# To test alternative output: speaker-test -c2 -Daduplex -twav
# To test mono upmix:         speaker-test -c1 -Dmonoduplex -twav
#
#
# It may not work out of the box for all cards. If it doesnt work for you, read the comments throughout the file.
# The basis of this file was written by wishie of #alsa, and then modified with info from various sources by 
# squisher.

#Define the soundcard to use
pcm.snd_card {
    type hw
    card 0
    device 0
}

# 8 channel dmix - output whatever audio, to all 8 speakers
pcm.dmix8 {
    type dmix
    ipc_key 1024
    ipc_key_add_uid false
    ipc_perm 0660
    slave {
        pcm "snd_card"
        rate 48000
        channels 8
        period_time 0
        period_size 1024
        buffer_time 0
        buffer_size 5120
    }

# Some cards, like the "nforce" variants require the following to be uncommented. It routes the audio to t he correct speakers.
    bindings {
        0 0
        1 1
        2 4
        3 5
        4 2
        5 3
        6 6
        7 7
    }
}

# upmixing - duplicate stereo data to all 6 channels
pcm.ch51dup {
    type route
    slave.pcm dmix8
    slave.channels 8
    ttable.0.0 1
    ttable.1.1 1
    ttable.0.2 1
    ttable.1.3 1
    ttable.0.4 0.5
    ttable.1.4 0.5
    ttable.0.5 0.5
    ttable.1.5 0.5
}

# this creates a six channel soundcard
# and outputs to the eight channel one
# i.e. for usage in mplayer I had to define in ~/.mplayer/config:
#   ao=alsa:device=dmix6
#   channels=6
pcm.dmix6 {
    type route
    slave.pcm dmix8
    slave.channels 8
    ttable.0.0 1
    ttable.1.1 1
    ttable.2.2 1
    ttable.3.3 1
    ttable.4.4 1
    ttable.5.5 1
}

# share the microphone, i.e. because virtualbox grabs it by default
pcm.microphone {
    type dsnoop
    ipc_key 1027
    slave {
        pcm "snd_card"
    }
}

# rate conversion, needed i.e. for wine
pcm.2chplug {
    type plug
    slave.pcm "ch51dup"
}
pcm.a2chplug {
    type plug
    slave.pcm "dmix8"
}

# routes the channel for the alternative
# 2 channel output, which becomes the 7th and 8th channel 
# on the real soundcard
pcm.alt2ch {
    type route
    slave.pcm "a2chplug"
    slave.channels 8
    ttable.0.6    1
    ttable.1.7    1
}

# skype and ekiga are only mono, so route left channel to the right channel
# note: this gets routed to the alternative 2 channels
pcm.mono_playback {
    type route
    slave.pcm "a2chplug"
    slave.channels 8
    # Send Skype channel 0 to the L and R speakers at full volume
    ttable.0.6    1
    ttable.0.7    1
}

# 'full-duplex' device for use with aoss
pcm.duplex {
    type asym
    playback.pcm "2chplug"
    capture.pcm "microphone"
}

pcm.aduplex {
    type asym
    playback.pcm "alt2ch"
    capture.pcm "microphone"
}

pcm.monoduplex {
    type asym
    playback.pcm "mono_playback"
    capture.pcm "microphone"
}

# for aoss
pcm.dsp0 "duplex"
ctl.mixer0 "duplex"

# softvol manages volume in alsa
# i.e. wine likes this
pcm.mainvol {
    type softvol
    slave.pcm "duplex"
    control {
        name "2ch-Upmix Master"
        card 0
    }
}

#pcm.!default "mainvol"

# set the default device according to the environment
# variable ALSA_DEFAULT_PCM and default to mainvol
pcm.!default {
    @func refer
    name { @func concat 
           strings [ "pcm."
                     { @func getenv
                       vars [ ALSA_DEFAULT_PCM ]
                       default "mainvol"
                     }
           ]
         }
}

# uncomment the following if you want to be able to control
# the mixer device through environment variables as well
#ctl.!default {
#    @func refer
#    name { @func concat 
#           strings [ "ctl."
#                     { @func getenv
#                       vars [ ALSA_DEFAULT_CTL
#                              ALSA_DEFAULT_PCM
#                       ]
#                       default "duplex"
#                     }
#           ]
#         }
#}

Wine

wine unfortunately dosen’t seem to try to open the default device, but the following snippet inserted into your ~/.wine/user.reg will do the trick:

[Software\Wine\Alsa Driver]
"AutoScanCards"="N"
"DeviceCount"="1"
"DeviceCTL1"="default"
"DevicePCM1"="default"
"UseDirectHW"="N"

Older Version

This version doesn’t setup the side speakers as a second soundcard.

# upmix.and.dmix.intel8x0 begins ###
#This asoundrc is for snd_intel8x0 based cards.
#It will allow the following:
#
# upmix stereo files to 5.1 speakers.
# playback real 5.1 sounds, on 5.1 speakers,
# allow the playback of both stere(upmixed) and surround(5.1) sources at the same time.
# upmix mono sound from skype
#
#
#Please try the following commands, to make sure everything is working as it should.
#
# To test stereo upmix : speaker-test -c2 -Ddefault -twav
# To test surround(5.1): speaker-test -c6 -Dplug:dmix6 -twav
#
#
#It may not work out of the box for all cards. If it doesnt work for you, read the comments throughout the file.
#If it still doesnt work with your setup, please speak to me (wishie) in #alsa on irc.freenode.net

#Define the soundcard to use
pcm.snd_card {
    type hw
    card 0
    device 0
}

# 6 channel dmix - output whatever audio, to all 6 speakers
pcm.dmix6 {
    type dmix
    ipc_key 1024
    ipc_key_add_uid false
    ipc_perm 0660
    slave {
        pcm "snd_card"
        #rate 48000
        channels 6
        period_time 0
        period_size 1024
        buffer_time 0
        buffer_size 4096
    }

# Some cards, like the "nforce" variants require the following to be uncommented. It routes the audio to t he correct speakers.
    bindings {
        0 0
        1 1
        2 4
        3 5
        4 2
        5 3
    }
}

# upmixing - duplicate stereo data to all 6 channels
pcm.ch51dup {
    type route
    slave.pcm dmix6
    slave.channels 6
    ttable.0.0 1
    ttable.1.1 1
    ttable.0.2 1
    ttable.1.3 1
    ttable.0.4 0.5
    ttable.1.4 0.5
    ttable.0.5 0.5
    ttable.1.5 0.5
}

# rate conversion, needed i.e. for wine
pcm.2chplug {
    type plug
    slave.pcm "ch51dup"
}

# 'full-duplex' device for use with aoss
pcm.duplex {
    type asym
    playback.pcm "2chplug"
    capture.pcm "hw:0"
}

# change default device:
pcm.!default {
    type softvol
    slave.pcm "duplex"
    control {
        name "2ch Master"
        card 0
    }
}

# for aoss
pcm.dsp0 "duplex"
ctl.mixer0 "duplex"

#pcm.default:0 "default"

# upmix.and.dmix.intel8x0 ends ###

# skype is only mono, so route left channel to the right channel
pcm.skype_playback {
    type route
    slave.pcm "2chplug"
    slave.channels 2
    # Send Skype channel 0 to the L and R speakers at full volume
    ttable.0.0    1
    ttable.0.1    1
}

Resources

Other Sites with .asoundrc Examples

May 092010
 

1. Install Mingw.
1. Install Python/Msys (depending on waf or autotools as the toolchain). We assume waf but the procedure should be similar for autotools.
1. Download the gtk all-in-one bundle, and extract it into C:gtk
1. Setup $PATH to include python and the gtkbin directory
1. Happyness ensues

Sep 302009
 

Setup

”’Note that I’m not a kerberos expert by any means. These short instructions got puzzled together from some tutorials, and they work for me. It’s likely I forgot something too, so YMMV”’

1. Initialize the kdc database. On debian this is done through debconf at package install time. Take the rest of the initial setup of /etc/krb5.conf and /etc/krb5kdc/kadm.acl etc from the first link of the resources.
1. Add an admin account.

 
kadmin.local -q "addprinc root/admin"

1. Add an account for the machine

kadmin.local -q "addprinc -randkey host/foo.bar"

1. For every client, on the server
1. Add a machine account

kadmin -q "addprinc -randkey host/client.bar"

1. Add a nfs account

kadmin -q "addprinc -randkey nfs/client.bar"

1. On every client add the keys generated on the server to the tab

kadmin -q "ktadd host/client.bar"
kadmin -q "ktadd -e des-cbc-crc:normal nfs/client.bar"

Notes

  • In debian, edit /etc/default/nfs-common and nfs-kernel-server to make sure that statd is not running, and that idmap and the gss services are started.
  • Make sure that the fqdn of the server doesn’t resolve to 127.0.0.1 through /etc/hosts – it will break kadmin
  • Edit /etc/idmap.confand change
    
    

[General] Domain = your.domain

Otherwise you will get errors like ”rpc.svcgssd[5054]: WARNING: get_ids: failed to map name ‘nfs/alucardo.nd.mcbf.net@ND.MCBF.NET’ to uid/gid: Invalid argument” in syslog.

  • hostname –fqdn really does need to return the full-qualified domain name. Often it does not, because many people set up /etc/hostsso that the unqualified domain name comes before the full qualified one. A correct setup is:
    
    

10.0.0.1 foo.bar foo

A wrong setup will cause errors like

Aug 23 20:47:19 tor rpc.svcgssd[4738]: ERROR: GSS-API: error in gss_acquire_cred(): Unspecified GSS failure.  Minor code may provide more information - No principal in keytab matches desired name 
Aug 23 20:47:19 tor rpc.svcgssd[4738]: Unable to obtain credentials for 'nfs' 
Aug 23 20:47:19 tor rpc.svcgssd[4738]: unable to obtain root (machine) credentials 
Aug 23 20:47:19 tor rpc.svcgssd[4738]: do you have a keytab entry for nfs/@ in /etc/krb5.keytab?
  • Clocks must be synchronized (ntp is sufficient), or you will get strange errors. I.e. an gss error where the major code is Unknown Error and the minor code is unknown as well.

Resources

Additional pages not really used:

May 282009
 

My card uses the saa7134 driver. lspci output:

00:0a.0 Multimedia controller: Philips Semiconductors SAA7131/SAA7133/SAA7135 Video Broadcast Decoder (rev d1)
	Subsystem: Micro-Star International Co., Ltd. TV@nywhere Plus

It seems in 2.6 kernels with this driver the remote should just register as a keyboard, you can check in /proc/bus/input/devices if it shows up. Mine did not out of the box on debian testing with a 2.6.26 kernel.

With 2.6.29 a patch (http://marc.info/?l=linux-video&m=122086916009931&w=2) is integrated which does make the remote show up as a keyboard input. Using it then with lirc requires a special config file: http://linux.bytesex.org/v4l2/faq.html#lircd , which seems to be the same essentially as http://www.lemis.com/grog/programs/multimedia/TVatnywhere. I ended up using the former. It does work fine now, aside from two buttons which are switched somehow, which is not a big deal to me.

The remaining step is to setup an ~/.lircrc. Information on this is surprisingly sparse, so I’ll post my version shortly.

Jun 142008
 

Are you trying to boot Windows from a second hard drive, but it just hangs and nothing happens?

Windows apparently only really supports booting from the first hard drive, but grub can trick Windows by remapping drives:

title Windows
        rootnoverify (hd1,0)
        map (hd0) (hd1)
        map (hd1) (hd0)
        chainloader +1

Source: http://www.weiqigao.com/blog/2004/01/14/windows_on_the_second_hard_drive_linux_on_the_first.html

Dec 022007
 

Symptoms

The client gets permission denied on some item inside an NFS mount (this is not a mount problem). Everything looks ok, the user should have access to the file because he is in the correct group, the file has correct permissions, the ids map/are the same (idmapd does not report any issues), but there still is no access to the file from the client.

Source of the Problem

NFS, even NFSv4, is most often using AUTH_SYS to authenticate connections. AUTH_SYS only allows 16 groups to be transmitted with a request. My Linux (2.6.22, nfs-common 1.1.1) truncated all group memberships, and only sent the first 16, resulting in this seemingly unexplicable “access denied” even though the user was part of the group on both the client and the server.

Solution

A quick fix is reducing the number of groups the user is a member of.

A better solution is to use a different authentication mechanism instead of AUTH_SYS (which does not provide real security anyways), suggested is RPCSEC_GSS. I read somewhere that at the moment (2007-12-02) only kerberos is properly supported in the Linux gss library, but I’m not certain about that. I went ahead and setup kerberos, just because its known to be mature: NFSKerberos.

Resources

I found out about the problem in Eisler’s NFS Blog, which includes much more details on this issue.