Showing posts with label Audio. Show all posts
Showing posts with label Audio. Show all posts

Wednesday, January 26, 2011

One on Pulseaudio

Well, what if there are several sound cards? In my case I have two sound cards. The thing is up until now I was only using one of then (the other one was blacklisted in /etc/modprobe.d/blacklist. But now I wanted to use it and I managed to make both of them work, supposedly in the way I like: one of them as the default output card, and the other one for recording. But, since the one I now use for recording is the one I used to use for playback, some applications doesn't seem to have been aware of the change (e.g. flashplugin, vlc, amarok (this one needed a restart). Why?
I use KDE4 (Kubuntu) and I've the 'right' configuration chosen in 'System Configuration'-> 'Multimedia'. But somehow still that doesn't seem to work ...well, it doesn't.

At least in my case it was an, to me, odd Pulseaudio issue. The solution or workaround for me was quite simple:
1. create, if it doesn't already exist, a $HOME/.pulse/default.pa file and put a content like:

alsa_input.pci-0000_01_0b.0.analog-stereo

where you have to put your correctly identified sound card.
2. How to identify the sound card? Well you have at least to know how many you have and, from the ones available, which you want to use for playback purposes. That you can do with the command: lspci -v. In my case I get:

~$ lspci -v|grep -i audio
00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 01)
01:02.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 07)

which would translate to ether:

alsa_input.pci-0000_01_02.0.analog-stereo

in the case of the SB Live! card, or
alsa_input.pci-0000_01_0b.0.analog-stereo

for the Intel sound card.
3. restart pulse (well, if it's not configured to run as a system-wide sound server, just kill the current instance):

$ puslseaudio -k


Try now www.youtube.com with Firefox or GoogleChrome! (maybe restart you browser, of course)

Wednesday, November 10, 2010

Real time audio and Ubuntu Studio

I've have been trying to work with the Linux audio recording and editing software for some time now, but it's not been quite a very satisfying experience. One of the problems I had and wasn't able to solve was the real time kernel issue: the soundserver jackd needs for some things to work properly, to run on a real time enabled kernel. And the thing is I couldn't find the right information in the internet to help me out with this (in fact it's surprisingly easy).

So recently I read about Ubuntu Studio, a Linux distro based obviously on Ubuntu which focuses mostly on audio and video recording and editing stuff. And I read about the kind of tuned kernel the distro was shipped with... and I decided to give a try.
I download the latest one (10.10) and, though it's not a live distro, which I didn't expect and I thing it's a pity that you can't try it without installing it, I nevertheless had a spendable partition on which I could install it. It's a pretty normal Debian installer, quite straight forward, and … congratulations to the Ubuntu Studio guys, they've done a great job! There's lots of interesting software, some of which I never heard (or read) of before.
The point of all this is actually, you don't have to really install a Ubuntu Studio if you already have an Ubuntu (or any other Linux installed) and you don't want to have more than one distro. Just install it to a virtual image (maybe there are already some virtual images available out there), try the software they ship with it, and copy their configuration settings.
And, as for what was my original problem, the real time linux kernel, just put the appended file (the Ubuntu Studio guys named it audio.conf) into /etc/security/limits.d (if the directory limits.d doesn't already exist, just create it), and put this lines into it:
# Provided by the jackd package.
#
# Changes to this file will be preserved.
#
# If you want to enable/disable realtime permissions, run
#
# dpkg-reconfigure -p high jackd
@audio - rtprio 95
@audio - memlock unlimited
#@audio - nice -19

and, of course, check that your user (the user you start the audio programs with) belongs to the 'audo' group.

Actually, it' easier than that: on a debian-like system, if jackd is already installed, and as the previous audio.conf file suggests, just execute:
dpkg-reconfigure -p high jackd
Or choose 'yes' in a fresh jackd install.

Another possibility is, if you already have a Ubuntu up and running, install the Ubuntu Studio related packages and you don't need the whole new Ubuntu Studio distro.