Hot answers tagged

69

As @Teresa-e-Junior pointed out pactl is the tool to use: First of all we might want to get the IDs of our PA sinks. On my system this is what I get: $ pactl list short sinks 0 alsa_output.pci-0000_01_00.1.hdmi-surround module-alsa-card.c s16le 6ch 44100Hz SUSPENDED 1 alsa_output.pci-0000_00_1b.0.analog-stereo module-alsa-card.c ...


41

I think you can do this with PulseAudio. I found this tutorial that shows how, titled: Redirect Audio Out to Mic In (Linux). General Steps Run the application pavucontrol. Go to the "Input Devices" tab, and select "Show: Monitors" from the bottom of the window. If your computer is currently playing audio, you should see a bar showing ...


35

To mute: amixer -D pulse sset Master mute To unmute: amixer -D pulse sset Master unmute To turn volume up 5%: amixer -D pulse sset Master 5%+ To turn volume down 5%: amixer -D pulse sset Master 5%-


25

When setting up a new Arch install I usually do the following: pacman -S alsa-utils Then fire up alsamixer with alsamixer Go to 'Master' then press M and then keep hitting the up key to bring the sound levels up. I do that for any other inputs I want like pcm etc. Then do speaker-test -c2 with the number being how many channels you want to test. You ...


25

It's all about multiplexing. I don't need to multiplex sounds from or to several sound cards Ah, but you do! If you want to be able to play audio from two sources at once, ever, for any reason, you need multiplexing. OSX and Windows handle Multiplexing in the Kernel (but still in software), which is why this never/rarely comes up on those platforms. ...


24

I found out what the problem was. The command defaults because I wasn't specifying a 2-channel (stereo) 192kHz audio input. Here's an example of a command that did work: $ arecord -f S24_LE -c 2 -r 192000 -d 20 test.wav The -c 2 is what fixed my commands.


22

Set Headphone Mic Boost gain to 10dB. Any other value seems to cause the irritating background noise in headphones. This can be done with amixer: amixer -c0 sset 'Headphone Mic Boost' 10dB To make this happen automatically every time you headphones are connected install acpid. Start it by running: sudo systemctl start acpid.service Enable it by running: ...


20

pactl/pacmd (unlike amixer) allows increasing volume over 100% :-). pactl set-sink-mute 0 toggle # toggle mute, also you have true/false pactl set-sink-volume 0 0 # mute (force) pactl set-sink-volume 0 100% # max pactl set-sink-volume 0 +5% # +5% (up) pactl set-sink-volume 0 -5% # -5% (down) Manual settings over 100% is possible in pavucontrol (...


20

You can get the number of sink Input with pactl command. $ pactl list sink-inputs ... Sink Input #7119 Driver: protocol-native.c Owner Module: 12 Client: 6298 Sink: 0 ... Properties: application.icon_name = "google-chrome" media.name = "Playback" application.name = "Chromium" ... Using this number(#7119), you specify the sink ...


16

I recommend asoundconf, which will take care of generating a proper .asoundrc . List the available sound cards: asoundconf list Set the default one: asoundconf set-default-card PARAMETER Unmute it if necessary through either alsamixer(ncurses) or amixer (cli)


16

I just wandered upon this post and see you are struggling with the answer to this as I was. This is what fixed it for me: Go into alsamixer and set everything the way you want it, then exit and type this: sudo alsactl store That will store the current config of alsamixer and it should keep the config.


14

Turning all hardware mixers up worked. Edit: Actually just found another, slightly hacky, work around to this issue after it came back a few boots later by using an ladpsa amplifier and compressor in Arch. Something similar to this could probably work in other distros too. Install ladspa plugins: pacman -S ladspa-plugins Create an .asoundrc file in the ...


13

The following commands can be used to manipulate the PulseAudio sound server: pacmd - Used to reconfigure a PulseAudio sound server during runtime. pactl - Used to control a running PulseAudio sound server. Here are some examples of how they function: pacmd list-sinks :: list name or index number of possible sinks pacmd set-default-sink [sinkname] :: set ...


13

One way could perhaps be to use amixer. Jack plugged in: $ amixer -c 0 contents numid=29,iface=CARD,name='Front Headphone Jack' ; type=BOOLEAN,access=r-------,values=1 : values=on ... Jack not plugged in: $ amixer -c 0 contents numid=29,iface=CARD,name='Front Headphone Jack' ; type=BOOLEAN,access=r-------,values=1 : values=off ... So for that ...


12

I solved this issue as follows: First, load the snd-aloop module: sudo modprobe snd-aloop This will create a new device called Loopback: ± % cat /proc/asound/cards !10017 0 [PCH ]: HDA-Intel - HDA Intel PCH ...


11

To improve upon dirkt's answer, due to the way shell arguments are interpreted, spaces in PulseAudio properties such as the description require double quoting: pacmd 'update-sink-proplist alsa_output.my-card.analog-stereo device.description="My Card" ' To run a command automatically on every login, you can append it to your PulseAudio startup script (...


10

I finally found an answer to this problem based on this post from another forum (see "Attempt 1b" for reference). According to it, one can specify the module id, even if the driver used is the same: alias char-major-116 snd alias snd-card-0 snd-hda-intel alias snd-card-1 snd-hda-intel options snd cards_limit=2 options snd-hda-intel id=SB index=0 options ...


10

ALSA stands for Advanced Linux Sound Architecture, I'd encourage you to poke around their project website if you're truly curious. Specifically I'd take a look at the "I'm new to ALSA pages & tutorials. The ArchLinux wiki probably describes it the best. The Advanced Linux Sound Architecture (ALSA) is a Linux kernel component which replaced the ...


10

And fixed! When looking around, the issue arised when I installed GDM to handle logins, which of course has Gnome attached to it, which in turn requires Pulseaudio. That set my default device to Pulseaudio which messed stuff up. What I did to solve my problem was to edit /etc/pulse/daemon.conf. Uncomment the following line default-sample-rate = 42100 and ...


10

Based on correspondence with the poster (see comments), it turned out that the sound card was muted inside pavucontrol.


10

Apparently there is no option for firefox, but you can manipulate the ALSA output through environment variables. Try for example: ALSA_PCM_CARD=bluetooth firefox Alternatively, if this does not work, try scripting a little your .asoundrc pcm.!default { type plug slave.pcm { @func getenv vars [ ALSAPCM ] default "hw:hdmi" } } (...


9

cat /dev/urandom | aplay is the command that needs to be typed. If you aren't in "audio" group, you could prefix aplay with sudo. This also doesn't interfere with any daemons (I was running pulseaudio while this command was active and correctly heard the "noise". EDIT (Aug 6, 2019): In an older version of the command I also had a padsp tee thing between the ...


9

The solution turned out to be simpler than it appeared. The output of fuser -v /dev/snd/* revealed jackd was silently hogging the audio card even after QjackCtl supposedly killed it. Running killall jackd fixed the problem. The problem wasn't with PulseAudio, but rather jackd running invisibly in the background.


8

First identify your microphone device file; should be something similar to /dev/snd/pcmC0D0c. To help you find the device file, you can start a test recording with arecord or such, then do lsof | grep '/dev/snd'; it will list all programs and their associated device file. Then you can peek usage of the microphone using fuser /dev/snd/pcmC0D0c. It will ...


8

You can update the device.description with update-sink-proplist and update-source-proplist, e.g. pacmd update-sink-proplist alsa_output.my-card.analog-stereo device.description=MyCard I haven't figured out how to make that parse spaces in the name properly.


8

You cannot decode ogg files with aplay. According to the man page, the only formats aplay understands are voc, wav, raw and au. My guess is that aplay interprets the ogg file as raw data, hence the white noise. Use some other program that can actually decode ogg files, e.g. mplayer, ogg123 etc.


7

Higher volume: amixer set Master 3%+ Lower volume: amixer set Master 3%- Mute toggle: amixer set Master toggle Example keybindings for i3/sway, the commands are after exec: bindsym XF86AudioRaiseVolume exec amixer set Master 3%+ bindsym XF86AudioLowerVolume exec amixer set Master 3%- bindsym XF86AudioMute exec amixer set Master toggle bindsym Ctrl+$...


7

On my laptop running Fedora 20, HDMI output is not listed as a sink in the default profile, but as a different profile itself. I have only 1 sink like this, nice music playing on my laptop speakers: $ pactl list short sinks 8 alsa_output.pci-0000_00_1b.0.analog-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING If I run pactl set-card-profile 0 ...


7

Alsa by default uses the same sampling rate and format as the source. It is however possible to force the sample rate up (or down). Here is one way you could do it. (in /etc/asound.conf or ~/.asoundrc) pcm.device{ format S24_LE rate 96000 type hw card 0 device 0 } Then just make that pcm a slave to another one, like ...


7

Finally fixed it by going through absolutely every bar in alsamixer, even the ones that I wasn't sure would matter, and unmuting them all. As it turns out, the mute toggle mutes everything, but only unmutes the master volume.


Only top voted, non community-wiki answers of a minimum length are eligible