public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] alsa: missing default device
@ 2014-09-20 13:18 Frank Steinmetzger
  2014-09-21  0:49 ` Walter Dnes
  0 siblings, 1 reply; 7+ messages in thread
From: Frank Steinmetzger @ 2014-09-20 13:18 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1939 bytes --]

Hello esteemed readers

After four years in the making, I finally built a new machine. \o/ It's an
H97-based board with an ALC892 audio chip. The necessities work, but I'm
having problems with the out-of-the-box audio setup. After fixing the card
order (analog->HDMI, instead of HDMI->analog) I found another problem:
except for KDE, which has its own sound system, all other audio-related
programs do not work kcmus, aplay, mplayer, etc). For example:

$ play some_file
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.0.27.2/work/alsa-lib-1.0.27.2/src/pcm/pcm.c:2109:(snd_pcm_open_conf) type is not defined
play FAIL formats: can't open output file `default': snd_pcm_open error: No such file or directory

So I'm missing the "default" device. Sure enough:
$ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=PCH
    HDA Intel PCH, ALC892 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    Front speakers
[... and some more surround channels plus HDMI]

It only lists "sysdefault", but not "default". If I do
$ speaker-test -Dsysdefault -c2
I get the test noise on both speakers. /usr/share/alsa/alsa.conf defines both:
--------->%---------------
# redirect to load-on-demand extended pcm definitions
pcm.cards cards.pcm

pcm.default cards.pcm.default
pcm.sysdefault cards.pcm.default
---------%<---------------
But why only one shows up, I am at a loss.


Could you help me out here please? What is wrong? How can I better debug it?
Thanks.

-- 
Gruß | Greetings | Qapla’
Ich möchte nicht, daß irgendetwas von mir oder über mich auf Facebook landet.
Please do not share anything from, with or about me with any Facebook service.

“If it’s true that our species is alone in the universe, then I’d have to say
the universe aimed rather low and settled for very little.” – George Carlin

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [gentoo-user] alsa: missing default device
  2014-09-20 13:18 [gentoo-user] alsa: missing default device Frank Steinmetzger
@ 2014-09-21  0:49 ` Walter Dnes
  2014-09-22 15:49   ` Frank Steinmetzger
  0 siblings, 1 reply; 7+ messages in thread
From: Walter Dnes @ 2014-09-21  0:49 UTC (permalink / raw
  To: gentoo-user

> So I'm missing the "default" device. Sure enough:
> $ aplay -L
> null
>     Discard all samples (playback) or generate zero samples (capture)
> sysdefault:CARD=PCH
>     HDA Intel PCH, ALC892 Analog
>     Default Audio Device
> front:CARD=PCH,DEV=0
>     HDA Intel PCH, ALC892 Analog
>     Front speakers
> [... and some more surround channels plus HDMI]
> 
> It only lists "sysdefault", but not "default". If I do
> $ speaker-test -Dsysdefault -c2
> I get the test noise on both speakers. /usr/share/alsa/alsa.conf defines both:

  Here's what I get on a working system...

[d531][waltdnes][~] aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=Intel
    HDA Intel, ALC888 Analog
    Default Audio Device
sysdefault:CARD=Intel
    HDA Intel, ALC888 Analog
    Default Audio Device
front:CARD=Intel,DEV=0
    HDA Intel, ALC888 Analog
    Front speakers

...plus a bunch of others.  Here's what I have in "make menuconfig" under

> Device Drivers > Sound card support > Advanced Linux Sound Architecture

|    --- Advanced Linux Sound Architecture
|    <*>   Sequencer support
|    < >     Sequencer dummy client
|    <*>   OSS Mixer API
|    < >   OSS PCM (digital audio) API
|    [*]   OSS Sequencer API
|    <*>   HR-timer backend support
|    [*]     Use HR-timer as default sequencer timer
|    [*]   Dynamic device file minor numbers
|    (4)     Max number of sound cards
|    [ ]   Support old ALSA API
|    [*]   Verbose procfs contents
|    [ ]   Verbose printk
|    [ ]   Debug
|    [ ]   Generic sound devices  ----
|    [*]   PCI sound devices  --->
|    [ ]   USB sound devices  ----
|    < >   ALSA for SoC audio support  ----

Under "PCI sound devices  --->" I have...
|    <*>   Intel HD Audio  --->

Under "Intel HD Audio  --->" I have...

|    --- Intel HD Audio
|    (64)  Pre-allocated buffer size for HD-audio driver
|    [ ]   Build hwdep interface for HD-audio driver
|    [ ]   Support digital beep via input layer
|    [ ]   Support jack plugging notification via input layer
|    [ ]   Support initialization patch loading for HD-audio
|    [*]   Build Realtek HD-audio codec support
|    [ ]   Build Analog Device HD-audio codec support
|    [ ]   Build IDT/Sigmatel HD-audio codec support
|    [ ]   Build VIA HD-audio codec support
|    [ ]   Build HDMI/DisplayPort HD-audio codec support
|    [ ]   Build Cirrus Logic codec support
|    [ ]   Build Conexant HD-audio codec support
|    [ ]   Build Creative CA0110-IBG codec support
|    [ ]   Build Creative CA0132 codec support
|    [ ]   Build C-Media HD-audio codec support
|    [ ]   Build Silicon Labs 3054 HD-modem codec support
|    -*-   Enable generic HD-audio codec parser
|    (0)   Default time-out for HD-audio power-save mode

  I haven't bothered with HDMI on this machine.  Does yours look similar?

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


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

* Re: [gentoo-user] alsa: missing default device
  2014-09-21  0:49 ` Walter Dnes
@ 2014-09-22 15:49   ` Frank Steinmetzger
  2014-09-22 23:22     ` Walter Dnes
  0 siblings, 1 reply; 7+ messages in thread
From: Frank Steinmetzger @ 2014-09-22 15:49 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 3002 bytes --]

On Sat, Sep 20, 2014 at 08:49:56PM -0400, Walter Dnes wrote:

> > So I'm missing the "default" device. Sure enough:
> > $ aplay -L
> > null
> >     Discard all samples (playback) or generate zero samples (capture)
> > sysdefault:CARD=PCH
> >     HDA Intel PCH, ALC892 Analog
> >     Default Audio Device
> > [... and some more surround channels plus HDMI]
> >
> > It only lists "sysdefault", but not "default". If I do
> > $ speaker-test -Dsysdefault -c2
> > I get the test noise on both speakers. /usr/share/alsa/alsa.conf defines both:
>
>   Here's what I get on a working system...
>
> [d531][waltdnes][~] aplay -L
> null
>     Discard all samples (playback) or generate zero samples (capture)
> default:CARD=Intel
>     HDA Intel, ALC888 Analog
>     Default Audio Device
> sysdefault:CARD=Intel
>     HDA Intel, ALC888 Analog
>     Default Audio Device
> front:CARD=Intel,DEV=0
>     HDA Intel, ALC888 Analog
>     Front speakers
>
> ...plus a bunch of others.

Including an HDMI device? (in case your board has an HDMI connector at all)

> Here's what I have in "make menuconfig" under
>
> > Device Drivers > Sound card support > Advanced Linux Sound Architecture
>
> |    --- Advanced Linux Sound Architecture
> |    <*>   Sequencer support
> |    < >     Sequencer dummy client
> |    <*>   OSS Mixer API
> |    < >   OSS PCM (digital audio) API
I have this enabled for programs that need /dev/dsp, such as sidplay.

> |    [*]   OSS Sequencer API
> |    <*>   HR-timer backend support
> |    [*]     Use HR-timer as default sequencer timer
> |    [*]   Dynamic device file minor numbers
Didn't have that one enabled.*

> |    (4)     Max number of sound cards
> |    [ ]   Support old ALSA API
> |    [*]   Verbose procfs contents
> |    [ ]   Verbose printk
> |    [ ]   Debug
> |    [ ]   Generic sound devices  ----
> |    [*]   PCI sound devices  --->
> |    [ ]   USB sound devices  ----
> |    < >   ALSA for SoC audio support  ----
>
> Under "PCI sound devices  --->" I have...
> |    <*>   Intel HD Audio  --->

Your kernel must be a bit older. My 3.16 doesn't have this and instead has
an "HD-Audio" entry right next to "PCI sound devices".

> Under "Intel HD Audio  --->" I have...
>
> |    --- Intel HD Audio
> |    (64)  Pre-allocated buffer size for HD-audio driver
> |    [ ]   Build hwdep interface for HD-audio driver
I have that one enabled*. And also "Allow dynamic codec reconfiguration".*

> |    [ ]   Support digital beep via input layer
> |    [ ]   Support jack plugging notification via input layer
> [...]
> |    -*-   Enable generic HD-audio codec parser
This is a module for me, but it gets auto-loaded.


* I toggled those settings and rebuilt, but the result is still the same.
--
Gruß | Greetings | Qapla’
Please do not share anything from, with or about me with any Facebook service.

Ideals are like stars:
you can’t reach them, but you can use them for orientation.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [gentoo-user] alsa: missing default device
  2014-09-22 15:49   ` Frank Steinmetzger
@ 2014-09-22 23:22     ` Walter Dnes
  2014-09-23 12:59       ` Frank Steinmetzger
  0 siblings, 1 reply; 7+ messages in thread
From: Walter Dnes @ 2014-09-22 23:22 UTC (permalink / raw
  To: gentoo-user

On Mon, Sep 22, 2014 at 05:49:10PM +0200, Frank Steinmetzger wrote

> * I toggled those settings and rebuilt, but the result is still the same.

  You may have to configure your sound card setup manually.  It's not as
scarey as it sounds.  First question; what's the output of the command...


cat /proc/asound/cards


...on your PC?  On my system, it's...

[d531][waltdnes][~] cat /proc/asound/cards
 0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xfdff4000 irq 44

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


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

* Re: [gentoo-user] alsa: missing default device
  2014-09-22 23:22     ` Walter Dnes
@ 2014-09-23 12:59       ` Frank Steinmetzger
  2014-09-24  2:32         ` Walter Dnes
  0 siblings, 1 reply; 7+ messages in thread
From: Frank Steinmetzger @ 2014-09-23 12:59 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 3761 bytes --]

On Mon, Sep 22, 2014 at 07:22:12PM -0400, Walter Dnes wrote:
> On Mon, Sep 22, 2014 at 05:49:10PM +0200, Frank Steinmetzger wrote
>
> > * I toggled those settings and rebuilt, but the result is still the same.
>
>   You may have to configure your sound card setup manually.  It's not as
> scarey as it sounds.  First question; what's the output of the command...
>
>
> cat /proc/asound/cards

Here you go, plus the contents of a few others and the tree of that dir.

frank@kern /proc/asound cat cards
 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xf7d10000 irq 45
 1 [HDMI           ]: HDA-Intel - HDA Intel HDMI
                      HDA Intel HDMI at 0xf7d14000 irq 44
frank@kern /proc/asound cat devices
  2: [ 1]   : control
  3: [ 1- 3]: digital audio playback
  4: [ 1- 0]: hardware dependent
  5: [ 0]   : control
  6: [ 0- 0]: digital audio playback
  7: [ 0- 0]: digital audio capture
  8: [ 0- 1]: digital audio playback
  9: [ 0- 2]: digital audio capture
 10: [ 0- 0]: hardware dependent
 33:        : timer
frank@kern /proc/asound cat hwdep
01-00: HDA Codec 0
00-00: HDA Codec 0
frank@kern /proc/asound cat pcm
00-00: ALC892 Analog : ALC892 Analog : playback 1 : capture 1
00-01: ALC892 Digital : ALC892 Digital : playback 1
00-02: ALC892 Alt Analog : ALC892 Alt Analog : capture 1
01-03: ID 2807 Digital : ID 2807 Digital : playback 1

frank@kern /proc/asound tree
.
├── card0
│   ├── codec#0
│   ├── id
│   ├── oss_mixer
│   ├── pcm0c
│   │   ├── info
│   │   ├── oss
│   │   └── sub0
│   │       ├── hw_params
│   │       ├── info
│   │       ├── prealloc
│   │       ├── prealloc_max
│   │       ├── status
│   │       └── sw_params
│   ├── pcm0p
│   │   ├── info
│   │   ├── oss
│   │   └── sub0
│   │       ├── hw_params
│   │       ├── info
│   │       ├── prealloc
│   │       ├── prealloc_max
│   │       ├── status
│   │       └── sw_params
│   ├── pcm1p
│   │   ├── info
│   │   ├── oss
│   │   └── sub0
│   │       ├── hw_params
│   │       ├── info
│   │       ├── prealloc
│   │       ├── prealloc_max
│   │       ├── status
│   │       └── sw_params
│   └── pcm2c
│       ├── info
│       └── sub0
│           ├── hw_params
│           ├── info
│           ├── prealloc
│           ├── prealloc_max
│           ├── status
│           └── sw_params
├── card1
│   ├── codec#0
│   ├── id
│   ├── oss_mixer
│   └── pcm3p
│       ├── info
│       └── sub0
│           ├── hw_params
│           ├── info
│           ├── prealloc
│           ├── prealloc_max
│           ├── status
│           └── sw_params
├── cards
├── devices
├── HDMI -> card1
├── hwdep
├── oss
│   ├── devices
│   └── sndstat
├── PCH -> card0
├── pcm
├── seq
├── timers
└── version
--
Gruß | Greetings | Qapla’
Please do not share anything from, with or about me with any Facebook service.

“If you enjoy wasting time, is that time really wasted?” – Philosoraptor

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [gentoo-user] alsa: missing default device
  2014-09-23 12:59       ` Frank Steinmetzger
@ 2014-09-24  2:32         ` Walter Dnes
  2014-09-24 21:03           ` Frank Steinmetzger
  0 siblings, 1 reply; 7+ messages in thread
From: Walter Dnes @ 2014-09-24  2:32 UTC (permalink / raw
  To: gentoo-user

On Tue, Sep 23, 2014 at 02:59:17PM +0200, Frank Steinmetzger wrote
> On Mon, Sep 22, 2014 at 07:22:12PM -0400, Walter Dnes wrote:
> > On Mon, Sep 22, 2014 at 05:49:10PM +0200, Frank Steinmetzger wrote
> >
> > > * I toggled those settings and rebuilt, but the result is still the same.
> >
> >   You may have to configure your sound card setup manually.  It's not as
> > scarey as it sounds.  First question; what's the output of the command...
> >
> >
> > cat /proc/asound/cards
> 
> Here you go, plus the contents of a few others and the tree of that dir.

  First an elementary question.  Please don't treat this as an insult.
Do you have the "alsasound" service running?  I have an openrc machine.
I don't know the equivalant systemd commands.  As a regular user, execute

/sbin/rc-update show

...and alsasound should show up near the top.  If it doesn't, that's
probably your problem.  In that case use su or sudo for root privileges
and execute the following 2 commands as root...

rc-update add alsasound boot
/etc/init.d/alsasound start

  The first command will cause alsasound to run at every bootup; the
second command is just for this time only, so you don't have to reboot.
Try playing sound again.

#######################################################################

  If that doesn't work for you, "Plan B" is to create a .asoundrc file
in your home directory.  It will over-ride /usr/share/alsa/alsa.conf and
you won't need root permissions to edit it.  If you want the PCH
(analog?) to be the default, enter the following 3 lines in ~/.asoundrc

defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0

  If you want the HDMI as your default, enter in ~/.asoundrc

defaults.ctl.card 1
defaults.pcm.card 1
defaults.pcm.device 1

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


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

* Re: [gentoo-user] alsa: missing default device
  2014-09-24  2:32         ` Walter Dnes
@ 2014-09-24 21:03           ` Frank Steinmetzger
  0 siblings, 0 replies; 7+ messages in thread
From: Frank Steinmetzger @ 2014-09-24 21:03 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 2240 bytes --]

On Tue, Sep 23, 2014 at 10:32:55PM -0400, Walter Dnes wrote:

> > > > * I toggled those settings and rebuilt, but the result is still the same.
> > >
> > >   You may have to configure your sound card setup manually.  It's not as
> > > scarey as it sounds.  First question; what's the output of the command...
> > >
> > > cat /proc/asound/cards
> >
> > Here you go, plus the contents of a few others and the tree of that dir.
>
>   First an elementary question.  Please don't treat this as an insult.

I won't, you can't know everyone and I am not *that* regular a participant
in the list. However, I've been a Gentoo guy for 8 years now and I should
know the basics by now ;-) (although I had my share of cases of negligence).

> Do you have the "alsasound" service running?

It has been in the default runlevel for a number of days now. The service is
also running right now.

>   If that doesn't work for you, "Plan B" is to create a .asoundrc file
> in your home directory.  It will over-ride /usr/share/alsa/alsa.conf and
> you won't need root permissions to edit it.  If you want the PCH
> (analog?) to be the default, enter the following 3 lines in ~/.asoundrc
>
> defaults.ctl.card 0
> defaults.pcm.card 0
> defaults.pcm.device 0

*That* is what I was looking for. My intertubes search also guided me to
.asoundrc, but I had something different in it:
pcm.!default {
    slave.pcm "pch:1,0"
}
Which didn't work.


When I edited .asoundrc as you suggested and it worked right away, I was
baffled. So I reverted the change and checked again -- still working.
Somehow, like other issues I had in the past, it “solved itself”, because
now aplay -L does give me a "default" device.

Yesterday, when I tried your kernel settings, rebuilt and rebooted, it did
not help. Unfortunately I didn't keep my old kernel config; I was unable to
reproduce my problem by reverting my config from memory. So this is another
one for the big book of mysteries, never to be remembered again. :-/

Thanks for your time.
-- 
Gruß | Greetings | Qapla’
Please do not share anything from, with or about me with any Facebook service.

It’s quiet in the shadow, because you can’t hear the light.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2014-09-24 21:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-20 13:18 [gentoo-user] alsa: missing default device Frank Steinmetzger
2014-09-21  0:49 ` Walter Dnes
2014-09-22 15:49   ` Frank Steinmetzger
2014-09-22 23:22     ` Walter Dnes
2014-09-23 12:59       ` Frank Steinmetzger
2014-09-24  2:32         ` Walter Dnes
2014-09-24 21:03           ` Frank Steinmetzger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox