You are not logged in.
Background info: I had a working sound, but through the process of trying to bind keys to volume control I got way off track, and broke my sound. I had pulseaudio and pavucontrol which I uninstalled to use pure alsa. Thats where things started. At this point I cant remember eveything I did. I have changed configs and many other things. please help
OS: Arch Linux x86_64
Kernel: 5.17.4-arch1-1
Uptime: 2 hours, 33 mins
Packages: 737 (pacman)
Shell: bash 5.1.16
Resolution: 1920x1080
WM: dwm
Theme: Adwaita [GTK2/3]
Icons: Adwaita [GTK2/3]
Terminal: st
Terminal Font: Liberation Mono
CPU: AMD Ryzen 5 3600 (12) @ 3.600GHz
GPU: NVIDIA GeForce GTX 1080
Memory: 902MiB / 15940MiB
[me@archme ~]$ pacman -Q | grep alsa
alsa-firmware 1.2.4-2
alsa-lib 1.2.6.1-1
alsa-oss 1.1.8-4
alsa-plugins 1:1.2.6-3
alsa-topology-conf 1.2.5.1-1
alsa-ucm-conf 1.2.6.3-1
alsa-utils 1.2.6-1
python-pyalsa 1.2.6-2
zita-alsa-pcmi 0.4.0-1
[me@archme ~]$ speaker-test
speaker-test 1.2.6
Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Playback open error: -2,No such file or directory
[me@archme ~]$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 11: HDMI 5 [HDMI 5]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 12: HDMI 6 [HDMI 6]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Generic [HD-Audio Generic], device 0: ALCS1200A Analog [ALCS1200A Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Generic [HD-Audio Generic], device 1: ALCS1200A Digital [ALCS1200A Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: AUDIO [USB AUDIO], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
contents of .asoundrc
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
Last edited by drafting_basket (2022-04-27 14:39:08)
Offline
your .asoundrc is set to use hdmi audio for output (card 1), is that what you want ?
if not change it to "card 2" for analog audio or "card 3" for usb audio.
Offline
Please edit your post to add [ code ] tags (click on the BBCode link under the text entry box to learn more).
Then rerun speaker-test without sudo as that's not really expected to work (as it ignores your user's ~/.asoundrc). Further, don't randomly run commands as root without reason; that's far more likely to create new problems than to solve existing ones.
Finally, you said you removed pulseaudio just to bind keys to changing volume?? You can do that just fine with pulseaudo. I personally don't much care for pulseaudio - it doesn't suit me - but if you were using it before and happy, why not just reinstall it?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Also even if you found a working index number, setting up your default like that breaks dmix and will only leave you with a single application able to play sound at a time. The simplest definition to simply change the default device is overriding the defaults node for specific end points, in this case
defaults.pcm.card 1
defaults.ctl.card 1
but as already stated it's somewhat unlikely you want your HDMI device and you don't have a card 0 where did that disappear to? Can you post
sudo dmesg | grep snd
as well?
FWIW I agree with the above assertion, if your only issue with the way pulse did things is that you had problems with setting up your keybinds then that's the problem you want to fix and it's trivial to create relevant shortcuts that actually work and play nice with pulse.
Last edited by V1del (2022-04-27 13:35:18)
Offline
your .asoundrc is set to use hdmi audio for output (card 1), is that what you want ?
I do not know what option of the 3 is the right one for me. I have a set of cheap usb speakers that I use and I also use a set of head phones with the audio jack. Does my choice of output device make a difference on my default card choice?
if not change it to "card 2" for analog audio or "card 3" for usb audio.
I have tried changing the default card to all 3 options with no success.
The simplest definition to simply change the default device is overriding the defaults node for specific end points, in this case
defaults.pcm.card 1 defaults.ctl.card 1
I have attempted to do this with no success. but that was closer to the beginning of my problems. does this code go into my .asoundrc?
[me@archme ~]$ sudo dmesg | grep snd
[ 3.935084] snd_hda_intel 0000:08:00.1: Disabling MSI
[ 3.935097] snd_hda_intel 0000:08:00.1: Handle vga_switcheroo audio client
[ 3.935243] snd_hda_intel 0000:0a:00.4: enabling device (0000 -> 0002)
[ 4.048589] snd_hda_codec_realtek hdaudioC2D0: ALCS1200A: SKU not ready 0x00000000
[ 4.049067] snd_hda_codec_realtek hdaudioC2D0: autoconfig for ALCS1200A: line_outs=3 (0x14/0x15/0x16/0x0/0x0) type:line
[ 4.049071] snd_hda_codec_realtek hdaudioC2D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[ 4.049073] snd_hda_codec_realtek hdaudioC2D0: hp_outs=1 (0x1b/0x0/0x0/0x0/0x0)
[ 4.049074] snd_hda_codec_realtek hdaudioC2D0: mono: mono_out=0x0
[ 4.049075] snd_hda_codec_realtek hdaudioC2D0: dig-out=0x1e/0x0
[ 4.049076] snd_hda_codec_realtek hdaudioC2D0: inputs:
[ 4.049078] snd_hda_codec_realtek hdaudioC2D0: Front Mic=0x19
[ 4.049079] snd_hda_codec_realtek hdaudioC2D0: Rear Mic=0x18
[ 4.049080] snd_hda_codec_realtek hdaudioC2D0: Line=0x1a
[ 5.307732] usbcore: registered new interface driver snd-usb-audio
FWIW I agree with the above assertion, if your only issue with the way pulse did things is that you had problems with setting up your keybinds then that's the problem you want to fix and it's trivial to create relevant shortcuts that actually work and play nice with pulse.
To be honest I got frustrated with pulseaudio and pavucontrol when setting up keybindings and things simply went awry. Also when I learned that ALSA is include in the kernel my thinking was " why use pulseaudio if I can achieve the same results with the the base linux programs? " As a rule for my machine I try to use the defaults as often as possible as well as the least number of programs to achieve the level of functionality I need. Am I over doing it in this case?
I personally don't much care for pulseaudio - it doesn't suit me
I had read this sentiment on other forums and opted to not use it, as stated above.
but if you were using it before and happy, why not just reinstall it?
I was not happy with my audio configuration, I had sound but no volume control. I just didnt have time to configure it the way I wanted.
Finally I think I have found part of my problem: I do not have a asound.conf
[me@archme ~]$ ls /etc | grep asound.conf
[me@archme ~]
thanks y'all
Last edited by drafting_basket (2022-04-27 15:32:18)
Offline
I have tried changing the default card to all 3 options with no success.
And are you running speaker-test as your regular user (without sudo)? Changing the .asoundrc is irrelevant if you run the test as root.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
And are you running speaker-test as your regular user (without sudo)? Changing the .asoundrc is irrelevant if you run the test as root.
I have edited my post to use speaker-test without sudo. Sorry for the delay, I submitted my reply and then went back to edit it afterwards. please see above.
Offline
I do not know what option of the 3 is the right one for me. I have a set of cheap usb speakers that I use and I also use a set of head phones with the audio jack. Does my choice of output device make a difference on my default card choice?
Yes, the config you define here is static, it will be applied once for a sound producing application and can't be changed to another device unless you stop the stream (... maybe even stopping the entire application depending on implementation) changing the config and restarting the stream. If that's something you expect to be able to do on the fly - congratulations you've just found out why pulse exists.
I have attempted to do this with no success. but that was closer to the beginning of my problems. does this code go into my .asoundrc?
Yes, and it should be the only content for a basic test, fwiw dmesg dump looks harmless enough
To be honest I got frustrated with pulseaudio and pavucontrol when setting up keybindings and things simply went awry. Also when I learned that ALSA is include in the kernel my thinking was " why use pulseaudio if I can achieve the same results with the the base linux programs? " As a rule for my machine I try to use the defaults as often as possible as well as the least number of programs to achieve the level of functionality I need. Am I over doing it in this case?
You are free to do whatever, fact of the matter is configuring plain ALSA correctly with multiple devices can be quite involved and you still can't do certain things a "modern" user might take for granted if you're limiting yourself to just ALSA. If you could there would be no reason for pulse to exist. As already mentioned above, probably the biggest thing you'll have is that you can't readjust the device you are playing from on the fly without interruptions so if you intend to switch between the USB speakers and the headphones (connected to the jack on the PC/laptop directly I presume?) then you cannot do that without restarting all your applications that are producing audio with just ALSA.
To provide a counter point to the negative sentiments regarding pulse, I have multiple distinct devices that I regularly switch audio between (usb headset and a speaker setup on the integrated card) switching applications between the two on the fly is absolutely trivial and I've used pulse since it's inception for this usecase.
I was not happy with my audio configuration, I had sound but no volume control. I just didnt have time to configure it the way I wanted.
Chances are that your volume control possibilities with plain ALSA are going to be worse are quite high, e.g. it's often the case that an USB device does not expose a mixer to the operating system and will rely on a software volume, which pulse will set up automatically - and ALSA needs dedicated configuration for.
Finally I think I have found part of my problem: I do not have a asound.conf
[me@archme ~]$ ls /etc | grep asound.conf [me@archme ~]
As already mentioned as long as you run things as your user then your ~/.asoundrc will be honored and it doesn't strictly matter whether you configure things there or in /etc/asound.conf. This distinction is for whether you want to make a change system wide or user specific.
FWIW we should first establish a baseline to go from, try running (i'm assuming you don't actually want the HDMI device , or are your headphones connected to the monitor's jack out?)
speaker-test -Dhw:2,0 -c2
speaker-test -Dhw:2,1 -c2
speaker-test -Dhw:3 -c2
this should bypass your config and directly play to a device, tell us which one produces noise and should be your preferred default. Also to get some other things out of the way post
aplay -L
amixer -c1
amixer -c2
amixer -c3
Last edited by V1del (2022-04-27 16:32:08)
Offline
If that's something you expect to be able to do on the fly - congratulations you've just found out why pulse exists.
Thank you for the detailed explanation. I will implement pulseaudio once is it confirmed there arent other issues. speaking of which:
speaker-test -Dhw:3 -c2 output sound successfully out of my usb speakers. yah!
[me@archme ~]$ speaker-test -Dhw:3 -c2
speaker-test 1.2.6
Playback device is hw:3
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 96 to 96000
Period size range from 48 to 48000
Using max buffer size 96000
Periods = 4
was set period_size = 24000
was set buffer_size = 96000
0 - Front Left
1 - Front Right
^CTime per period = 3.485396
[me@archme ~]$ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
lavrate
Rate Converter Plugin Using Libav/FFmpeg Library
samplerate
Rate Converter Plugin Using Samplerate Library
speexrate
Rate Converter Plugin Using Speex Resampler
jack
JACK Audio Connection Kit
oss
Open Sound System
pulse
PulseAudio Sound Server
speex
Plugin using Speex DSP (resample, agc, denoise, echo, dereverb)
upmix
Plugin for channel upmix (4,6,8)
vdownmix
Plugin for channel downmix (stereo) with a simple spacialization
hdmi:CARD=NVidia,DEV=0
HDA NVidia, HDMI 0
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
hdmi:CARD=NVidia,DEV=4
HDA NVidia, HDMI 4
HDMI Audio Output
hdmi:CARD=NVidia,DEV=5
HDA NVidia, HDMI 5
HDMI Audio Output
hdmi:CARD=NVidia,DEV=6
HDA NVidia, HDMI 6
HDMI Audio Output
usbstream:CARD=NVidia
HDA NVidia
USB Stream Output
sysdefault:CARD=Generic
HD-Audio Generic, ALCS1200A Analog
Default Audio Device
front:CARD=Generic,DEV=0
HD-Audio Generic, ALCS1200A Analog
Front output / input
surround21:CARD=Generic,DEV=0
HD-Audio Generic, ALCS1200A Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Generic,DEV=0
HD-Audio Generic, ALCS1200A Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=Generic,DEV=0
HD-Audio Generic, ALCS1200A Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Generic,DEV=0
HD-Audio Generic, ALCS1200A Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Generic,DEV=0
HD-Audio Generic, ALCS1200A Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Generic,DEV=0
HD-Audio Generic, ALCS1200A Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Generic,DEV=0
HD-Audio Generic, ALCS1200A Digital
IEC958 (S/PDIF) Digital Audio Output
usbstream:CARD=Generic
HD-Audio Generic
USB Stream Output
sysdefault:CARD=AUDIO
USB AUDIO, USB Audio
Default Audio Device
front:CARD=AUDIO,DEV=0
USB AUDIO, USB Audio
Front output / input
surround21:CARD=AUDIO,DEV=0
USB AUDIO, USB Audio
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=AUDIO,DEV=0
USB AUDIO, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=AUDIO,DEV=0
USB AUDIO, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=AUDIO,DEV=0
USB AUDIO, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=AUDIO,DEV=0
USB AUDIO, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=AUDIO,DEV=0
USB AUDIO, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=AUDIO,DEV=0
USB AUDIO, USB Audio
IEC958 (S/PDIF) Digital Audio Output
usbstream:CARD=AUDIO
USB AUDIO
USB Stream Output
[me@archme ~]$ amixer -c1
Simple mixer control 'IEC958',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958',1
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958',2
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958',3
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958',4
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958',5
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958',6
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
[me@archme ~]$ amixer -c2
Simple mixer control 'Master',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 60 [69%] [-20.25dB] [on]
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 87 [100%] [0.00dB] [on]
Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'PCM',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [0.00dB]
Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Front',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 87 [100%] [0.00dB] [on]
Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Front Mic',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 20 [65%] [-4.50dB] [on]
Front Right: Playback 20 [65%] [-4.50dB] [on]
Simple mixer control 'Front Mic Boost',0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 3
Front Left: 2 [67%] [20.00dB]
Front Right: 2 [67%] [20.00dB]
Simple mixer control 'Surround',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 87 [100%] [0.00dB] [on]
Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Center',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'LFE',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Line',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 18 [58%] [-7.50dB] [on]
Front Right: Playback 18 [58%] [-7.50dB] [on]
Simple mixer control 'Line Boost',0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 3
Front Left: 2 [67%] [20.00dB]
Front Right: 2 [67%] [20.00dB]
Simple mixer control 'IEC958',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958 Default PCM',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'Beep',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 31 [100%] [12.00dB] [on]
Front Right: Playback 31 [100%] [12.00dB] [on]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 63
Front Left: Capture 39 [62%] [12.00dB] [on]
Front Right: Capture 39 [62%] [12.00dB] [on]
Simple mixer control 'Capture',1
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 63
Front Left: Capture 0 [0%] [-17.25dB] [off]
Front Right: Capture 0 [0%] [-17.25dB] [off]
Simple mixer control 'Auto-Mute Mode',0
Capabilities: enum
Items: 'Disabled' 'Enabled'
Item0: 'Enabled'
Simple mixer control 'Input Source',0
Capabilities: cenum
Items: 'Front Mic' 'Rear Mic' 'Line'
Item0: 'Front Mic'
Simple mixer control 'Input Source',1
Capabilities: cenum
Items: 'Front Mic' 'Rear Mic' 'Line'
Item0: 'Front Mic'
Simple mixer control 'Loopback Mixing',0
Capabilities: enum
Items: 'Disabled' 'Enabled'
Item0: 'Enabled'
Simple mixer control 'Rear Mic',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 31 [100%] [12.00dB] [on]
Front Right: Playback 31 [100%] [12.00dB] [on]
Simple mixer control 'Rear Mic Boost',0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 3
Front Left: 3 [100%] [30.00dB]
Front Right: 3 [100%] [30.00dB]
[me@archme ~]$ amixer -c3
Simple mixer control 'PCM',0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 338
Mono:
Front Left: Playback 231 [68%] [-20.11dB] [on]
Front Right: Playback 231 [68%] [-20.11dB] [on]
Offline
speaker-test -Dhw:3 -c2 output sound successfully out of my usb speakers. yah!
Then there's your problem. Your asoundrc specifies "card 1" but you want "card 3" as your default if you stick with pure alsa. Though in some cases these numbers can / will change on reboot - so you should either configure modprobe to load them in the desired order or just not rely on numeric identifiers (both options are elaborated on in the wiki's alsa page).
Last edited by Trilby (2022-04-27 18:15:27)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Then there's your problem. Your asoundrc specifies "card 1" but you want "card 3" as your default if you stick with pure alsa.
ok after I updated my .asoundrc to reflect my default device as card 3 and rebooted I now have sound!
contents of .asoundrc
defaults.pcm.card 3
defaults.ctl.card 3
Additionally I will install and configure Pulseaudio!
Thank y'all very much for the help
Last edited by drafting_basket (2022-04-27 18:20:32)
Offline
I didn't intend to "pressure" you into using pulseaudio, but just mention some things you might not be aware of. Also if you do want to set up pulseaudio then all of this is moot, as pulseaudio handles devices in it's own way and you should remove this config and install pulseaudio-alsa instead.
If you do consider this [SOLVED] for your purposes, please mark it as such by editing the topic title in the initial post.
Last edited by V1del (2022-04-27 19:23:53)
Offline