Discussion:
Switch soundcard and set volume with pacmd and pactl - anybody got it working?
lmckusic-Wuw85uim5zDR7s880joybQ@public.gmane.org [linuxham]
2014-06-15 08:42:31 UTC
Permalink
I am trying to make my Linux box switch to a second sound card and set the microphone and speaker volumes to send out the correct level of audio signals to my transceiver.


My late model Ubuntu box of course uses pulseaudio. Pulseaudio sort of replaces and overlays the older Alsa sound utility. Pulseaudio has two utility programs Pacmd and Pactl that seem like they ought to control the sound card and volume levels.



Has a person on this list got the utility programs pactl and pacmd working and controlling their sound cards yet?


Could you please post any command lines or script texts that show how you got it working?


So far, I added myself to the "audio" group because that was suggested in an old Pulseaudio website FAQ article. The command is sudo adduser myusername audio. Log out and log back in to see the new group when you run groups.


So far, I figured out that my external USB sound card dongle is "sink 0" and "source 0" but something is happening about the device names and numbers that I just can't figure out. Anyhow, I can switch sound cards with pactl set-default-sink 0 but I can't figure out how to set the microphone and speaker volume for this sound card.


The terminology used by pulseaudio is kind of rubbery. In particular, the second USB sound card dongle has either a speaker or headphone output. What is the pulseaudio name for that specific point and how do I reduce the signal level or voltage going out that connection with a command line command.



It appears the fldigi is connecting just fine to pulseaudio with the Sound-->Pulseaudio server selected and nothing entered in the server field on the same line. So I am mostly stuck with setting the output volume levels. I need to reduce the output volume levels going to the transceiver to prevent the radio from being overdriven and made non-linear.


So thanks for a reply.
Larry Levesque ka1vgm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org [linuxham]
2014-06-15 09:36:46 UTC
Permalink
Have you installed and tried running the pavucontrol program yet?

This allows you to set an application specific sound card and settings.
Post by lmckusic-***@public.gmane.org [linuxham]
I am trying to make my Linux box switch to a second sound card and set the
microphone and speaker volumes to send out the correct level of audio signals
to my transceiver.
My late model Ubuntu box of course uses pulseaudio. Pulseaudio sort of replaces
and overlays the older Alsa sound utility. Pulseaudio has two utility programs
Pacmd and Pactl that seem like they ought to control the sound card and volume
levels.
Has a person on this list got the utility programs pactl and pacmd working and
controlling their sound cards yet?
Could you please post any command lines or script texts that show how you got it working?
So far, I added myself to the "audio" group because that was suggested in an
old Pulseaudio website FAQ article. The command is sudo adduser myusername
audio. Log out and log back in to see the new group when you run groups.
So far, I figured out that my external USB sound card dongle is "sink 0" and
"source 0" but something is happening about the device names and numbers that I
just can't figure out. Anyhow, I can switch sound cards with pactl
set-default-sink 0 but I can't figure out how to set the microphone and speaker
volume for this sound card.
The terminology used by pulseaudio is kind of rubbery. In particular, the
second USB sound card dongle has either a speaker or headphone output. What is
the pulseaudio name for that specific point and how do I reduce the signal
level or voltage going out that connection with a command line command.
It appears the fldigi is connecting just fine to pulseaudio with the Sound-->
Pulseaudio server selected and nothing entered in the server field on the same
line. So I am mostly stuck with setting the output volume levels. I need to
reduce the output volume levels going to the transceiver to prevent the radio
from being overdriven and made non-linear.
So thanks for a reply.
------------------------------------
Posted by: Larry Levesque <ka1vgm-***@public.gmane.org>
David Ranch linuxham-fld-U76wwbNhhF3R7s880joybQ@public.gmane.org [linuxham]
2014-06-15 16:05:52 UTC
Permalink
Like Larry said, the key is in pavucontrol, which is a GUI app. Its important to note that pavucontrol needs to be started FIRST and then run fldigi. Once running, you should see fldigi listed under the 'recording' tab. Route fldigi to use the desired sound card. Next, (qsy the radio to a free freq), make fldigi transmit with say control-t and in pavucontrol, goto the play tab and route fldigi's output to the desired soundcard. Done! Go ahead and close pavucontrol and its settings are automatically saved.

After all that said and done, the CLI equivalent to doing the above steps is downright awful. If you dislike configuring ALSA by hand, you haven't seen anything like this! Its really unfortunate if you ask me and it seems more is on the way across many Linux distributions with the new systemd system that replaces the SysV / BSD and Upstart systems. Btw, systemd is written by the same folks who wrote Pulseaudio. Don't get me wrong.. Pulseaudio solves a bunch of real Linux sound issues but it's lack of a clear, intuitive CLI that uses obfuscated, machine generated variable names drives me nuts!

--David
KI6ZHD
Rick Stanback rick-KImwxqjoShfqlBn2x/YWAg@public.gmane.org [linuxham]
2014-06-15 19:41:39 UTC
Permalink
The pulse auduio CLI is pretty ugly.
odroid pulse audio setup
# n=the alsa index
pacmd list sink-inputs
pacmd list source-outputs
#
# for dsd at about 4-5%
pactl set-source-output-volume n,55000

# for decent voice volume
pactl set-sink-input-volume n,50000


n Sun, 2014-06-15 at 09:05 -0700, David Ranch linuxham-fld-***@public.gmane.org
[linuxham] wrote:
------------------------------------
Posted by: Rick Stanback <rick-KImwxqjoShfqlBn2x/***@public.gmane.org>
Loading...