You are not logged in.

#1 2023-02-10 16:57:49

dgreenwald
Member
Registered: 2023-02-10
Posts: 2

[SOLVED] speaker-test successful but no sound in applications (ALSA)

Edit: the system started working by itself for some applications, but the reply below contains useful points about flaws in my setup as well as corrections and best practice.

Hi all,

I am a longtime Arch user and have run into sound problems on my machine. I have been able to get ALSA working, in the sense that speaker-test produces sound I can hear, but I am not able to get sound from any applications (chromium, spotify, etc). I will post some outputs that I think might be useful, but am happy to generate more. Any help would be much appreciated, and I apologize if I am not providing all the needed info -- I don't know much about the technical side of sound. Thanks in advance!

Exhibit A. This actually returns no output when I run the command (i.e., I didn't forget to post it).

 
sudo fuser -v /dev/snd/* 

Exhibit B

cat ~/.asoundrc
# ALSA library configuration file

# Include settings that are under the control of asoundconf(1).
# (To disable these settings, comment out this line.)
</home/dan/.asoundrc.asoundconf>

pcm.!default {
        type hw
        card 2
}

ctl.!default {
        type hw
        card 2
}

Exhibit C

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 7: HDMI 1 [HP Z27]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 8: HDMI 2 [HP Z27]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 11: HDMI 5 [HDMI 5]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Generic [HD-Audio Generic], device 0: ALC1220 Analog [ALC1220 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Generic [HD-Audio Generic], device 1: ALC1220 Digital [ALC1220 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: X [Yeti X], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Exhibit D

speaker-test -c 2

speaker-test 1.2.8

Playback device is default
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 1048576
Period size range from 32 to 524288
Using max buffer size 1048576
Periods = 4
was set period_size = 262144
was set buffer_size = 1048576
 0 - Front Left
 1 - Front Right
Time per period = 10.930744

Last edited by dgreenwald (2023-02-10 18:02:30)

Offline

#2 2023-02-10 17:06:32

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,919

Re: [SOLVED] speaker-test successful but no sound in applications (ALSA)

That kind of an ALSA configuration will break all applications that lookup the default ALSA device via the "default" PCM (aplay -L will not have a "default" device) and additionally disable dmix so only one application can access the card at a time. You should also remove /home/dan/.asoundrc.asoundconf that will normally contain pointless cruft prone to breakage.

The non-destructive way to do this via ALSA configuration is

defaults.pcm.card 2;
defaults.ctl.card 2;

#Or better to not be reliant on the index
#defaults.pcm.!card "Generic";
#defaults.ctl.!card "Generic";

Is there a particular reason you want to stick to ALSA only? Generally a sound server will make handling more predictable and guaranteed especially assuming you'd want to switch between devices as needed.

Edit, I've seen the report, glad to hear it worked, but this doesn't change the points I've made above, keep those in mind, should you notice things still not working as expected.

Last edited by V1del (2023-02-10 17:09:53)

Offline

#3 2023-02-10 18:05:13

dgreenwald
Member
Registered: 2023-02-10
Posts: 2

Re: [SOLVED] speaker-test successful but no sound in applications (ALSA)

Thanks, that's very helpful, I implemented your suggestions.

I have no reason for avoiding a sound server other than I did not really understand the different roles of the different sound software prior to this issue, and I don't switch devices much.

If I add something like pulseaudio would you recommend removing the .asoundrc configurations, or will those still be necessary?

Thanks again.

Offline

#4 2023-02-11 21:26:54

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,919

Re: [SOLVED] speaker-test successful but no sound in applications (ALSA)

You'd remove the asoundrc and install pulseaudio-alsa instead

Offline

Board footer

Powered by FluxBB