FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 08-13-2012, 06:42 AM
José Luis Segura Lucas
 
Default Testing ALSA and writing an appropriate .asoundrc

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?

Best regards and thanks in advance

[1] $lspci | grep -i audio
00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition
Audio Controller (rev 02)
02:00.1 Audio device: NVIDIA Corporation High Definition Audio
Controller (rev a1)

--
José Luis Segura Lucas
 
Old 08-13-2012, 01:04 PM
Celejar
 
Default Testing ALSA and writing an appropriate .asoundrc

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.]

> Best regards and thanks in advance
>
> [1] $lspci | grep -i audio
> 00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition
> Audio Controller (rev 02)
> 02:00.1 Audio device: NVIDIA Corporation High Definition Audio
> Controller (rev a1)

As above, lspci is less useful here than the aplay list commands.

Celejar


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120813090404.657326f0.celejar@gmail.com">http://lists.debian.org/20120813090404.657326f0.celejar@gmail.com
 
Old 08-13-2012, 05:13 PM
Andrei POPESCU
 
Default Testing ALSA and writing an appropriate .asoundrc

On Lu, 13 aug 12, 08:42:20, José Luis Segura Lucas wrote:
>
> 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.

Another way is to force one card to a lower index than the other. See
/etc/modprobe.d/alsa-base.conf to get an idea.

Kind regards,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
 
Old 08-14-2012, 04:43 PM
Doug
 
Default 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


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 502A802A.4090909@optonline.net">http://lists.debian.org/502A802A.4090909@optonline.net
 
Old 08-15-2012, 09:31 AM
Curt
 
Default Testing ALSA and writing an appropriate .asoundrc

On 2012-08-13, Andrei POPESCU <andreimpopescu@gmail.com> wrote:

>> 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.
>
> Another way is to force one card to a lower index than the other. See=20
> /etc/modprobe.d/alsa-base.conf to get an idea.

I had a problem similar to the OP's (I think I did, anyway--hdmi + sound card).

I have the following in my ~.asoundrc (the OP didn't tell us what he put in
his, did he?):

pcm.!default {
type hw
card 1
}

ctl.!default {
type hw
card 1
}

hdmi being card 0.

Your suggestion seems more like the "canonical" way to do things, though
on a multi-user system ...


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: slrnk2mr51.2m2.curty@einstein.electron.org">http://lists.debian.org/slrnk2mr51.2m2.curty@einstein.electron.org
 
Old 08-15-2012, 10:10 PM
Rob Owens
 
Default Testing ALSA and writing an appropriate .asoundrc

On Mon, Aug 13, 2012 at 08:42:20AM +0200, José Luis Segura Lucas 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]).
>
I went through this a while back. See
http://lists.debian.org/debian-user/2011/12/msg00575.html

-Rob


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120815221023.GA27533@aurora.owens.net">http://lists.debian.org/20120815221023.GA27533@aurora.owens.net
 
Old 08-16-2012, 10:04 AM
José Luis Segura Lucas
 
Default Testing ALSA and writing an appropriate .asoundrc

I think that it is another problem. I can send the sound thourgh the
HDMI cable using Smplayer without any problem. The only thing I do is,
on the preference screen, General section, Audio tab, output driver alsa
hdmi 1.7 (ore something like that, I needed to test with each one I saw
on this menu).

Hope it will help you

El 14/08/12 18:43, Doug escribió:
> 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
>
>


--
José Luis Segura Lucas
 
Old 08-19-2012, 04:58 PM
José Luis Segura Lucas
 
Default Testing ALSA and writing an appropriate .asoundrc

El 13/08/12 15:04, Celejar escribió:


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.]


As above, lspci is less useful here than the aplay list commands.

Celejar




Hi!



After some testing and retrieving the output of aplay -l and aplay
-L, I get a functional configuration. My .asoundrc (if somebody
needs it in the future):






pcm.!default {

* type plug

* slave.pcm "hdmi"

}



ctl.!default {

* type hw

* card 1

}



pcm.!hdmi {

* type hw

* card 1

* device 7

}



ctl.!hdmi {

* type hw

* card 1

* device 7

}


--
José Luis Segura Lucas
 

Thread Tools




All times are GMT. The time now is 10:38 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org