LinuxQuestions.org
Review your favorite Linux distribution.
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 02-16-2019, 08:07 AM   #16
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 16.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora
Posts: 41

Original Poster
Rep: Reputation: 1

Hi,
thank you for your explanation. It is very useful.
Monday, I will check (and post) the content of the /proc/asound/cards content.
For sure I have only one card (card0) with several devices: one analog and 3 hdmi.

Probably specifying into the /etc/modprobe.d/alsa-conf the correct id of the playback device could solve the issue
 
Old 02-18-2019, 01:35 AM   #17
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,682
Blog Entries: 1

Rep: Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796
About all that /etc/modprobe.d/ lets you do is specify default parameters (shouldn't need any if things just work). Otherwise it lets you specify an index at boot so you don't have to configure other things since card 0 is default. Or at least fewer commands / parameters on the CLI. I only set snd-aloop to index 0 to try and work around a pulse bug of changing HDMI audio ON when I turn off and on the monitor (aka nap time). Although that triggers with power save modes too. Which basically didn't do anything with regards to that bug / feature.
 
Old 02-18-2019, 01:57 AM   #18
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 16.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora
Posts: 41

Original Poster
Rep: Reputation: 1
Hi,
this is the actual situation:
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
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
eposatom ~ # cd /proc/asound/
eposatom asound # ls
card0  cards  devices  hwdep  modules  oss  PCH  pcm  seq  timers  version
eposatom asound # cd card0/
eposatom card0 # ls
codec#0  eld#2.0  eld#2.2  pcm0c  pcm3p  pcm8p
codec#2  eld#2.1  id       pcm0p  pcm7p
eposatom card0 # ls pcm0p/sub0
hw_params  info  prealloc  prealloc_max  status  sw_params
The id is PCH

The content of the files status and info is the following:
Code:
eposatom card0 # less pcm0p/sub0/status
closed
eposatom card0 # less pcm0p/sub0/info
card: 0
device: 0
subdevice: 0
stream: PLAYBACK
id: ALC262 Analog
name: ALC262 Analog
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 1
The files hw_params and sw_params have the same value of status

My /etc/modprobe.d/alsa.conf 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
##  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 snd-hda-intel index=0 id="PCH"
I tried to add several other parameters but without any success

With this configuration the command aplay mysound.wav doesn't do any sound and I need to kill it manually the command otherwise it doesn't exit after the sound.

Last edited by dr_berta; 02-18-2019 at 01:59 AM. Reason: phrase correction
 
Old 02-19-2019, 12:36 AM   #19
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,682
Blog Entries: 1

Rep: Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796
options snd cards_limit=1

That one is more likely to get in the way than help. It basically says that you can only have one sound card, and the first one the system sees is the only one you will have. Many audio things will have 2 cards. Like the one for your video card / APU. One for the GPU (HDMI) and one for any 1/8" / 3.5mm jacks. Setting the limit to 1 might mean that only HALF of those options work.

A lot of those other options are basically not needed these days on modern systems. They were needed back in the day so that the sound modules would auto-load when you tried to use the soundcard. This would auto happen with many distros when mixer levels were restored at boot. Otherwise you had to insmod all the individual modules in a particular sequence manually to get things loaded up and working. In a time when alsa modules were NOT in the kernel source tree.

The OSS emulation layer (snd-*-oss) is mostly not needed. But IF in use you might need to load the modules manually for it to work. And launch applications with the aoss wrapper to use them. Mostly OLD applications that use ONLY the /dev/dsp sound device. Mostly replaced with /dev/snd/* things these days for things that use ALSA natively.
 
Old 02-19-2019, 12:44 AM   #20
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,682
Blog Entries: 1

Rep: Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796
For those /dev/dsp things, having the oss modules loaded might only create the /dev/dsp0 and not the link from /dev/dsp to /dev/dsp0. So even with it in play you may still need to manually:

# ln -s /dev/dsp0 /dev/dsp

for your /dev/dsp using application to be able to output sound. The festival text to speech application was probably the last one I was familiar with that needed that. Although I think it did get updated to more modern methods. And mostly replaced with espeak / gespeaker type things these days.
 
Old 02-19-2019, 01:52 AM   #21
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 16.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora
Posts: 41

Original Poster
Rep: Reputation: 1
Hi,
I tried to increase to 2 the number of cards_limit but the result is always the same:
my system sees only one card with several devices
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
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
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
I also checked the sound devices and I saw this
Code:
eposatom ~ # ls /dev/snd*
by-path  controlC0  hwC0D0  hwC0D2  pcmC0D0c  pcmC0D0p  pcmC0D3p  pcmC0D7p  pcmC0D8p  timer
No /dev/dsp* devices are present

The attached image shows what alsamixer sees.
Unfortunately alsamixer is not able to select the analog device, but only the hdmi. I don't know why.

Could this be the reason why the sound doesn't work?
Attached Thumbnails
Click image for larger version

Name:	alsamixer.png
Views:	2
Size:	41.1 KB
ID:	29859  
 
Old 02-21-2019, 11:07 PM   #22
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,682
Blog Entries: 1

Rep: Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796
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
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
According to that you have 4 possible outputs.

hw:0,0
hw:0,3
hw:0,7
hw:0,8

The latter 3 being HDMI outputs. Which wont output any sound if you're using a DVI connector (HDMI without audio). Or the HDMI device has no speakers. The /dev/ output says basically the same output devices.

Code:
pcmC0D0p  pcmC0D3p  pcmC0D7p  pcmC0D8p
The alsamixer says that things are NOT muted and the levels should be audible. You can press F6 in there to select "other" soundcards. Or pass options like "-c 1". Pressing F1 in alsamixer gives you a basic help screen.

As far as the soundcard limit, set it to something illogical =5 =10, or remove it entirely. As I said, it's more likely to get in the way than help. Most computers come with more than one soundcard, even if those have no physical connections to actual hardware. Not to long ago laptops came with dialup modems, which used the laptops soundcard for it's DSP capabilities and would show up as an additional soundcard. Even though there was technically only one soundcard and using the modem meant that you could not output sound while connected to the internet over dialup.

And of course make sure that the user is in the audio group or it doesn't have permissions to output sound.

$ groups

$ ls -l /dev/snd/
Code:
total 0
drwxr-xr-x  2 root root       60 Jan 20 09:31 by-id
drwxr-xr-x  2 root root      120 Jan 20 09:31 by-path
crw-rw----+ 1 root audio 116,  6 Jan 20 09:31 controlC0
crw-rw----+ 1 root audio 116,  9 Jan 20 09:31 controlC1
crw-rw----+ 1 root audio 116, 13 Jan 20 09:31 controlC2
crw-rw----+ 1 root audio 116, 15 Jan 20 09:31 controlC3
crw-rw----+ 1 root audio 116,  8 Jan 20 09:31 hwC1D0
crw-rw----+ 1 root audio 116, 12 Jan 20 09:31 hwC2D0
crw-rw----+ 1 root audio 116,  3 Feb 20 19:39 pcmC0D0c
crw-rw----+ 1 root audio 116,  2 Feb 21 22:33 pcmC0D0p
crw-rw----+ 1 root audio 116,  5 Feb 20 19:39 pcmC0D1c
crw-rw----+ 1 root audio 116,  4 Jan 20 09:31 pcmC0D1p
crw-rw----+ 1 root audio 116,  7 Feb 21 08:56 pcmC1D3p
crw-rw----+ 1 root audio 116, 11 Feb 20 19:39 pcmC2D0c
crw-rw----+ 1 root audio 116, 10 Feb 20 19:39 pcmC2D0p
crw-rw----+ 1 root audio 116, 14 Feb 20 19:39 pcmC3D0c
crw-rw----+ 1 root audio 116,  1 Jan 20 09:31 seq
crw-rw----+ 1 root audio 116, 33 Jan 20 09:31 timer
The OSS stuff is only there if you manually load the modules. If you don't need or don't plan on using that you should remove those lines from your .conf as well. Or load the modules via modprobe or /etc/modules configuration. The -seq- one is mostly optional, unless you're into midi type things. Via things like timidity or fluidsynth and others.

# modprobe snd-pcm-oss
# modprobe snd-mixer-oss
# modprobe snd-seq-oss

And then there's things like jack or pulseaudio that can change what a device is called. Which also gets in the way if you're not familiar with the linux audio systems.

$ speaker-test -c 2 -l 1 -D hw:0,0
$ speaker-test -c 2 -l 1 -D hw:0,3
$ speaker-test -c 2 -l 1 -D hw:0,7
$ speaker-test -c 2 -l 1 -D hw:0,8
$ speaker-test -c 2 -l 1 -D pulse
$ speaker-test -c 2 -l 1 -D jack
$ speaker-test -c 2 -l 1 -D default

pulseaudio is likely to be in play on modern distros. In fact modern web browsers REQUIRE it to have audio output these days. Since like firefox version 54? Seems like version 65 is the latest one at the moment. So in addition to alsamixer, you might try pavucontrol to set your levels and default device.

$ pavucontrol

All of which assumes a working driver. Which was the original issue with an OLD kernel and NEW-ish hardware.
 
Old 02-25-2019, 04:32 AM   #23
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 16.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora
Posts: 41

Original Poster
Rep: Reputation: 1
HI,
I have commented the lines related to the oss
The cards limit has been set to 5
The result of "aplay -L" and "aplay -l" is the same

The result of the speaker test is the following:
Code:
eposatom ~ # speaker-test -c 2 -l 1 -D hw:0,0

speaker-test 1.0.28

Playback device is hw:0,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
Using the -D Default option the test remains into the first step and never ends.

Unfotunately my application is a kiosk application and I have only X installed and a mimnimum of graphic libraries based on GTK+-2.0.
Pavucontrol requires a lot of other libraries I would like to avoid to install
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:01 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration