How to get started with Audio in Linux

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
johnnypanrike
Posts: 6
Joined: 2022-09-21 22:46

How to get started with Audio in Linux

#1 Post by johnnypanrike »

Dear Forum,

I run Debian Bullseye.

I am quite lost when it comes to audio. I suspect that my system is not working somehow but since I know so little of how it should work, I find it hard to ask good questions.

So I really do not know where to begin, educate myself to be able to ask good questions or submit a random inquiry about things that do not work?

For example I get a perpetual “Establishing connection to PulseAudio. Please wait …” when I start Pulse Audio Volume Control, can this be fixed? Does it need to be fixed, what does it even mean? It sounds like something is wrong for sure and I bet that I would like to be able to runs Pulse Audio Volume Control.

I have been able to get my headphones working with “amixer set ‘Headphone’ ‘unmute’” and then “amixer set ‘Headphone’ ‘unmute’” so amixer seems to be a useful tool. But then, how does that tool fit into a bigger picture? How can I learn about the bigger picture?

So can someone help me making a sort of diagnosis of my system and also point me to some sort of tutorial on sound, I have of course googled but I seem to be unable to find something that takes things from the ground up. Most tutorials are too advanced for me at this point.

Kindest regards
Johnny

User avatar
Head_on_a_Stick
Posts: 13992
Joined: 2014-06-01 17:46
Location: /dev/chair
Has thanked: 51 times
Been thanked: 77 times

Re: How to get started with Audio in Linux

#2 Post by Head_on_a_Stick »

The usual suspects for audio problems are

Code: Select all

cat /proc/asound/cards
Or

Code: Select all

aplay -l
Both provide the same information (ish).

From your description it sounds like PulseAudio isn't working, check with

Code: Select all

pgrep -a pulse
And as you claim to be running Debian stable but it has problems I think we need to see the output of

Code: Select all

apt policy
See also https://wiki.debian.org/DontBreakDebian

In respect of asking questions see http://catb.org/~esr/faqs/smart-questions.html
Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher.

johnnypanrike
Posts: 6
Joined: 2022-09-21 22:46

Re: How to get started with Audio in Linux

#3 Post by johnnypanrike »

Thank you very much for your response.

Indeed it seems that pulse is not running, the output of

Code: Select all

pgrep -a pulse
is empty. However, in my ignorance I unfortunately do not know how to use that information. The result of

Code: Select all

aplay -l
is

Code: Select all

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC3254 Analog [ALC3254 Analog]
  Subdevices: 0/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
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
and the output of

Code: Select all

apt policy
is

Code: Select all

Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://ftp.se.debian.org/debian bullseye-updates/main amd64 Packages
     release v=11-updates,o=Debian,a=stable-updates,n=bullseye-updates,l=Debian,c=main,b=amd64
     origin ftp.se.debian.org
 500 http://security.debian.org/debian-security bullseye-security/non-free amd64 Packages
     release v=11,o=Debian,a=stable-security,n=bullseye-security,l=Debian-Security,c=non-free,b=amd64
     origin security.debian.org
 500 http://security.debian.org/debian-security bullseye-security/main amd64 Packages
     release v=11,o=Debian,a=stable-security,n=bullseye-security,l=Debian-Security,c=main,b=amd64
     origin security.debian.org
 500 http://ftp.se.debian.org/debian bullseye/contrib amd64 Packages
     release v=11.5,o=Debian,a=stable,n=bullseye,l=Debian,c=contrib,b=amd64
     origin ftp.se.debian.org
 500 http://ftp.se.debian.org/debian bullseye/non-free amd64 Packages
     release v=11.5,o=Debian,a=stable,n=bullseye,l=Debian,c=non-free,b=amd64
     origin ftp.se.debian.org
 500 http://ftp.se.debian.org/debian bullseye/main amd64 Packages
     release v=11.5,o=Debian,a=stable,n=bullseye,l=Debian,c=main,b=amd64
     origin ftp.se.debian.org
Pinned packages:
I have installed some packages / applications from outside of Debian's repository, but not so many. (One for wifi and two others for downloading videos from youtube) but other that I believe I otherwise always have gone with

Code: Select all

sudo apt-get install
whenever I needed something. I have also recently done a full reinstall from scratch so I hope that if I have introduced inconsistencies that this will be fairly easy to rectify.

Kindest regards
Johnny

User avatar
Head_on_a_Stick
Posts: 13992
Joined: 2014-06-01 17:46
Location: /dev/chair
Has thanked: 51 times
Been thanked: 77 times

Re: How to get started with Audio in Linux

#4 Post by Head_on_a_Stick »

So which desktop is this?

Can we see the output of

Code: Select all

cat /proc/1/comm
These commands should get your headphones working without having to use amixer every time:

Code: Select all

$ amixer set 'Headphone' 'unmute'
$ amixer set 'Auto-Mute Mode' 'Enabled'
# alsactl store
And this might get PA working:

Code: Select all

start-pulseaudio-x11
If it doesn't work post the full error message. Thanks.

EDIT: and which non-Debian software did you install, exactly? How did you install it?
Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher.

johnnypanrike
Posts: 6
Joined: 2022-09-21 22:46

Re: How to get started with Audio in Linux

#5 Post by johnnypanrike »

Thanks again, certainly, here are the reponses:

I run lxde as a desktop.

Code: Select all

cat /proc/1/comm
yields

Code: Select all

systemd
I found the amixer commands for setting the Headphone volume and it seems to be persistent between boots so I think that bit is ok. However I got a

Code: Select all

bash: alsactl: command not found
when trying to run alsactl. I searched for what to install to get it, but I did not find it.

Code: Select all

start-pulseaudio-x11
got the error message

Code: Select all

Connection failure: Connection refused
pa_context_connect() failed: Connection refused
I slapped on a sudo there, but still the same error.

I have installed youtube-dl I believe it is a statically linked executable and it is located at /usr/local/bin. Similarly yt-dlp which is an improvement of youtube-dl. I have also added the non-free drivers to get wifi working, I installed that with sudo apt-get install though, I believe the name of the package is lwlwifi.

johnnypanrike
Posts: 6
Joined: 2022-09-21 22:46

Re: How to get started with Audio in Linux

#6 Post by johnnypanrike »

This actually got the Pulseaudio running:

Code: Select all

mv ~/.config/pulse ~/.config/pulse.old
pulseaudio --start
I can now also run PulseAudio Volume Control ! :-)

User avatar
NorthEast
Posts: 218
Joined: 2018-11-18 04:35
Has thanked: 4 times
Been thanked: 11 times

Re: How to get started with Audio in Linux

#7 Post by NorthEast »

johnnypanrike wrote:
when trying to run alsactl. I searched for what to install to get it, but I did not find it.
alsactl is in the alsa-utils package. If you know the filename you can find the package it resides in at: https://www.debian.org/distrib/packages

johnnypanrike
Posts: 6
Joined: 2022-09-21 22:46

Re: How to get started with Audio in Linux

#8 Post by johnnypanrike »

Thank you for your reply. I think then that there must some misunderstanding, this is from a prompt this evening:

Code: Select all

johnny@aramies:~$ sudo apt-get install alsa-utils
[sudo] password for johnny: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
alsa-utils is already the newest version (1.2.4-1).
The following packages were automatically installed and are no longer required:
  python3-pyxattr rtmpdump
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
johnny@aramies:~$ alsactl
bash: alsactl: command not found
johnny@aramies:~$ 


Is there really some sort of deeper trouble with my system?

User avatar
NorthEast
Posts: 218
Joined: 2018-11-18 04:35
Has thanked: 4 times
Been thanked: 11 times

Re: How to get started with Audio in Linux

#9 Post by NorthEast »

Doesn't look like deeper trouble on the matter of alsactl.
alsactl is indeed in the alsa-utils package:

Code: Select all

[tom@owl ]$ apt-file show alsa-utils
<snip>
alsa-utils: /usr/sbin/alsactl
<snip>
It resides in the /usr/sbin directory which is likely not in the PATH of the user (you) on your system, which would be why the user can't run it. You can check the path that the user has available with:

Code: Select all

echo $PATH
To run alsactl, you can do so as root, or use the full path on the command line as user, e.g.:

Code: Select all

/usr/sbin/alsactl info

johnnypanrike
Posts: 6
Joined: 2022-09-21 22:46

Re: How to get started with Audio in Linux

#10 Post by johnnypanrike »

Ah, yes, thank you this makes sense. I *do* have alsactl as root so I'll have to sudo the times I need run alsactl.

I think there is only one minor issue left now, and that is that to start and successfully run pavucontrol I need to manually invoke

Code: Select all

pulseaudio --start
and directly after that start pavucontrol becuase it also seems that pavucontrol only shows "Dummy Device" if it is started later on in the session. This is manageable albeit I bet this is not how it is supposed to work. I'll let it settle for a while before asking questions about it.

Thank you for all your help.

Kindest regards
Johnny

Post Reply