Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
HI,
I'm not able to ear any sound from my panel pc. It has a Gentoo kernel 3.19.8 and the sound hardware is the following:
Code:
eposatom ~ # aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=PCH
HDA Intel PCH, ALC262 Analog
Default Audio Device
sysdefault:CARD=PCH
HDA Intel PCH, ALC262 Analog
Default Audio Device
front:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
Front speakers
surround21:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=PCH,DEV=0
HDA Intel PCH, HDMI 0
HDMI Audio Output
hdmi:CARD=PCH,DEV=1
HDA Intel PCH, HDMI 1
HDMI Audio Output
hdmi:CARD=PCH,DEV=2
HDA Intel PCH, HDMI 2
HDMI Audio Output
The .asoundrc file is the following:
Code:
# alsa configuration file
pcm.hda-intel{
type hw
card 0
}
ctl.hda-intel{
type hw
card 0
}
The kernel has the following drivers:
Code:
eposatom ~ # zgrep -i snd_hda /boot/config-3.19.8-gentoo
CONFIG_SND_HDA=y
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
Finally the alsa.conf file is the following
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
alias snd-card-0 snd-hda-intel
## 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
options snd_hda_intel index=0 model=inv-dmic
The alsasound service has been enabled at boot
The system works under X without any windows manager but with a specific GUI application.
The details for which are often in /proc/asound/, although a bit of understanding is needed to decrypt them from various files in /proc/asound/. And other things can get in the way like pulseaudio and jackd. But mostly being in the audio group, and setting mixer levels is what most initially get wrong. Followed by selecting the wrong device, hw:0,0 is default by default. Which could be a webcam (input only) depending on how things loaded at boot.
Hi, now I'm testing the sound as root, but even the user is in to the audio group.
The result of your command is the following:
Code:
eposatom ~ # speaker-test -c 2 -l 1 -D hw:PCH,0
speaker-test 1.1.7
Playback device is hw:PCH,0
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 16384
Period size range from 32 to 8192
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
0 - Front Left
Write error: -5,Errore di input/output
xrun_recovery failed: -5,Errore di input/output
Transfer failed: Errore di input/output
I tried the other devices you suggested, but I receive always an error of invalid card
Just to complete the info of the system, dmesg says this:
C0D2 is the microphone input (typically). You might try a newer kernel, the snd-hda-intel driver is under constant change as most everything has a version of it these days. Version 3.19 is quite dated at this point, seem like 2015 was the last update to it and your hardware is likely newer than that. Unless you're building your alsa drivers from the alsa-project.org source and not the actual kernel tree for 3.19.
Hi,
the 3.19 is the higher version of kernel I can use because the system needs to work a specific usb driver that is incompatible with kernel 4.
I will try to disable the alsa driver into the kernel and download the latest version.
The system works as a kiosk with a custom graphic application under X but without any windows manager so I cannot install pavucontrol. The only tool I could use for the sound is aplay.
Not entirely true. You can use rec and play from the sox package. Also command line based. Technically ffplay and cvlc will work too. Or mpv and a number of mplayer variants.
I use rec when doing down an dirty recordings as it has a CLI based meter to tell what your level is at. Which otherwise verifies that you "are" recording IMO. With arecord you're literally flying blind, baring some form of tee and sound routing to hear what you're recording while recording. Although I'll often use arecord + tee to record a high quality version and an mp3 version at the same time. The mp3 version I hand off to the subjects being recorded while I take the high quality one home to process.
A down and dirty way of routing sound with alsa based systems.
I did some test with different kernels
It works with kernel 4.19 and with kernel 3.15, so I suppose there is a bug with the sound HDA modules into the kernel 3.19
There's often parameters that you can pass to tweak things. Which might help it work on other versions.
# modinfo snd-hda-intel
Code:
filename: /lib/modules/4.19.0-1-amd64/kernel/sound/pci/hda/snd-hda-intel.ko
description: Intel HDA driver
license: GPL
...
...
...
depends: snd-hda-core,snd-hda-codec,snd-pcm,snd
intree: Y
name: snd_hda_intel
vermagic: 4.19.0-1-amd64 SMP mod_unload modversions
sig_id: PKCS#7
signer:
sig_key:
sig_hashalgo: md4
signature: ...
...
...
parm: index:Index value for Intel HD audio interface. (array of int)
parm: id:ID string for Intel HD audio interface. (array of charp)
parm: enable:Enable Intel HD audio interface. (array of bool)
parm: model:Use the given board model. (array of charp)
parm: position_fix:DMA pointer read method.(-1 = system default, 0 = auto, 1 = LPIB, 2 = POSBUF, 3 = VIACOMBO, 4 = COMBO, 5 = SKL+). (array of int)
parm: bdl_pos_adj:BDL position adjustment offset. (array of int)
parm: probe_mask:Bitmask to probe codecs (default = -1). (array of int)
parm: probe_only:Only probing and no codec initialization. (array of int)
parm: jackpoll_ms:Ms between polling for jack events (default = 0, using unsol events only) (array of int)
parm: single_cmd:Use single command to communicate with codecs (for debugging only). (bint)
parm: enable_msi:Enable Message Signaled Interrupt (MSI) (bint)
parm: patch:Patch file for Intel HD audio interface. (array of charp)
parm: beep_mode:Select HDA Beep registration mode (0=off, 1=on) (default=1). (array of bool)
parm: power_save:Automatic power-saving timeout (in second, 0 = disable). (xint)
parm: pm_blacklist:Enable power-management blacklist (bool)
parm: power_save_controller:Reset controller in power save mode. (bool)
parm: align_buffer_size:Force buffer and period sizes to be multiple of 128 bytes. (bint)
parm: snoop:Enable/disable snooping (bint)
The defaults for the other kernels are likely different. Or other bug fixes, check the changelog(s). You can set parms at load time $(modprobe snd-hda-intel pm_blacklist=true), or in /etc/modprobe.d/???.conf with the options line(s).
Thanks for the suggestion. I will try to use the parameters.
In any case I saw with alsamixer that every time only the hdmi codec is activated. I tried to disable that codec recompiling the kernel, but the result is a strange chip name shown with alsamixer, but always of type hdmi
The command "lsmod" shows that snd_hda_intel=0 always.
Edit:
I tried to use the "probe_mask" param to mask the hdmi codec. With this param in alsa.conf I have:
There's stuff in /proc/asound/* that details what's available. Things shown by other means like amixer or aplay -l. Just make sure the sound is routed to the desired device. Harder to do these days since HDMI has audio, webcams have audio (input only), motherboards, graphics cards, and everything is an audio device it seems these days #surveillancestate.
It'll be 0 in lsmod until something is using it. i.e. you have to be playing audio for it to not be 0. Not what you'd expect since other things like wifi, video, and such will always be in use by default (in most cases).
Hi,
if I try to use the command "aplay mysound.wav" I cannot ear any sound and snd-hda-intel remains 0 in lsmod
In /proc/asound I see a folder named card0 and a link to this folder named Intel. Inside card0 there ar files referencing codecs, id and so on.
My opinion is that some of these are wrong or the system is looking for something else
Using kernel 4.19 it works properly, but in /proc/asound instead to have a folder named "Intel" there is a folder named "PCH" and in card0 there are more files
Should list known devices and their index. There's also a generic "name" associated with it, which allows you to call it by name without knowing it's index (if it's a unique device).
Code:
0 [Loopback ]: Loopback - Loopback
Loopback 1
1 [HDMI ]: HDA-Intel - HDA ATI HDMI
HDA ATI HDMI at 0xf0560000 irq 35
2 [Generic ]: HDA-Intel - HD-Audio Generic
HD-Audio Generic at 0xf0564000 irq 36
3 [C920 ]: USB-Audio - HD Pro Webcam C920
HD Pro Webcam C920 at usb-0000:00:12.0-1.1.1, high speed
In my case these are there. I can call the output hw:0,0 or hw:Loopback,0 for my default device. In my case I use the loopback device so I can route to pulseaudio over the network and do the resampling on the client machine. Letting the remote server machine do the resampling seems to crash pulseaudio after about an hour. Which didn't used to happen, but after an update.....
There's other things that are card specific.
$ ls -l /proc/asound/card2/
Code:
total 0
-r--r--r-- 1 root root 0 Feb 16 06:09 codec#0
-r--r--r-- 1 root root 0 Feb 16 06:09 id
dr-xr-xr-x 3 root root 0 Feb 16 06:09 pcm0c
dr-xr-xr-x 3 root root 0 Feb 16 06:09 pcm0p
The ID is the [NAME] you saw in /proc/asound/cards. The things that end in "c" are capture and that end in "p" are playback. So /proc/asound/card2/pcm0p would effectively by hw:2,0 in alsa naming conventions. Which in my case would be the speakers on the laptop. The ID is also useful if you have say two unique usb soundcards. To force the index via /etc/modprobe.d/custom_sound.conf or so with "options snd-usb-audio index=0 id=UR22mkII" in the case of my other machine with a steinberg usb soundcard. Which could also have an M-Audio usb soundcard using the same driver (snd-usb-audio)(id=MobilePre). Although it doesn't (this month).
Not that you need to know any/most of that. But if there is no index for your card in /proc/asound/cards, then you do not have a driver for it. And if the details under /proc/asound/card#/ for it lack things, you do not have certain functionality. Like "p" for playback or "c" for capture.
$ ls -l /proc/asound/card3/
Code:
total 0
-r--r--r-- 1 root root 0 Feb 16 06:21 id
dr-xr-xr-x 3 root root 0 Feb 16 06:21 pcm0c
-r--r--r-- 1 root root 0 Feb 16 06:21 stream0
-r--r--r-- 1 root root 0 Feb 16 06:21 usbbus
-r--r--r-- 1 root root 0 Feb 16 06:21 usbid
-r--r--r-- 1 root root 0 Feb 16 06:21 usbmixer
Note that my webcam, does NOT have pcm0p for "playback".
Things like pavucontrol will GUI-ize this for you, so you don't need to know / understand most of it. As long as things "work" as expected.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.