Monday, August 17, 2020

notes - pulseaudio

Links: PulseAudio configuration :: PulseAudio examples :: Kodi PulseAudio guide


For 5-6 years, I avoided PulseAudio by sending any hooks to /dev/null. Zoom was my recent undoing -- Zoom's settings were so complicated, that it was much less timely to install PulseAudio than circumvent it. Still, instead of the unplanned kludge of PulseAudio on top of ALSA on top of OSS; instead of the elaborate trouble-shooting and configuration nightmares a nested audio 'system' brings; why couldn't OSS simply be fully developed? It was close to completion when abandoned for ALSA. And, when something so irrational as a 3-tier audio system is developed, reasonable ppl might assume the RIAA/MPAA and their IP attorneys (the DCMA Force) were involved. Anyway... that said, PulseAudio has at least improved. So now here we are.

source v. sink

We all understand the one-way graphic below, but just a note to keep in mind: these are relative.


For a person recording her voice to her lapop, she is the ultimate source, and the SSD sector is the ultimate sink, but intermediate stops can also be defined. The microphone is a sink from the source voice, but the microphone is a source for the Audio-Digital Converter sink, and so on down the line until we get to the final sink, or final destination, the SSD. When configuring, know what the software defines as a source or sink at that point in the process.

Other nomenclature isssues concern the difference between cards, profiles, indexes, sources, and outputs.

sorting for configuration

Three things to keep in mind: 1) if you know how to change underlying ALSA and/or OSS, these are still preferred, 2) failing this, well-defined PulseAudio configuration files can usually overcome and accomplish, 3) go to /etc/pulse/ for the two PulseAudio configuration files: default.pa, and client.conf. Default is just what it sounds like, so it's not the place to put all ones configurations, only the default settings for when PulseAudio starts. Client is the larger file with all profiles and so on. If one runs the PulseAudio daemon, there's also a configuration file for that: /etc/pulse/daemon.conf.

Here are a few (of 50+) PulseAudio commands used during configuration...

  • pacmd list-cards
  • pacmd list-sources
  • pacmd list-sinks

These commands return overwhelming information and only a small portion are used in PulseAudio configuration files. Which ones? What nomenclature matters: sink, index, name, card, etc,? If I use the command...

$ pacmd list-cards

...in order to find the names to use for configuration, I will receive intimidating amounts of information.

Only the two circled items are needed for use in configuration, however which is better?

symbolic-name
alsa_card.pci-0000_00_1f.3
the preferred parameter for PulseAudio configuration files.
card-index
0
unpreferred parameter inside PulseAudio configuration files. The card-index value can change across boots.

In short, I have one sound card, known to the system as alsa_card.pci-0000_00_1f.3, and this is what I should use to create configuration customizations. The good news is that I can increase the number of "sinks" on the card so that ffmpeg can access them separately or together through PulseAudio.

configuration

Go to /etc/pulse/ for the two main configuration files: default.pa, and client.conf. The overarching theme is to have well-configured (or 'well-defined') "sources", which we can then easily select from for recording or muxing. We'll need to add sinks.

Multiple Audio Collection (11:29) Kris Occhipinti, 2017. How to do multiple audio sources.

Utilizing the results from pacmd list-source-outputs, we can create recording commands.

$ ffmpeg -f pulse -i 0 -map '0' foo.mp3

adding sinks

Links Adding sinks ::

Adding sinks is important for having sources and outputs available to mux.

No comments: