[Nix-dev] Audio on nixos - small HOWTO

Tony White tonywhite100 at googlemail.com
Mon Sep 21 18:28:07 CEST 2009


2009/9/21 Marc Weber <marco-oweber at gmx.de>:
> So finally everything seems to work..
>
> On the one hand you had just alsa. Alsa is the lowest (kernel) layer to
> talk to hardware.
>
> On top of that you usually run a daemon such as
>
> a) pulseaudio
> b) jackd
> c) esd     (use pulseaudio instead)
> d) artsd   (use pulseaudio instead ?)
> e) ...
>
> So howto set it up?
>
> jackd:
>
> Run the servers like this:
>
> jackaudio server:
>    jackd -d alsa
>    jackd -d pulseaudio  (*)
>
>  (*) make it output via pulseaudio, eg use this if you want to run both.
>  There are other ways as well eg using alsa mixer plugins or such..
>
>
> pulseaudio:
>    Just run pulseaudio as normal user.
>
>
>
>
>
> Now what can you do?
>  pulseaudio:
>  Use pavucontrol to adjust loudness of each application individually
>  pulseaudio also can send music over network AFAIK (I haven't tried
>  this yet)
>
>  jackd:
>    connect arbirtary input/output sources and pipe them through various
>    filters (to be comitted to nixpkgs)
>
>    Use qjackctl to change those connections
>    Eg ardour only talks to jack
>
>
>
>
> Howto make apps talk to those daemons which don't have native support?
> a) There are oss wrappers for both.
>
> b) (easiest way?): Use alsa tools and create a virtual device which will
>    connect to those daemons:
>
>    use a .asoundrc such as [1]
>
>    nix-env -iA alsaPlugins
>    export ALSA_PLUGIN_DIRS=~/.nix-profile/lib/alsa-lib
>
>    Then just ask your application to talk to the alsa device.
>    Example:
>    mplayer -ao alsa:device=pulse  or device = jack
>
>    mplayer has a native output dirver for pulse, jack though.
>
>
> So finally I can control my sound the way I like on nixos.
>
>
> Instead of exporting ALSA_PLUGIN_DIRS you can also install the
> alsaPluginWrapper script which adds this env var for you.
> Then you can run ap23 skype on a amd64 system
> connecting skype to pulseaudio :-)
>
> However to use this you have to remove the jackaudio support else Skype
> will crash (?). But forwarding sound to pulseaudio only works using
> Skype.
>
> Anyway: Enjoy!
>
> Marc Weber
>
> ==========================================================
>
> .asoundrc example [1]
>
> pcm.pulse {
>    type pulse
> }
>
> ctl.pulse {
>    type pulse
> }
>
>
> pcm.jack {
>    type jack
>    playback_ports {
>        0 alsa_pcm:playback_1
>        1 alsa_pcm:playback_2
>    }
>    capture_ports {
>        0 alsa_pcm:capture_1
>        1 alsa_pcm:capture_2
>    }
> }
> _______________________________________________
> nix-dev mailing list
> nix-dev at cs.uu.nl
> https://mail.cs.uu.nl/mailman/listinfo/nix-dev
>

Hi Marc,
Did you manage to get qjackcontrol to work for you?
It's the best way to control jack in kde and the last time I tried it,
it didn't work (I forget the error.)
Were you able to set pulseaudio as the default output device for kde?
Or do you not run kde?
The sound difference between raw alsa output and passing audio through
the pulseaudio sound server is big here but I'm running debian until I
can get some better hardware to apply NixOs to.. I think it would be
great to have pulseaudio as a default sound output in both kde and
gnome in NixOs because it makes such a big difference to the sound
output quality.
There probably will be people that disagree because pulseaudio doesn't
work for them but it works great for the majority.
Do you think that using pulseaudio by default in kde 4 would be bad,
good, impossible?

Thanks,
Tony



More information about the nix-dev mailing list