Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
I can't get the sound to work on a new installation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
cesarguere
n00b
n00b


Joined: 05 Nov 2016
Posts: 56
Location: Buenos Aires, Argentina

PostPosted: Thu Jan 02, 2025 6:11 pm    Post subject: I can't get the sound to work on a new installation Reply with quote

Good day, experts!
I'm trying gentoo after some years again. I got almost everything working perfectly. But this time I can't get the sound to work. Kmix doesn't detect it (I use KDE), Firefox doesn't have sound either. But with VLC I can choose the output and the sound works there.

aplay -L
Code:
null
    Discard all samples (playback) or generate zero samples (capture)
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, MONITOR
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
    HDA NVidia, HDMI 1
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
    HDA NVidia, HDMI 2
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 3
    HDMI Audio Output
default:CARD=Generic
    HD-Audio Generic, ALC897 Analog
    Default Audio Device
sysdefault:CARD=Generic
    HD-Audio Generic, ALC897 Analog
    Default Audio Device
front:CARD=Generic,DEV=0
    HD-Audio Generic, ALC897 Analog
    Front output / input
surround21:CARD=Generic,DEV=0
    HD-Audio Generic, ALC897 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Generic,DEV=0
    HD-Audio Generic, ALC897 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Generic,DEV=0
    HD-Audio Generic, ALC897 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Generic,DEV=0
    HD-Audio Generic, ALC897 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Generic,DEV=0
    HD-Audio Generic, ALC897 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Generic,DEV=0
    HD-Audio Generic, ALC897 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers


lspci | grep -i audio
Code:
05:00.1 Audio device: NVIDIA Corporation TU116 High Definition Audio Controller (rev a1)
07:00.4 Audio device: Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller


# cat /usr/src/linux/.config | grep SND_HDA
Code:

CONFIG_SND_HDA=m
CONFIG_SND_HDA_GENERIC_LEDS=y
CONFIG_SND_HDA_INTEL=m
CONFIG_SND_HDA_HWDEP=y
CONFIG_SND_HDA_RECONFIG=y
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_BEEP_MODE=0
CONFIG_SND_HDA_PATCH_LOADER=y
CONFIG_SND_HDA_CIRRUS_SCODEC=m
CONFIG_SND_HDA_CIRRUS_SCODEC_KUNIT_TEST=m
CONFIG_SND_HDA_SCODEC_CS35L41=m
CONFIG_SND_HDA_CS_DSP_CONTROLS=m
CONFIG_SND_HDA_SCODEC_COMPONENT=m
CONFIG_SND_HDA_SCODEC_CS35L41_I2C=m
CONFIG_SND_HDA_SCODEC_CS35L41_SPI=m
CONFIG_SND_HDA_SCODEC_CS35L56=m
CONFIG_SND_HDA_SCODEC_CS35L56_I2C=m
CONFIG_SND_HDA_SCODEC_CS35L56_SPI=m
CONFIG_SND_HDA_SCODEC_TAS2781_I2C=m
CONFIG_SND_HDA_CODEC_REALTEK=m
CONFIG_SND_HDA_CODEC_ANALOG=m
CONFIG_SND_HDA_CODEC_SIGMATEL=m
CONFIG_SND_HDA_CODEC_VIA=m
CONFIG_SND_HDA_CODEC_HDMI=m
CONFIG_SND_HDA_CODEC_CIRRUS=m
CONFIG_SND_HDA_CODEC_CS8409=m
CONFIG_SND_HDA_CODEC_CONEXANT=m
CONFIG_SND_HDA_CODEC_SENARYTECH=m
CONFIG_SND_HDA_CODEC_CA0110=m
CONFIG_SND_HDA_CODEC_CA0132=m
CONFIG_SND_HDA_CODEC_CA0132_DSP=y
CONFIG_SND_HDA_CODEC_CMEDIA=m
CONFIG_SND_HDA_CODEC_SI3054=m
CONFIG_SND_HDA_GENERIC=m
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=1
CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM=y
# CONFIG_SND_HDA_CTL_DEV_ID is not set
CONFIG_SND_HDA_CORE=m
CONFIG_SND_HDA_DSP_LOADER=y
CONFIG_SND_HDA_COMPONENT=y
CONFIG_SND_HDA_I915=y
CONFIG_SND_HDA_EXT_CORE=m
CONFIG_SND_HDA_PREALLOC_SIZE=0


# lsmod | grep -i hda
Code:

snd_hda_codec_realtek   167936  1
snd_hda_codec_generic   118784  1 snd_hda_codec_realtek
snd_hda_scodec_component    16384  1 snd_hda_codec_realtek
snd_hda_codec_hdmi     81920  1
snd_hda_intel          57344  0
snd_intel_dspcfg       40960  1 snd_hda_intel
snd_hda_codec         192512  4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
snd_hda_core          131072  5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
snd_hwdep              16384  1 snd_hda_codec
snd_pcm               167936  4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_core
snd                   143360  8 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_pcm
/
ls /proc/asound/card0/codec#*
Code:
proc/asound/card0/codec#0


# head -n1 /proc/asound/card0/codec#0
Code:
Codec: Nvidia GPU 99 HDMI/DP



(I copied all these commands from a similar post to this one and ran them on my PC to show my results. But I really don't understand how to use them to solve my problem)
regards
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54667
Location: 56N 3W

PostPosted: Thu Jan 02, 2025 6:41 pm    Post subject: Reply with quote

cesarguere,

You have two PCI sound cards
Code:
05:00.1 Audio device: NVIDIA Corporation TU116 High Definition Audio Controller (rev a1)
07:00.4 Audio device: Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller

Card 0 will be your Video card HDMI outputs,
Card 1 is your analogue audio.

We need to know which card you would like to be the default and we need to see the content of /proc/asound/devices to help you write an /etc/asound.conf file.
Right now, alsa is trying to use card 0 device 0, which may not even be connected.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cesarguere
n00b
n00b


Joined: 05 Nov 2016
Posts: 56
Location: Buenos Aires, Argentina

PostPosted: Thu Jan 02, 2025 7:21 pm    Post subject: Reply with quote

NeddySeagoon wrote:
cesarguere,

You have two PCI sound cards
Code:
05:00.1 Audio device: NVIDIA Corporation TU116 High Definition Audio Controller (rev a1)
07:00.4 Audio device: Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller

Card 0 will be your Video card HDMI outputs,
Card 1 is your analogue audio.

We need to know which card you would like to be the default and we need to see the content of /proc/asound/devices to help you write an /etc/asound.conf file.
Right now, alsa is trying to use card 0 device 0, which may not even be connected.


thaks for answering!

/proc/asound/devices
Code:
  2: [ 0- 3]: digital audio playback
  3: [ 0- 7]: digital audio playback
  4: [ 0- 8]: digital audio playback
  5: [ 0- 9]: digital audio playback
  6: [ 0- 0]: hardware dependent
  7: [ 0]   : control
  8: [ 1- 0]: digital audio playback
  9: [ 1- 0]: digital audio capture
 10: [ 1- 2]: digital audio capture
 11: [ 1- 0]: hardware dependent
 12: [ 1]   : control
 33:        : timer


/etc/asound.conf : not exist!

I actually use both outputs. The HDMI (I have my PC connected to the TV and use its speakers) and the analog one I use to connect headphones. But first I would like to know how to use the HDMI output.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54667
Location: 56N 3W

PostPosted: Thu Jan 02, 2025 7:43 pm    Post subject: Reply with quote

cesarguere,

From /proc/asound/devices we can tell that the nVideo card is card 0 as it has no capture (input) devices.

Code:
  2: [ 0- 3]: digital audio playback
  3: [ 0- 7]: digital audio playback
  4: [ 0- 8]: digital audio playback
  5: [ 0- 9]: digital audio playback
  6: [ 0- 0]: hardware dependent
  7: [ 0]   : control


The first number, before the colon (:) is the device minor number.
The numbers in the brackets [ 0- 3] are the card and the device that we need for /etc/asound.conf.
The will be some trial and error here.

Create a file /etc/asound.conf that contains (my example)
Code:
defaults.pcm.card 0     # Video HDMI
defaults.pcm.device 10  # Display output

Your defaults.pcm.device number will be 3, 7, 8 or 9. They may not all exist as physical connectors on your video card.

Fix the permissions and ownership to be
Code:
 -rw-r--r-- 1 root root 1850 Jul 29  2023 /etc/asound.conf


Now the good news /etc/asound.conf is read every time an application needs it. No reboot or service restarts required.
Just restart your media player.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cesarguere
n00b
n00b


Joined: 05 Nov 2016
Posts: 56
Location: Buenos Aires, Argentina

PostPosted: Fri Jan 03, 2025 1:09 pm    Post subject: Reply with quote

NeddySeagoon wrote:
cesarguere,

From /proc/asound/devices we can tell that the nVideo card is card 0 as it has no capture (input) devices.

Code:
  2: [ 0- 3]: digital audio playback
  3: [ 0- 7]: digital audio playback
  4: [ 0- 8]: digital audio playback
  5: [ 0- 9]: digital audio playback
  6: [ 0- 0]: hardware dependent
  7: [ 0]   : control


The first number, before the colon (:) is the device minor number.
The numbers in the brackets [ 0- 3] are the card and the device that we need for /etc/asound.conf.
The will be some trial and error here.

Create a file /etc/asound.conf that contains (my example)
Code:
defaults.pcm.card 0     # Video HDMI
defaults.pcm.device 10  # Display output

Your defaults.pcm.device number will be 3, 7, 8 or 9. They may not all exist as physical connectors on your video card.

Fix the permissions and ownership to be
Code:
 -rw-r--r-- 1 root root 1850 Jul 29  2023 /etc/asound.conf


Now the good news /etc/asound.conf is read every time an application needs it. No reboot or service restarts required.
Just restart your media player.


Thanks for answering!

It's really weird what happens on my system. After trying to change /etc/asound.conf Firefox still has no sound (I tried all the variations -pcm.card 0 to 1 and pcm.device 0 to 10-)
konqueror has only analog sound (even if I delete /etc/asound.conf)
google-chrome has only analog sound (even if I delete /etc/asound.conf)
vlc starts on default device without sound but it has an option to change the output device. In vlc changing the device, I can choose between the options and I can hear sound from the tv's hdmi and I can change to the analog output too and it works perfectly.
kmix never recognizes the sound. System notifications have no sound.
with alsamixer I can modify the sound volume of konqueror and chrome. but if I change to nvidia hda card I see 4 s/pdif outputs that I can't modify and no sound in the system.
It seems to me that creating and modifying the /etc/asound.conf file produced no changes.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54667
Location: 56N 3W

PostPosted: Fri Jan 03, 2025 3:22 pm    Post subject: Reply with quote

cesarguere,

Digital outputs do not have volume controls, only [MM] mute switches.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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