LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-18-2019, 03:05 AM   #1
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 20.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora, Yocto
Posts: 77

Rep: Reputation: 1
Sound not working with ALC262


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.


What do I have to do to have the audio working?

Thanks
Claudio
 
Old 01-18-2019, 04:59 AM   #2
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
$ speaker-test -c 2 -l 1 -D hw:PCH,0

Assuming you want the 3.5mm jack output and not the HDMI. Also make sure the user is in the audio group.

$ groups

And that the mixer levels are NOT muted.

$ alsamixer -c PCH

Optionally try the "other" devices until one works.

$ speaker-test -c 2 -l 1 -D hw:0,0
$ speaker-test -c 2 -l 1 -D hw:1,0
$ speaker-test -c 2 -l 1 -D hw:2,0

Or other device options, HDMI is often ,3 so...

$ speaker-test -c 2 -l 1 -D hw:0,3
$ speaker-test -c 2 -l 1 -D hw:1,3
$ speaker-test -c 2 -l 1 -D hw:2,3

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.
 
1 members found this post helpful.
Old 01-18-2019, 09:10 AM   #3
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 20.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora, Yocto
Posts: 77

Original Poster
Rep: Reputation: 1
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:
Code:
eposatom ~ # dmesg | grep -i audio
[    2.490424] sound hdaudioC0D0: autoconfig: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
[    2.490427] sound hdaudioC0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    2.490429] sound hdaudioC0D0:    hp_outs=1 (0x15/0x0/0x0/0x0/0x0)
[    2.490431] sound hdaudioC0D0:    mono: mono_out=0x0
[    2.490432] sound hdaudioC0D0:    inputs:
[    2.490434] sound hdaudioC0D0:      Internal Mic=0x19
[    2.490435] sound hdaudioC0D0:      Mic=0x18
[    2.495404] sound hdaudioC0D2: autoconfig: line_outs=0 (0x0/0x0/0x0/0x0/0x0) type:line
[    2.495408] sound hdaudioC0D2:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    2.495410] sound hdaudioC0D2:    hp_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    2.495411] sound hdaudioC0D2:    mono: mono_out=0x0
[    2.495413] sound hdaudioC0D2:    dig-out=0x3/0x0
[    2.495414] sound hdaudioC0D2:    inputs:
This after putting the alsa driver as modules into the kernel. With the alsa driver integrated into the kernel I have only the hdaudioC0D0 in dmesg

Claudio
 
Old 01-18-2019, 03:26 PM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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.
 
Old 01-18-2019, 03:30 PM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
You might also try:

$ speaker-test -c 2 -l 1 -D default
$ speaker-test -c 2 -l 1 -D pulse

And use pavucontrol to select your audio option if pulseaudio is in play. It likely is as modern gui web browsers require it for sound.
 
Old 01-19-2019, 08:03 AM   #6
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 20.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora, Yocto
Posts: 77

Original Poster
Rep: Reputation: 1
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.

Claudio
 
Old 01-19-2019, 01:45 PM   #7
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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.

FILE: $HOME/.asoundrc
Code:
defaults.ctl.card 1
defaults.pcm.card 1
defaults.pcm.device 0
Assuming that the -D hw:1,0 option worked. Otherwise hw:0,0 is always the default output.
 
Old 02-02-2019, 12:44 PM   #8
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 20.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora, Yocto
Posts: 77

Original Poster
Rep: Reputation: 1
HI,
I tried to follow your suggestion modifying the .asoundrc file, but I still have no sound.
 
Old 02-06-2019, 09:01 AM   #9
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 20.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora, Yocto
Posts: 77

Original Poster
Rep: Reputation: 1
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

Any idea about how to solve this issue?

Claudio
 
Old 02-07-2019, 01:18 PM   #10
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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).
 
Old 02-07-2019, 05:27 PM   #11
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 20.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora, Yocto
Posts: 77

Original Poster
Rep: Reputation: 1
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:
Code:
eposatom ~ # lsmod
Module                  Size  Used by
hid_multitouch          8164  0 
usbhid                 28999  0 
snd_hda_codec_realtek    46545  1 
snd_hda_codec_generic    41535  1 snd_hda_codec_realtek
snd_hda_intel          15457  0 
snd_hda_controller     17278  1 snd_hda_intel
snd_hda_codec          73180  4 snd_hda_codec_realtek,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller
x86_pkg_temp_thermal     2932  0 
snd_hwdep               5517  1 snd_hda_codec
snd_pcm                66372  3 snd_hda_codec,snd_hda_intel,snd_hda_controller
snd_timer              15553  1 snd_pcm
snd                    48364  6 snd_hwdep,snd_timer,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel
pcspkr                  1747  0
and
Code:
eposatom ~ # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC262 Analog [ALC262 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
Now alsamixer detects a Realtek ALC262 chip as expected, but snd-hda-intel is always 0 in lsmod. This means that it is not used.

In any case no sound

Last edited by dr_berta; 02-08-2019 at 01:59 AM. Reason: Update info
 
Old 02-08-2019, 04:30 AM   #12
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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.
 
Old 02-08-2019, 04:34 AM   #13
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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).
 
Old 02-15-2019, 01:59 AM   #14
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 20.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora, Yocto
Posts: 77

Original Poster
Rep: Reputation: 1
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
 
Old 02-16-2019, 06:24 AM   #15
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
$ cat /proc/asound/cards

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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Suse 11.3 Alsa sound problem ; Toshiba Tecra M9 - ALC262 Analog bogdanirimie SUSE / openSUSE 2 09-01-2010 04:02 PM
Internal Microphone not working on Sony VAIO SR16 with ALC262 greengrocer Linux - Newbie 7 08-19-2009 10:17 AM
support for Realtek ALC262 HDA Audio Codec under linux-2.6.24 barunparichha Linux - Hardware 9 08-14-2008 05:38 AM
Intel sound not working, usb modem not working. siriusb Linux - Hardware 8 03-04-2006 10:16 PM
Sound card not working.. no sound. bipbip Linux - Hardware 5 08-07-2003 03:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration