Package: pamic
[[TOC]]Pamic- Funking upPulseaudiomicrophone useOverviewPamicaims to simplify finessing microphone use withPulseaudio.There are two modes available:Echo cancellation (combined with some level of noise suppression)Echo cancellation mode is for when you need to use a microphone with ordinary
speakers. For example, your system has speakers attached, you're not using
headphones, your microphone is picking up the sound coming from the speakers
and echoing it back out to everyone else on the conference call!ThePulseaudioecho cancellation module can also perform noise suppression,
andPamicmakes use of that when in echo cancellation mode. It's not
quite as capable as the freestanding noise suppression, but it saves the
overhead of using two separate modules.Standalone noise suppressionStandalone noise suppression mode is for when you are using headphones, but
your microphone is picking up unwanted background noise. In my case this is
my laptop's fan, but it's also good for office hubbub, crowds, construction,
planes, trains, automobiles...This mode requires an extra library (librnnoise) to be installed. See below for details.Pamic's changes are not persistent by default. Configure the autostart feature in thePreferencesdialogue if you want the changes to persist across reboots.InstallationRun the following command:pip3 install pamicDepending on your Linux distribution, you may need to usepiprather thanpip3. (python3 -m pip install pamicorpython -m pip install pamicare also options here.)Echo cancellation is performed by a standardPulseaudiomodule, so if you're running the latest version ofPulseaudiothat should be covered.Note: I've only testedPamiconPulseaudioversion 13.0. If you're using a different version, please let me know how it goes.Installing librnnoiseThis is only necessary for standalone noise supression - i.e when you're using headphones rather than speakers.For standalone noise suppressionPamicmakes use of the marvelloushttps://github.com/werman/noise-suppression-for-voiceDownload the latestlinux_rnnoise_bin_x64.tar.gztarball fromhttps://github.com/werman/noise-suppression-for-voice/releases/Extractlibrnnoise_ladspa.soand place it in/usr/local/lib/:tar xf ~/Downloads/linux_rnnoise_bin_x64.tar.gz bin/ladspa/librnnoise_ladspa.so
sudo mv librnnoise_ladspa.so /usr/local/lib/UsingPamicLaunchPamic's GUI. At a terminal run:pamicgNote:Pamicis made up of two components, the GUIpamicg, and the scriptpamic. (For more information on the script seeREADME_SCRIPT.md.)Select which mode you wish to use:Echo CancellationorNoise Suppression. (The latter is only available iflibrnnoiseis installed. See above.)Now select the devices you want to use from the drop down box(es). InEcho Cancellationmode select the source (microphone) and sink (sound output device). InNoise Suppressionmode you can only select a source (microphone).And finally, click theApplybutton.All being well, that should be it.Pamicshould be working. SeeTroubleshootingif not.See alsoConfiguring individual applicationsbelow.UnloadingPamicOnce loaded aPamicconfiguration will remain active untilPulseaudiois told to unload the modules, or is stopped.To unload an active configuration, click on the down arrow to the right of theApplybutton and selectUnload.ConfiguringPamicPamic has the following configuration options available in thePreferencesdialogue:Force unload if already activeIf this box is ticked,Pamicwill unload any existing configuration before applying the new one. If the box is not ticked,Pamicwill not apply the new configuration if there is one already loaded.This is on by default.Display monitor devicesIn most instances thePulseaudiomonitor devices will not be of interest, so they are not displayed unless this box is ticked. Which it isn't by default.Display device namesThe human readable device descriptions are always displayed.In most instances thePulseaudiodevice names will not be of interest, so they are not displayed unless this box is ticked. Which it isn't by default.AutostartThe following tasks can be automatically started when you login:PamicReinstate the last appliedPamicconfigurationPamic GUIStart thePamicGUIThese two are independent options, you can have one, the other, both, or neither.Configuring individual applicationsOncePamichas configured its new virtual devices, any freshly started applications should usepamic virtual speakeras their sound output device.You may still need to change the routing for applications which are already connected to a different output device, or for applications which have been configured to use a specific output.I usually usepavucontrolto control which app uses what output. If you're usingPulseaudio,pavucontrol(or something similar) is probably already installed.UsingPamicwithPulseEffectsPulseEffectsmakes it a simple matter to extensively tweak the sound coming through PulseAudio.Install it via your usual package management tool (e.g.sudo apt install pulseeffects).I usePulseEffectsto boost bass, add someaudio excitation, andfettlethe stereo image.The gotcha here is thatPamic'sEcho-Cancel Sink Streammustbe blacklisted, otherwisePulseaudiowill detect a loop and there'll be only silence.InPulseEffects's main tab...selectApplications...find theEcho-Cancel Sink Streamitem and...click itsBlacklistbutton.RestartPulseEffects(PamicandPulseEffectsmust both be running of course.)[This image is of PulseEffects 4.8.0, using some GTK theme or other, and displayed in AwesomeWM. YMWV😄]TroubleshootingPulseaudioissuesPulseaudiocan get its knickers in a twist. My setup is more complicated than the average in that my sound output device is a remote connexion toPulseaudiorunning on a different computer, but I find that restartingPulseaudioand any streams using it, usually solves most problems.I do this by running:pkill pulseaudioPulseaudioautomatically restarts.The most common exception to this resolving a problem for me has been whenPulseaudiochooses to alternate between the two physical outputs on a device afterPulseaudioand the device have been restarted. I clickPamic'sRefreshbutton, select the new device, clickApply, and I'm back up and running. (I should probably try to force one or other of the physical outputs to always be used, but it only happens infrequently.)Autostart not workingIf like me you're using a window manager that doesn't handle the common autostart mechanism, you can do the following. After making changes inPreferencesyou can see howPamichas configured the autostart file, and use that as a model in whatever mechanism you do have access to. Run:sed -n 's/^Exec=\(.\+\)/\1/p' ~/.config/autostart/pamic.desktopAOBI'm expecting other problems to surface oncePamicis running on differentPulseaudioconfigurations. Please submit anyissues, and if you have solutions, please post them too :)Suggestions/problems/solutions?Please open anissue.Ingredients not already mentionedMicrophone icon fromfree-icon-download.com.