GithubHelp home page GithubHelp logo

jookia / linuxaudio_dualinput Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 90 KB

Support your card's second input in PulseAudio and PipeWire

License: MIT License

Shell 100.00%
pulseaudio capture pipewire linux

linuxaudio_dualinput's Introduction

Screenshot

Screenshot, see detailed captain below

Detailed caption of screenshot: Pavucontrol's input tab shows two recordable sources from the same sound card. One source is set to the front microphone, the other to the rear microphone. Alsamixer's capture settings panel is shown next to it. There's two capture inputs, Capture and Capture 1, both enabled. There's two input sources. One is set to Front Mic, the other to Rear Mic.

What's all this then?

Do you have a sound card that supports recording from two inputs at once?

Example: Recording from microphone and line in.

Example: https://forum.manjaro.org/t/how-to-separe-ports-into-different-devices-on-pulseaudio/55890

Example: https://unix.stackexchange.com/questions/373122/how-to-split-ports-in-a-source-into-separate-sources-in-pulseaudio

PulseAudio/PipeWire may not expose this to your system, so I've made some profiles to help.

Tested cards:

  • Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller (PCI vendor 1022 product 1487)
  • Intel Corporation 200 Series PCH HD Audio (PCI vendor 8086 product a2f0)

Installation

Follow these steps:

  1. Run 'sudo install.sh' to install, or 'sudo uninstall.sh' to uninstall 3a. Run 'systemctl --user restart pulseaudio', or 3b. Run 'systemctl --user restart pipewire pipewire-pulse'
  2. Check if you have an extra audio input in PulseAudio

Tweaking guide

If this code doesn't work, you'll likely need to do some tweaking. Try these:

udev

Run lspci -nn and find your audio line like this:

  • 0b:00.4 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller [1022:1487]

The numbers in the brackets at the end are the vendor ID and product ID. Update the rules in the udev directory to match against that.

Audio profiles

Make sure the 'device-strings' in the profile matches your device. To find it, do this:

  • Run 'arecord -l'
  • Note down the device number for the second input
  • In the 'device-strings' for analog-stereo-aux, change the '2' to the device number

Audio paths

The rest of the tweaking is just messing with PulseAudio and PipeWire. It's not that difficult, look at the existing code in /usr/share/pulseaudio/alsa-mixer/paths/ or /usr/share/alsa-card-profile/mixer/ for PipeWire.

The code in this repository is basically a subset of those files with 'Capture' and 'Input Source' set to 'Capture,1' and 'Input Source,1' in the various paths, split out to new files, with a new profile that builds on the default.

Just try to match up the names to your sound card, assuming it works the same way.

As a caveat, alsamixer will display human friendly names like 'Capture 1' for its controls. Run 'amixer' (with an optional --card paramater) to see the true names of the controls.

linuxaudio_dualinput's People

Contributors

jookia avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.