понеділок, 18 серпня 2008 р.

Sending sound from Windows to Linux

After fighting with ALSA for some time to make sound from two sound cards work
1) built-in NVidia HDA
2) M-Audio Delta (Audiophile) 2496
I almost gave it all up and removed M2496 hoping that built-in will work fine - I was wrong.
As I can see it now - There is no "simple" solutions in Linux, like reboot and see what happens :)
So I've decided to setup and run system-wide pulseaudio daemon - after trying and reading forums it helped - I have sound from apps that use ALSA, I have volume control from pa applet and support for esd/pulseaudio network clients.

Next thing I've decided to try is passing sound from windows to linux - so I could walk around with my laptop and playing winamp or foobar or anything and the sound went from speakers plugged into my linux box.
First success was to run paplay on windows connected to pulseaudio server on linux - that was fun, but not useful.
Next, I've search for some kind of pa client audio output driver for Win, nothing of that kind yet exists (I will learn programming windows drivers some day, but until then I use google search ;) but there are ESD clients for windows:
1. WinESD 0.3 which is claimed to be a pre-ALPHA so be afraid :) I've installed it, but it requires reboot which I haven't done yet (I use hibernation in windows, because I don't like to start all those useful apps over and over again every day - so I guess I will reboot it later)
2. ESD output plugin for Winamp 2/3 - which I use right at this moment to stream music from my winamp on windows to pulseaudio server on linux - sounds nice and smooth, no glitches, no delays.

here are my pulse configuration files
/etc/pulse/default.pa

#!/usr/bin/pulseaudio -nF
# NVidia
# ALSA
add-autoload-sink output module-alsa-sink sink_name=output device=hw:0
add-autoload-source input module-alsa-source source_name=input device=hw:0

# Load several protocols
load-module module-native-protocol-unix
load-module module-zeroconf-publish
#these two lines below allow ESD/PA clients to connect
# auth-anonymous=1 is not very safe,
# but firewall doesn't let strangers in

load-module module-esound-protocol-tcp auth-anonymous=1
load-module module-native-protocol-tcp auth-anonymous=1

# Make some devices default
set-default-sink output
set-default-source input

run: sudo pulseaudio --system=1 --high-priority=1 -D
to start pulseaudio as a system-wide daemon.

in winamp:
1) select esd out plugin
2) in esd out plugin options enter:
host: ninja.local (my linux box host)
port: 16001 (it was there by default)
password: (nothing, auth-anonymous, remember?)
3) ok, close, play

Look ma, no wires :)))

p.s. I am going to put m2496 back in

четвер, 14 серпня 2008 р.

How to open an URL in firefox running on another VT

I have a ubuntu linux box at home. It works as a router, firewall and a local server (web, dns, ntp, ssh)
But except that it's it has kde3.5 running - mostly, I listen music from it, while I work in windows xp. I use Xming to run kicker (kde3 "taskbar"). Sometimes I really need to open an URL in my linux box session (not in xming's session) and there's a funny way to do it.

I open konsole from kicker in windows and type:
who
me :0 2008-08-14 03:57
(which means my display in linux is :0)

export DISPLAY=:0


firefox http://whatever-url-i-need-to-open-in-linux/


and voila.

p.s. XMing's display is localhost:10.0 by default

Switching CLI input language in Ubuntu Linux

1. open ~/.bashrc for editing:
nano ~/.bashrc

2. add some aliases at the bottom of .bashrc file:
alias ua="setxkbmap ua"
alias сш="setxkbmap us"

3. save (Ctrl+o), exit nano (Ctrl+x) and reload .bashrc:
source ~/.bashrc