All pastes #1459362 Raw Edit

Untitled

public text v1 · immutable
#1459362 ·published 2009-06-13 22:32 UTC
rendered paste body
.asoundrc:


pcm.dmixer {
type dmix
ipc_key 1024
ipc_key_add_uid false
ipc_perm 0660
slave {
pcm "hw:0,0"
rate 48000
channels 2
format S32_LE
period_time 0
period_size 1024
buffer_time 0
buffer_size 4096
}
}

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


swap.sh:

#!/bin/bash
#swap.sh - sherl0k@gmail.com
#Using a basic .asoundrc, this will swap the outputs between two different sources.
#For my uses, between my laptop's speakers, and the HDMI output going to my television.
config="$HOME/.asoundrc"
SPEAKERS=`cat $config | grep "hw:0,0" | wc -w`
if [ $SPEAKERS == "2" ]
then
sed -i -e 's/pcm "hw:0,0"/pcm "hw:0,3"/' .asoundrc
exit
fi
SPEAKERS=`cat $config | grep "hw:0,3" | wc -w`
if [ $SPEAKERS == "2" ]
then
sed -i -e 's/pcm "hw:0,3"/pcm "hw:0,0"/' .asoundrc
exit
fi
exit