Vitavonni

Mon, 04 Dec 2006

Software mixer with ALSA

The "high definition audio" in my laptop is rather minimal. Apart from the mic not yet working, it has a line out and a single volume control. Thats it.

However, I'd like to have multiple applications use the sound card, for example my music player, eventually some video player or flash, and some system events.

ALSA to the rescue. It's not easy to configure, but really powerful:

Mixer screenshot with MPD volume control

Yes, that is a separate volume slider in my regular mixer for MPD, my music player. Here's how to do that:

First we'll need to create a huge /etc/asound.conf:

# the real device
pcm.realdev {
        type hw
        card 0
        device 0
}
# software mixing
pcm.dmixer {
        type dmix
        ipc_key 3129397
        ipc_key_add_uid false
        ipc_perm 0666
        slave.pcm "realdev"
        slave {
                period_time 0
                period_size 1024
                buffer_size 8192
                # we're enforcing 44100, since thats what most apps use
                rate 44100
        }
        bindings {
                0 0
                1 1
        }
}
# software volume
pcm.softvol {
        type softvol
        slave.pcm "dmixer"
        control {
                name "Software"
                card 0
        }
}
pcm.mpdvol {
        type softvol
        slave.pcm "dmixer"
        control {
                name "MPD"
                card 0
        }
}
# input
pcm.input {
        type dsnoop
        ipc_key 3129398
        ipc_key_add_uid false
        ipc_perm 0660
        slave.pcm "realdev"
}
# duplex device
pcm.duplex {
        type asym
        playback.pcm "softvol"
        capture.pcm "input"
}
# default devices
pcm.!default {
        type plug
        slave.pcm "duplex"
}
pcm.dsp0 {
        type plug
        slave.pcm "duplex"
}

I won't go into all the details (I don't know all of them either), but the basic idea is that I setup the dmixer plugin for software mixing, and attach two software volume controls to it. I'm keeping the permissions to 0666, since my MPD is running as a different user, and I didn't find a way to say I'd like to have the permission set to group "audio".

The default device is the regular microphone jack (untested, since there are driver issues with my chipset and recording) and the "Software" volume control.

If you have an ~/.asoundrc you might want to move it out of the way.

Next I need to configure MPD to use its own volume control via /etc/mpd.conf:

audio_output {
        type            "alsa"
        name            "my ALSA device"
        # 'mpdvol' is the device name I used in asound.conf
        device          "mpdvol"
}

You'll probably need to restart all applications currently accessing your audio devices to have them pick up the new config. The new volume control will also only appear after you've started an application using it AFAICT. Sometimes you need to restart them twice for the new volume control to be effective. When alsa-utils restores the volume controls after reboot it should work right away.

The "Software" volume control is optional, but that way I can tune down the default applications volumes below the MPD volume if ever needed. Oh, and I think you can safely keep one or all of the software volume controls to maximum without distortion happening (this doesn't hold for all sound cards, where it's often best to keep the sliders at ~75% max to avoid distortion)

[category: /en/linux | Permalink]

Penny Stock Spam

... is rather annoying these days. Apparently this known hacker group with their powerful Windows trojans is behind the latest spam wave: they use image obfuscation that makes the average Captchas look easy.

In fact it took me a couple of seconds to understand what they're spamming about this time - the image just contained a highly unreadable stock symbol.

I wonder if the big financial web sites (for non-experts) like Google Finance, Yahoo Finance or whatever you use for occassionally checking your stock quotes couldn't just add a warning if a penny stock is being spamvertised.

Preventing naive users from falling for these frauds would certainly be a good service for their visitors, wouldn't it?

And there are already websites listing spamvertised penny stocks. So dear big-financial-websites, start protecting your customers now (and reduce the amount of spam for all of us that way, since that will hopefully make penny stocks a lot less lucrative).

[category: /en | Permalink]

Spam für Betrugs-Webseiten

Ich habe hier ja schon zuvor eine Liste von (vermutlich, ich habe gehört dass die Staatsanwaltschaft in dutzenden Fällen ermittelt) betrügerischen Webseiten in meinem Blog gepostet.

Die Liste ist gedacht zur Verwendung im "Konkurrenz-Filter" bei Google AdSense; man möchte ja seine Besucher schon irgendwo schützen. Diese Liste wurde auch dankbar aufgegriffen.

Es gibt eine verschärfte Version: eben hat sich ein Spam in meinen "Spamverdacht"-Ordner gemogelt (nicht "sicherer Spam"), der über den Umweg von "wundervoll.net" auf so eine "Lebensprognose" verweist.

Offenbar gibt es inzwischen selbst bei Betrügern Partnerprogramme...

[category: /de | Permalink]

StudiVZ offline

Ich hab mich bisher weder bei StudiVZ noch bei Facebook angemeldet, zum Glück. Meine Anmeldung bei OpenBC habe ich schon bereut - bisher nur ein paar Spam-Anrufe (Nein, ich suche derzeit keinen Job, und das steht auch auf meiner OpenBC-Seite ziemlich deutlich), so dass ich inzwischen meine Telefonnummer (die ja eigentlich nicht angezeigt werden sollte) wieder entfernt habe. Seither ist wieder Ruhe im Karton.

Tja, jetzt hat es mal StudiVZ erwischt. Bisher waren sie mir nur durch eine recht aggressive Marketing-Kampagne an die Fachschaften oder so etwas aufgefallen. Aber so wie es aussieht haben sie ernsthafte Probleme die Daten vertraulich zu halten. Natürlich interessant für Spammer, Phischer und sonstige Online-Ganoven, so ein Datenbestand wie StudiVZ.

Meine habe ich ihnen nicht gegeben. Wieso auch, wo ist der Mehrwert?

[category: /de | Permalink]
Menu
[planet.debian]
[planet.xmlhack]
[planet SELinux]
[munichblogs]
[email]
[RSS 2 feed]
[English RSS 2]
Categories
< December 2006 >
SuMoTuWeThFrSa
      1 2
3 4 5 6 7 8 9
10111213141516
17181920212223
24252627282930
31      
Archives
2010-Mar
2010-Feb
2010-Jan
2009-Dec
2009-Nov
2009-Oct
2009-Sep
2009-Aug
2009-Jul
2009-Jun
2009-May
2009-Apr
2009-Mar
2009-Feb
2009-Jan
2008-Dec
2008-Nov
2008-Oct
2008-Sep
2008-Aug
2008-Jul
2008-May
2008-Apr
2008-Mar
2008-Feb
2008-Jan
2007-Dec
2007-Nov
2007-Oct
2007-Sep
2007-Aug
2007-Jul
2007-Jun
2007-May
2007-Apr
2007-Mar
2007-Feb
2007-Jan
2006-Dec
2006-Nov
2006-Oct
2006-Sep
2006-Aug
2006-Jul
2006-Jun
2006-May
2006-Apr
2006-Mar
2006-Feb
2006-Jan
2005-Dec
2005-Nov
2005-Oct
2005-Sep
2005-Aug
2005-Jul
2005-Jun
2005-May
2005-Apr
2005-Mar
2005-Feb
2005-Jan
2004-Dec
2004-Nov
2004-Oct
2004-Sep
2004-Aug
2004-Jul
Other links:
Swing and the City - Lindy Hop in Munich