All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem opening default device in haswell system using aplay
@ 2013-05-22 15:48 Stefano Panella
  2013-05-24  2:18 ` Raymond Yau
  2013-05-27  7:07 ` Takashi Iwai
  0 siblings, 2 replies; 5+ messages in thread
From: Stefano Panella @ 2013-05-22 15:48 UTC (permalink / raw)
  To: alsa-devel

Hi everyone,

sorry if this email has been sent twice... ( I sent it once before subscribing)

I am working on some haswell systems running Ubuntu 12.04 and I have a problem if I run aplay -D sysdefault.

when I do:

cat /proc/asound/pcm

I get:

00-03: HDMI 0 : HDMI 0 : playback 1
00-07: HDMI 1 : HDMI 1 : playback 1
00-08: HDMI 2 : HDMI 2 : playback 1
01-00: ALC662 rev3 Analog : ALC662 rev3 Analog : playback 1 : capture 1
01-02: ALC662 rev3 Analog : ALC662 rev3 Analog : capture 1

If I do:

aplay -L | grep sysdefault

I get:

sysdefault:CARD=PCH

where PCH is card number 1 (id = 1)

on most of my systems (non haswell laptops) the default card is number 0

If I run

aplay -D sysdefault

I get:

ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
aplay: main:682: audio open error: No such file or directory

if I strace it I get:

open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No
such file or directory)

If I run:

aplay -D hw:PCH,0

all works fine...

Any idea why hw:PCH,0 works and sysdefault does not?

I guess there could be a problem in the mapping of devices in hw systems?

Has anybody else observed a similar issue? Or has this been a problem in
the past already fixed upstream?
If so, where was it fixed (kernel, lib, tools, utils, etc.) ?

Thanks for all your help on this.

In case this is a real problem I am willing to help debugging it and
submit patches.

Stefano

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem opening default device in haswell system using aplay
  2013-05-22 15:48 Problem opening default device in haswell system using aplay Stefano Panella
@ 2013-05-24  2:18 ` Raymond Yau
  2013-05-24 22:50   ` Stefano Panella
  2013-05-27  7:07 ` Takashi Iwai
  1 sibling, 1 reply; 5+ messages in thread
From: Raymond Yau @ 2013-05-24  2:18 UTC (permalink / raw)
  To: Stefano Panella; +Cc: alsa-devel

>
> I am working on some haswell systems running Ubuntu 12.04 and I have a
problem if I run aplay -D sysdefault.
>
> when I do:
>
> cat /proc/asound/pcm
>
> I get:
>
> 00-03: HDMI 0 : HDMI 0 : playback 1
> 00-07: HDMI 1 : HDMI 1 : playback 1
> 00-08: HDMI 2 : HDMI 2 : playback 1
> 01-00: ALC662 rev3 Analog : ALC662 rev3 Analog : playback 1 : capture 1
> 01-02: ALC662 rev3 Analog : ALC662 rev3 Analog : capture 1
>
> If I do:
>
> aplay -L | grep sysdefault
>
> I get:
>
> sysdefault:CARD=PCH
>
> where PCH is card number 1 (id = 1)
>
> on most of my systems (non haswell laptops) the default card is number 0
>
> If I run
>
> aplay -D sysdefault
>
> I get:
>
> ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
> aplay: main:682: audio open error: No such file or directory
>
> if I strace it I get:
>
> open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No
> such file or directory)

defaults.pcm.dmix.device defaults.pcm.device

You have to change defaults.pcm.dmix.device to the device of  your hdmi if
your are not using the analog device 0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem opening default device in haswell system using aplay
  2013-05-24  2:18 ` Raymond Yau
@ 2013-05-24 22:50   ` Stefano Panella
  0 siblings, 0 replies; 5+ messages in thread
From: Stefano Panella @ 2013-05-24 22:50 UTC (permalink / raw)
  To: Raymond Yau; +Cc: alsa-devel

On 05/24/2013 03:18 AM, Raymond Yau wrote:
>
> >
> > I am working on some haswell systems running Ubuntu 12.04 and I have 
> a problem if I run aplay -D sysdefault.
> >
> > when I do:
> >
> > cat /proc/asound/pcm
> >
> > I get:
> >
> > 00-03: HDMI 0 : HDMI 0 : playback 1
> > 00-07: HDMI 1 : HDMI 1 : playback 1
> > 00-08: HDMI 2 : HDMI 2 : playback 1
> > 01-00: ALC662 rev3 Analog : ALC662 rev3 Analog : playback 1 : capture 1
> > 01-02: ALC662 rev3 Analog : ALC662 rev3 Analog : capture 1
> >
> > If I do:
> >
> > aplay -L | grep sysdefault
> >
> > I get:
> >
> > sysdefault:CARD=PCH
> >
> > where PCH is card number 1 (id = 1)
> >
> > on most of my systems (non haswell laptops) the default card is number 0
> >
> > If I run
> >
> > aplay -D sysdefault
> >
> > I get:
> >
> > ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
> > aplay: main:682: audio open error: No such file or directory
> >
> > if I strace it I get:
> >
> > open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No
> > such file or directory)
>
> defaults.pcm.dmix.device defaults.pcm.device
>
> You have to change defaults.pcm.dmix.device to the device of your hdmi 
> if your are not using the analog device 0
>
The problem I have is that the analog device is on card 1 as cat 
/proc/asound/pcm is showing:

 > 00-03: HDMI 0 : HDMI 0 : playback 1
 > 00-07: HDMI 1 : HDMI 1 : playback 1
 > 00-08: HDMI 2 : HDMI 2 : playback 1
 > 01-00: ALC662 rev3 Analog : ALC662 rev3 Analog : playback 1 : capture 1
 > 01-02: ALC662 rev3 Analog : ALC662 rev3 Analog : capture 1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem opening default device in haswell system using aplay
  2013-05-22 15:48 Problem opening default device in haswell system using aplay Stefano Panella
  2013-05-24  2:18 ` Raymond Yau
@ 2013-05-27  7:07 ` Takashi Iwai
  2013-05-28  9:26   ` Stefano Panella
  1 sibling, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2013-05-27  7:07 UTC (permalink / raw)
  To: Stefano Panella; +Cc: alsa-devel

At Wed, 22 May 2013 16:48:58 +0100,
Stefano Panella wrote:
> 
> Hi everyone,
> 
> sorry if this email has been sent twice... ( I sent it once before subscribing)
> 
> I am working on some haswell systems running Ubuntu 12.04 and I have a problem if I run aplay -D sysdefault.
> 
> when I do:
> 
> cat /proc/asound/pcm
> 
> I get:
> 
> 00-03: HDMI 0 : HDMI 0 : playback 1
> 00-07: HDMI 1 : HDMI 1 : playback 1
> 00-08: HDMI 2 : HDMI 2 : playback 1
> 01-00: ALC662 rev3 Analog : ALC662 rev3 Analog : playback 1 : capture 1
> 01-02: ALC662 rev3 Analog : ALC662 rev3 Analog : capture 1
> 
> If I do:
> 
> aplay -L | grep sysdefault
> 
> I get:
> 
> sysdefault:CARD=PCH
> 
> where PCH is card number 1 (id = 1)
> 
> on most of my systems (non haswell laptops) the default card is number 0
> 
> If I run
> 
> aplay -D sysdefault
> 
> I get:
> 
> ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
> aplay: main:682: audio open error: No such file or directory

It's because the card 0 contains only HDMI.  The sysdefault in
HDA-Intel.conf is configured for the analog I/O.


Takashi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem opening default device in haswell system using aplay
  2013-05-27  7:07 ` Takashi Iwai
@ 2013-05-28  9:26   ` Stefano Panella
  0 siblings, 0 replies; 5+ messages in thread
From: Stefano Panella @ 2013-05-28  9:26 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On 05/27/2013 08:07 AM, Takashi Iwai wrote:
> At Wed, 22 May 2013 16:48:58 +0100,
> Stefano Panella wrote:
>> Hi everyone,
>>
>> sorry if this email has been sent twice... ( I sent it once before subscribing)
>>
>> I am working on some haswell systems running Ubuntu 12.04 and I have a problem if I run aplay -D sysdefault.
>>
>> when I do:
>>
>> cat /proc/asound/pcm
>>
>> I get:
>>
>> 00-03: HDMI 0 : HDMI 0 : playback 1
>> 00-07: HDMI 1 : HDMI 1 : playback 1
>> 00-08: HDMI 2 : HDMI 2 : playback 1
>> 01-00: ALC662 rev3 Analog : ALC662 rev3 Analog : playback 1 : capture 1
>> 01-02: ALC662 rev3 Analog : ALC662 rev3 Analog : capture 1
>>
>> If I do:
>>
>> aplay -L | grep sysdefault
>>
>> I get:
>>
>> sysdefault:CARD=PCH
>>
>> where PCH is card number 1 (id = 1)
>>
>> on most of my systems (non haswell laptops) the default card is number 0
>>
>> If I run
>>
>> aplay -D sysdefault
>>
>> I get:
>>
>> ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
>> aplay: main:682: audio open error: No such file or directory
> It's because the card 0 contains only HDMI.  The sysdefault in
> HDA-Intel.conf is configured for the analog I/O.
Thanks for answering, what I do not get is what the default 
configuration is on a freshly installed system (no custom configurations):

- for example, can I assume hw:0,0 is always there and is the default? 
(apparently not on these haswell machine)
- if I run aplay -D sysdefault is it expected to work?
- is there any ALSA_CARD variable configured somewhere or is it just 
supposed to be 0?
- how do I know what is it the default card/pcm?

The reasons I am asking these questions is I need to write some SW which 
will be able to open the default analog playback device and on haswell 
system I did not find any way to do that apart from using:

aplay -L | grep sysdefault

which will return <CARD> = PCH or Intel or MID etc.. and than I open 
hw:<CARD>,0 from the C code.

I would like to understand if I can poerform some more tests to 
understand if this is a genuine problem on haswell systems or if I am 
just making some wrong assumptions or incorrect use of the cmd_line/API.

Thanks again for helping me on this.
>
> Takashi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-28  9:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-22 15:48 Problem opening default device in haswell system using aplay Stefano Panella
2013-05-24  2:18 ` Raymond Yau
2013-05-24 22:50   ` Stefano Panella
2013-05-27  7:07 ` Takashi Iwai
2013-05-28  9:26   ` Stefano Panella

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.