Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Cannot get alsa sound to work
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
philip
Guru
Guru


Joined: 10 Jun 2003
Posts: 535
Location: Sweden

PostPosted: Sun Jul 27, 2014 2:10 pm    Post subject: [SOLVED] Cannot get alsa sound to work Reply with quote

I have tried to get alsa to work on my Thinkpad Caron X1 fore some time. But I seem to be stuck.

HW is:
# lspci | grep -i audio
Code:
00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 09)
00:1b.0 Audio device: Intel Corporation Lynx Point-LP HD Audio Controller (rev 04)


I have followed this wiki:
http://wiki.gentoo.org/wiki/ALSA

I observed

# equery uses alsa-lib
Code:
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for media-libs/alsa-lib-1.0.27.2:
 U I
 - - alisp                          : Enable support for ALISP (ALSA LISP) interpreter for
                                      advanced features.
 - - debug                          : Enable extra debug codepaths, like asserts and extra
                                      output. If you want to get meaningful backtraces see
                                      http://www.gentoo.org/proj/en/qa/backtraces.xml
 - - doc                            : Add extra documentation (API, Javadoc, etc). It is
                                      recommended to enable per package instead of globally
 - - python                         : Add optional support/bindings for the Python language
 + + python_single_target_python2_7 : Build for Python 2.7 only
 + + python_targets_python2_7       : Build with Python 2.7


Is this a correct default setting for alsa-lib use flags? Should python also be included?

I also see a distinct error when testing sound:

$ speaker-test -t wav -c 2
Code:
speaker-test 1.0.27.2

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.0.27.2/work/alsa-lib-1.0.27.2/src/pcm/pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
Playback open error: -2,No such file or directory

_________________
/Phil


Last edited by philip on Wed Aug 06, 2014 12:28 pm; edited 3 times in total
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sun Jul 27, 2014 2:24 pm    Post subject: Re: Cannot get alsa sound to work Reply with quote

philip wrote:
Is this a correct default setting for alsa-lib use flags? Should python also be included?

Phil ... no, python isn't needed, does the card show under 'alsamixer' (media-sound/alsa-utils) is "Master" perhaps muted ('M' will toggle). Is the driver, and codec, enabled in the kernel?

Code:
# grep SND /usr/src/linux/.config

best ... khay
Back to top
View user's profile Send private message
philip
Guru
Guru


Joined: 10 Jun 2003
Posts: 535
Location: Sweden

PostPosted: Sun Jul 27, 2014 4:06 pm    Post subject: Reply with quote

Yes sound is unmuted in alsamixer. I can switch between three sound cards in alsamixer with the F6 key;
0 HDA Intel MID
1 HDA Intel PCH
5 Thinkpad Console Audio Control

The HDA Intel PCH displays volume controls (Master, Headpone, Speaker, ... etc) and all are unmuted and volumes turned up.

The Thinkpad Console Audio Control does not seem to be able to adjust from the alsamixer gui. It reads 00. However, on my touch display for F1 through F12 I can mute and unmute sound and control the volume. This setting is unmuted and volume turned up.

Here is the output of grep SND /usr/src/linux/.config

src/linux/.config
Code:
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_HWDEP=y
CONFIG_SND_SEQUENCER=y
CONFIG_SND_SEQ_DUMMY=y
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_HRTIMER=y
CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
# CONFIG_SND_DYNAMIC_MINORS is not set
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set
CONFIG_SND_VMASTER=y
CONFIG_SND_KCTL_JACK=y
CONFIG_SND_DMA_SGBUF=y
# CONFIG_SND_RAWMIDI_SEQ is not set
# CONFIG_SND_OPL3_LIB_SEQ is not set
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_PCSP is not set
# CONFIG_SND_DUMMY is not set
# CONFIG_SND_ALOOP is not set
# CONFIG_SND_VIRMIDI is not set
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set
CONFIG_SND_PCI=y
# CONFIG_SND_AD1889 is not set
# CONFIG_SND_ALS300 is not set
# CONFIG_SND_ALS4000 is not set
# CONFIG_SND_ALI5451 is not set
# CONFIG_SND_ASIHPI is not set
# CONFIG_SND_ATIIXP is not set
# CONFIG_SND_ATIIXP_MODEM is not set
# CONFIG_SND_AU8810 is not set
# CONFIG_SND_AU8820 is not set
# CONFIG_SND_AU8830 is not set
# CONFIG_SND_AW2 is not set
# CONFIG_SND_AZT3328 is not set
# CONFIG_SND_BT87X is not set
# CONFIG_SND_CA0106 is not set
# CONFIG_SND_CMIPCI is not set
# CONFIG_SND_OXYGEN is not set
# CONFIG_SND_CS4281 is not set
# CONFIG_SND_CS46XX is not set
# CONFIG_SND_CS5530 is not set
# CONFIG_SND_CS5535AUDIO is not set
# CONFIG_SND_CTXFI is not set
# CONFIG_SND_DARLA20 is not set
# CONFIG_SND_GINA20 is not set
# CONFIG_SND_LAYLA20 is not set
# CONFIG_SND_DARLA24 is not set
# CONFIG_SND_GINA24 is not set
# CONFIG_SND_LAYLA24 is not set
# CONFIG_SND_MONA is not set
# CONFIG_SND_MIA is not set
# CONFIG_SND_ECHO3G is not set
# CONFIG_SND_INDIGO is not set
# CONFIG_SND_INDIGOIO is not set
# CONFIG_SND_INDIGODJ is not set
# CONFIG_SND_INDIGOIOX is not set
# CONFIG_SND_INDIGODJX is not set
# CONFIG_SND_EMU10K1 is not set
# CONFIG_SND_EMU10K1X is not set
# CONFIG_SND_ENS1370 is not set
# CONFIG_SND_ENS1371 is not set
# CONFIG_SND_ES1938 is not set
# CONFIG_SND_ES1968 is not set
# CONFIG_SND_FM801 is not set
CONFIG_SND_HDA_INTEL=y
CONFIG_SND_HDA_PREALLOC_SIZE=64
CONFIG_SND_HDA_HWDEP=y
# CONFIG_SND_HDA_RECONFIG is not set
# CONFIG_SND_HDA_INPUT_BEEP is not set
# CONFIG_SND_HDA_INPUT_JACK is not set
# CONFIG_SND_HDA_PATCH_LOADER is not set
CONFIG_SND_HDA_CODEC_REALTEK=y
CONFIG_SND_HDA_CODEC_ANALOG=y
CONFIG_SND_HDA_CODEC_SIGMATEL=y
CONFIG_SND_HDA_CODEC_VIA=y
CONFIG_SND_HDA_CODEC_HDMI=y
CONFIG_SND_HDA_I915=y
CONFIG_SND_HDA_CODEC_CIRRUS=y
CONFIG_SND_HDA_CODEC_CONEXANT=y
CONFIG_SND_HDA_CODEC_CA0110=y
CONFIG_SND_HDA_CODEC_CA0132=y
# CONFIG_SND_HDA_CODEC_CA0132_DSP is not set
CONFIG_SND_HDA_CODEC_CMEDIA=y
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
# CONFIG_SND_HDSP is not set
# CONFIG_SND_HDSPM is not set
# CONFIG_SND_ICE1712 is not set
# CONFIG_SND_ICE1724 is not set
# CONFIG_SND_INTEL8X0 is not set
# CONFIG_SND_INTEL8X0M is not set
# CONFIG_SND_KORG1212 is not set
# CONFIG_SND_LOLA is not set
# CONFIG_SND_LX6464ES is not set
# CONFIG_SND_MAESTRO3 is not set
# CONFIG_SND_MIXART is not set
# CONFIG_SND_NM256 is not set
# CONFIG_SND_PCXHR is not set
# CONFIG_SND_RIPTIDE is not set
# CONFIG_SND_RME32 is not set
# CONFIG_SND_RME96 is not set
# CONFIG_SND_RME9652 is not set
# CONFIG_SND_SONICVIBES is not set
# CONFIG_SND_TRIDENT is not set
# CONFIG_SND_VIA82XX is not set
# CONFIG_SND_VIA82XX_MODEM is not set
# CONFIG_SND_VIRTUOSO is not set
# CONFIG_SND_VX222 is not set
# CONFIG_SND_YMFPCI is not set
CONFIG_SND_USB=y
# CONFIG_SND_USB_AUDIO is not set
# CONFIG_SND_USB_UA101 is not set
# CONFIG_SND_USB_USX2Y is not set
# CONFIG_SND_USB_CAIAQ is not set
# CONFIG_SND_USB_US122L is not set
# CONFIG_SND_USB_6FIRE is not set
# CONFIG_SND_USB_HIFACE is not set
CONFIG_SND_PCMCIA=y
# CONFIG_SND_VXPOCKET is not set
# CONFIG_SND_PDAUDIOCF is not set
# CONFIG_SND_SOC is not set


I have also discovered that sound works in headphones. That is, it is only sound in the ordinary loudspeakers that does not work (speakers built in, in the laptop).
_________________
/Phil
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sun Jul 27, 2014 9:02 pm    Post subject: Reply with quote

Phil ...

are you getting speaker pops on boot and shutdown? Does the following a least provide some audio output if repeating the speaker test?

/etc/modprobe.d/alsa.conf
Code:
options snd-hda-intel index=1,0

best ... khay
Back to top
View user's profile Send private message
philip
Guru
Guru


Joined: 10 Jun 2003
Posts: 535
Location: Sweden

PostPosted: Sun Jul 27, 2014 9:33 pm    Post subject: Reply with quote

This is my /etc/modprobe.d/alsa.conf before making any changes. I suspect I have not configured this right (or at all). But I can not find any good wiki for this, given my HW.
Can you see directly anything that needs to be changed, in addition to

Code:
options snd-hda-intel index=1,0
?


$ cat /etc/modprobe.d/alsa.conf
Code:
# Alsa kernel modules' configuration file.

# ALSA portion
alias char-major-116 snd
# OSS/Free portion
alias char-major-14 soundcore

##
## IMPORTANT:
## You need to customise this section for your specific sound card(s)
## and then run `update-modules' command.
## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
##
##  ALSA portion
## alias snd-card-0 snd-interwave
## alias snd-card-1 snd-ens1371
##  OSS/Free portion
## alias sound-slot-0 snd-card-0
## alias sound-slot-1 snd-card-1
##

# OSS/Free portion - card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
##  OSS/Free portion - card #2
## alias sound-service-1-0 snd-mixer-oss
## alias sound-service-1-3 snd-pcm-oss
## alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.
options snd cards_limit=1

_________________
/Phil
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Sun Jul 27, 2014 11:34 pm    Post subject: Reply with quote

Post 'aplay -l' and 'aplay -L'.
Is it a systemd setup ?
Is pulseaudio installed ?

Does aplay work for root ?
Back to top
View user's profile Send private message
philip
Guru
Guru


Joined: 10 Jun 2003
Posts: 535
Location: Sweden

PostPosted: Mon Jul 28, 2014 8:29 am    Post subject: Reply with quote

# aplay -l
Code:
**** List of PLAYBACK Hardware Devices ****
card 0: MID [HDA Intel MID], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: MID [HDA Intel MID], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC292 Analog [ALC292 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0



# aplay -L
Code:
null
    Discard all samples (playback) or generate zero samples (capture)
hdmi:CARD=MID,DEV=0
    HDA Intel MID, HDMI 0
    HDMI Audio Output
hdmi:CARD=MID,DEV=1
    HDA Intel MID, HDMI 1
    HDMI Audio Output
default:CARD=PCH
    HDA Intel PCH, ALC292 Analog                                                                                       
    Default Audio Device                                                                                               
sysdefault:CARD=PCH
    HDA Intel PCH, ALC292 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC292 Analog
    Front speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC292 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC292 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC292 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC292 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC292 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers


Systemd not installed
Pulseaudio is not installed.


aplay does not work for root:

# aplay /usr/share/apps/korganizer/sounds/spinout.wav
Code:
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.0.27.2/work/alsa-lib-1.0.27.2/src/pcm/pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
aplay: main:722: audio open error: No such file or directory


Maybe this is a hint if what is wrong?

# aplay -I
Code:
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.0.27.2/work/alsa-lib-1.0.27.2/src/pcm/pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
aplay: main:722: audio open error: No such file or directory

_________________
/Phil
Back to top
View user's profile Send private message
mir3x
Guru
Guru


Joined: 02 Jun 2012
Posts: 455

PostPosted: Tue Jul 29, 2014 4:47 pm    Post subject: Reply with quote

Check this out ? https://bbs.archlinux.org/viewtopic.php?id=137653
or google snd_pcm_dmix_open linux ( I saw other solution with .asoundrc )
_________________
Sent from Windows
Back to top
View user's profile Send private message
philip
Guru
Guru


Joined: 10 Jun 2003
Posts: 535
Location: Sweden

PostPosted: Wed Aug 06, 2014 12:27 pm    Post subject: Reply with quote

Thanks mir3x,

I added the line

Code:
options snd-hda-intel id=PHC index=1


to /etc/modprobe.d/alsa.conf

and now I have sound in the speakers.
_________________
/Phil
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum