Difference between revisions of "Virtual ALSA"

From WA2IAC Wiki
Jump to: navigation, search
(Created page with "= Page Objective = This page contains information about emulating ALSA in OpenVZ and/or KVM. There is no consideration given for the case of connecting to the hardware audio. ...")
 
m (ALSA on Virtual Box)
 
Line 3: Line 3:
  
 
Note that I have a preference for OpenVZ over KVM when it can be used... because it's easier to use. So, this page will tend to focus on OpenVZ solutions.
 
Note that I have a preference for OpenVZ over KVM when it can be used... because it's easier to use. So, this page will tend to focus on OpenVZ solutions.
 +
 +
== Assessment ==
 +
https://github.com/silkentrance/openvz-openvz-2.6.32/blob/master/Documentation/sound/alsa/HD-Audio.txt
 +
<pre>
 +
alsa-info
 +
~~~~~~~~~
 +
The script `alsa-info.sh` is a very useful tool to gather the audio
 +
device information. You can fetch the latest version from:
 +
 +
- http://www.alsa-project.org/alsa-info.sh
 +
 +
Run this script as root, and it will gather the important information
 +
such as the module lists, module parameters, proc file contents
 +
including the codec proc files, mixer outputs and the control
 +
elements. As default, it will store the information onto a web server
 +
on alsa-project.org. But, if you send a bug report, it'd be better to
 +
run with `--no-upload` option, and attach the generated file.
 +
</pre>
 +
 +
== ALSA Dummy Driver ==
 +
 +
* The Official ALSA Wiki Article on the snd_dummy driver: http://www.alsa-project.org/main/index.php/Matrix:Module-dummy
 +
 +
There are two ways of getting Linux drivers to work, you can either compile them into the kernel or build them separately as modules. Read the Kernel-HOWTO http://www.tldp.org/ for details of how to compile a kernel.
 +
 +
You must turn on the sound support soundcore module. This is in the kernel. Look in the sound drivers directory and it should be the first option. Most people enable the module setting. That way you can load and unload the module manually if you have multiple soundcards/​devices or if you intend to debug or use cutting edge software which may cause your drivers to halt sometimes. Of course it also means you have more control of your system.
 +
 +
Most modern distros come with soundcore compiled as a module. You can check this in numerous ways. The easiest way is to type:
 +
 +
<pre>
 +
modinfo soundcore
 +
</pre>
 +
 +
Problem: debian VM doesn't have it. Document load procedure.
 +
 +
Additional problem: even if it's there, third party VPS vendors don't place the support files necessary to see it on their boxen (example: creek).
 +
 +
As a reference, Virtual Box doesn't do that, and so may provide a model in some respects:
 +
 +
<pre>
 +
VBX:~$ modinfo soundcore
 +
filename:      /lib/modules/3.2.0-55-generic/kernel/sound/soundcore.ko
 +
alias:          char-major-14-*
 +
license:        GPL
 +
author:        Alan Cox
 +
description:    Core sound module
 +
srcversion:    4DECB476393C345C541D37D
 +
depends:       
 +
intree:        Y
 +
vermagic:      3.2.0-55-generic SMP mod_unload modversions 686
 +
parm:          preclaim_oss:int
 +
</pre>
 +
 +
* See also: http://superuser.com/questions/344760/how-to-create-a-dummy-sound-card-device-in-linux-server
 +
 +
If this command returns that you have this module, then you don't need to recompile your kernel.
 +
 +
In VBX the module loads no problem:
 +
<pre>
 +
# modprobe snd-dummy        (note hyphen, not underscore!)
 +
#
 +
</pre>
  
 
== ALSA on OpenVZ ==
 
== ALSA on OpenVZ ==
 
The best article I've found to-date is cached here from http://myatus.com/p/x-server-with-sound-inside-an-openvz-proxmox-container/ circa 12/5/2013.
 
The best article I've found to-date is cached here from http://myatus.com/p/x-server-with-sound-inside-an-openvz-proxmox-container/ circa 12/5/2013.
 +
=== Notes on .114 Debian Slice ===
 +
 +
Troubleshooting. Not to where snd_dummy can be installed yet.
 +
http://ubuntuforums.org/showthread.php?t=205449
 +
 +
* aplay -l    - checks for 'soundcard'
 +
* lspci -v    - checks the hardware (useless in this case)
 +
* modprobe snd-
 +
 +
<pre>
 +
# modprobe snd-
 +
WARNING: Deprecated config file /etc/modprobe.conf, all config files belong into /etc/modprobe.d/.
 +
FATAL: Module snd_ not found.
 +
# cd /etc
 +
deb6:/etc# ls modprobe.conf
 +
modprobe.conf
 +
deb6:/etc# ls modprobe.d
 +
aliases.conf              alsa-base.conf  fbdev-blacklist.conf
 +
alsa-base-blacklist.conf  blacklist.conf  linux-sound-base_noOSS.conf
 +
deb6:/etc# mv modprobe.
 +
sudo apt-get --purge remove linux-sound-base alsa-base alsa-utils
 +
sudo apt-get install linux-sound-base alsa-base alsa-utils
 +
</pre>
 +
 +
Had to add packages:
 +
* alsa-utils
 +
* snd    (was: soundcore on other distros)
  
 
=== Preparing the host node ===
 
=== Preparing the host node ===
Line 79: Line 168:
 
adduser skype audio
 
adduser skype audio
 
</pre>
 
</pre>
 +
 +
== ALSA on KVM ==
 +
 +
=== Links ===
 +
http://www.linux-kvm.com/content/sound-problem-solved
 +
 +
== ALSA on CentOS VM Host Rack Box ==
 +
 +
ALSA picks up the hardware on the base OS of this OpenVZ server.
 +
 +
Working out the process/problems to get the OpenVZ to work properly in progress. Updated OS & Kernel 2/25/2014.
 +
 +
== ALSA on Virtual Box ==
 +
It just works, but only the way it wants to. The Null device seems to have been loaded by default (Xubuntu 12.04).
 +
 +
=== Links ===
 +
 +
http://www.withoutthesarcasm.com/fixing-audio-in-linux-guests-virtualbox/
 +
 +
== More How-To ==
 +
 +
For post "install" (and debug) open the following doc, and scroll down to (or search for) "Using alsamixer"
 +
 +
http://ubuntuforums.org/showthread.php?t=205449
 +
 +
= My Favorite Packages =
 +
 +
Tower load - moved to notes.

Latest revision as of 17:05, 26 February 2014