[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Testing ALSA and writing an appropriate .asoundrc



On 08/13/2012 09:04 AM, Celejar wrote:
On Mon, 13 Aug 2012 08:42:20 +0200
José Luis Segura Lucas <josel.segura@gmx.es> wrote:

Hi all!

I have a little mess up with ALSA on one of my computers.

The computer has two sound cards: one of them, an integrated Intel
(lspci related output in [1]) and a audio device from Nvidia, for using
with an HDMI video and audio cable (see [1]).

Both cards are supported (the Nvidia one, through the proprietary Nvidia
driver, I suppose). I can put sound on both using a program that allows
selecting the audio output (I'm currently using Smplayer, a Mplayer
front-end).

My problems began when I tried to make the HDMI sound output (the nvidia
card) as the default for the whole system. I tried with Pulseaudio, but
configuring it from Gnome brokes my gnome session and I have uninstalled
whole Pulseaudio stuff.

I know that you can select the default sound output using a ~/.asoundrc
file, and I already tried, but I can't get it properly working.

How can I check with aplay/speaker-test ALSA tools the right syntax for
both cards? How can I make the HDMI one the default for my whole system?
Use 'aplay -l' / 'aplay -L' to find the names of your cards. On my system:

~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: AD198x Analog [AD198x Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: AD198x Digital [AD198x Digital]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
card 1: Device [USB Sound Device], device 0: USB Audio [USB Audio]
   Subdevices: 0/1
   Subdevice #0: subdevice #0

So 'Intel' is one (the builtin Intel sound card), and 'Device' is
another (it happens to be the C-Media USB sound device currently
attached).

My .asoundrc contains:

pcm.builtin { type hw; card Intel; }
ctl.builtin { type hw; card Intel; }

pcm.usb { type hw; card Device; }
ctl.usb { type hw; card Device; }

pcm.!default pcm.usb
ctl.!default ctl.usb

Explanation (AFA my limited understanding goes):

The pcm.xxxx and ctl.xxxx lines define cards - the former for the audio
output interface, and the latter for the control (mixer) interface.

So I have defined two logical cards (each with an audio interface and
mixer interface), one for the 'Intel' card, and one for the
'Device' (USB) card.

The 'pcm.!default' lines tell the audio subsystem which cards to use
for the audio output and the mixer [and these defaults are independent
- you can have situations where the sound is going out by default
through one card, but the mixer is defaulting to a different card -
headache ;)].

So I currently have the system defaulting to the USB device. When I
don't want it, I just comment out the last two lines. [There's
doubtless some 'correct' way to automate this via udev or suchlike, but
I haven't bothered.]
I have Smplayer installed, as well as Smplayer-themes. I'm running PCLOS with KDE, and there is no line in the menu for Smplayer or Smplayer-themes--whatever they are. I have built-in Intel sound, and an NVidia GeForce video/audio card with video and HDMI ouptuts. Using Alsa. I would like to have both sound outputs come out their respective channels at all times, so that if I want to watch a movie, I can switch the TV to HDMI-1 and have both picture and sound there, while still having it on the computer video and audio outputs at the same time. (I know that the HDMI will do picture and sound, as it works in XP, altho XP does not provide sound at the computer with this connection.)
Suggestions greatly appreciated!  Thanx--doug


Reply to: