Linux audio output to input

Play audio output as input to Zoom

Somewhat related to how to pipe audio output to mic input and https://askubuntu.com/questions/602593/whats-a-good-soundflower-replacement-for-ubuntu but those both involve «recording». I want to play a movie trailer or just any video on a screenshare in Zoom and have the audio that I hear also go to attendees/viewers. I installed pavucontrol and do have the ability to list «monitors» on the inputs tab, but those «monitor of» inputs don’t show up as input/mics in zoom. I feel like I need the ability to re-tag these «monitor of» inputs to not be «monitor» types so that they show up as an input source in Zoom. How can I get the output to be an input in Zoom?

5 Answers 5

Make Zoom accept monitor as input (Ubuntu 20.04)

With the new PulseAudio version 13.99+, you can no longer select «System default» as mic in Zoom, which was a way of tricking Zoom into using a monitor as input. You have to create a virtual source:

pactl load-module module-null-sink sink_name=zoom_input sink_properties=device.description=zoom_input pactl load-module module-remap-source master=zoom_input.monitor source_name=zoom_mic source_properties=device.description="zoom_mic" 

By doing this, «zoom_mic» will show up as a input device in Zoom.

Using pavucontrol, redirect the sound from your media player to «zoom_input» and it will be played in Zoom.

See also this advanced guide to PulseAudio connections: https://github.com/toadjaune/pulseaudio-config

We had exactly the same problem with Zoom in Linux (Ubuntu, Lubuntu and Gentoo). The solution turned out to be as follows, and does not require using PulseAudio Volume Control:

  1. Launch the application for playing audio or video. Pause the audio/video if necessary.
  2. Click on ‘Mute’ in Zoom, to mute the mic (see NOTE below).
  3. Click on ‘Share’ at the middle bottom of the Zoom window, select the application (or ‘Desktop’) and either a) click ‘Advanced’ if you only want to share audio, or b) click on ‘Share computer sound’ and on ‘Optimise Screen Sharing for Video Clip’ if you want to share a video.
  4. Click the blue ‘Share’ button.
  5. Unpause/start the audio/video playing in the audio/video application.

NOTE: We find we get much better audio quality by muting the mic before sharing audio/video. After starting the audio/video stream, it is then possible to unmute the mic.

In the Zoom share tool, there is a check box for «Share Computer Audio». This works, sort of, it is highly distorted audio which seems overdriven at some level.

That solves the OP’s problem, but what if I want to pipe my audio output to Zoom without sharing my screen? pavucontrol doesn’t let me change the input device for Zoom’s audio engine. I’m looking for a trick to do that.

Читайте также:  Linux sys call table

A few months late & off the original topic, but when you click Zoom’s screen share button, the resulting box has an «Advanced» tab that will share system audio without any video.

This script works You’ll need to set mic in zoom to default rather than mic and in pavucontrol set your mic to ‘zoom’ and vlc or whatever to media.

(adapted from Manjaro forum) you’ll still get some distortion due to zooms so-called audio enhancements which you can’t disable in the linux app.

#!/bin/bash pactl load-module module-null-sink sink_name=zoom sink_properties=device.description=zoom pactl load-module module-loopback sink=zoom pactl set-default-source zoom.monitor pactl load-module module-null-sink sink_name=media sink_properties=device.description=media pactl load-module module-loopback source=media.monitor pactl load-module module-loopback source=media.monitor sink=zoom 

Источник

How to pipe audio output to mic input

I’ve looked all over the internet for a clean way to reroute the audio output of my computer (i.e. what I’d hear from the speaker) to my microphone’s input. Possibly, I’d like to do this at a low level (e.g. using ALSA). I’m basically looking for an equivalent of

pacmd move-sink-input #index #sink 

that gets some audio input and pipes it to the microphone. If it’s still not clear my final goal would be, for example, to play a video on YouTube and let a friend of mine listen through Skype. I’d like that kind of flexibility.

I asked a similar question here unix.stackexchange.com/questions/558149/…, that is different than this answer in that my app, Zoom, does not do recording.

1 Answer 1

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

ss of pauvucontrol #1

  1. Run the application pavucontrol .
  2. 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 the volume of the output:
  3. Now start an application that can record audio such as audacity and record audio (red point icon in audacity).
  4. In pavucontrol (Volume Control) change to the Recording tab.
  5. Click the input device button («ALSA Capture from») and pick «Monitor of Internal Audio Analog Stereo»)

Источник

How to redirect from Audio Output to Mic Input using PulseAudio?

I’m working on a mobile app for Maemo/MeeGo and Maemo uses PulseAudio. I want to play a mp3 to caller (and cancel the mic when doing it, and not to listen caller, everything should be done on background), to do this, I have to redirect Audio Output from a certain (if not possible, all) app, fake it as a Input and make Phone app use it. On my Ubuntu PC, I did it with pavucontrol. I created a NULL sink, then:

Audio Output (from Amarok) --> to NULL Output Skype Input NULL 

And It worked, Amarok played the music and It was streaming to Skype, without playing it to me and I didn’t hear anything about all process. Problem is; a) Maemo does not have pavucontrol. b) Even If it did (or if I package it) It wouldn’t be any good since It’s a only-GUI app and I have to do all of this stuff on background, without any user input. (mean: CLI or API) Asked about this on Freenode #pulseaudio and a helpful guy said «It can pretty much be done via pactl or pacmd, the commands you want are move-sink-input and move-source-output, but you need to know device and stream indexes.» So It looks like pavucontrol is just a GUI, pactl and pacmd are the real deal, and most importantly, they’re CLI apps. I’m really thankful to him but I don’t know anything about «pactl», «pacmd», «move-sink-input» or «device/stream indexes» so I need a very simplified manual page, or a source of similar app, a one-liner command (two? whole page of commands?, just give me them! ^^) or someone with enough patience to explain this stuff to me.

Читайте также:  Linux program using port

Источник

How to configure PulseAudio to input/output via ALSA?

How do I configure PulseAudio to use only a single ALSA device for input and output? The default PulseAudio configuration causes PulseAudio to open all ALSA devices when it starts. This makes it impossible to use PulseAudio together with other ALSA clients. Many people prefer PulseAudio to ALSA, but other users find it frustrating. For better or worse, PulseAudio has become a standard and several popular Linux applications, such as Skype and Firefox, only support audio output via PulseAudio. Some users prefer to work with audio clients that output directly to ALSA, others output to another audio framework like JACK, but want to have JACK access ALSA directly. For these users, it is easy to free up all the ALSA devices by uninstalling PulseAudio. However, removing PulseAudio makes it impossible to use audio in Skype and Firefox. A better solution would be to come up with a configuration that gets PulseAudio to «play nicely» with other ALSA clients, outputting to only a single device, which would be specified in its configuration, or even just the ALSA default device. How can we do that?

2 Answers 2

This answer builds on @dirkt’s answer, so thanks are due to him.

    You can edit ~/.config/pulse/default.pa . It’s listed under FILES in the «pulseaudio(1)» manual page. If it is present, the global default.pa is not used. For me, I can get a working setup with the following minimal configuration:

load-module module-alsa-sink device=default load-module module-alsa-source device=default load-module module-native-protocol-unix 
  • Comment out load-module module-udev-detect , which searches for ALSA hardware devices and overrides the device argument you passed to the ALSA modules above.
  • Then add the module-alsa-sink and module-alsa-source lines. The module-native-protocol-unix line should already be present.
  • You may need to comment out the line load-module module-suspend-on-idle ; this caused problems for me in testing with certain output devices. The symptom is that mplayer -ao pulse . reports «Audio device got stuck!» and mpv -ao pulse . reports «[ao/pulse] The stream is suspended. Bailing out.» Commenting out that module fixed the problem.
  • Since I use a dmix device for playback, I can use paplay and aplay together, and mixing occurs automatically. However, the microphone can’t be shared in my setup; I cannot record from it using arecord when PulseAudio is running («Device or resource busy»). For that I would need to create a dsnoop device and put its name in place of hw:5 above.
  • If you’re trying to get Skype to work, use the Skype «Echo / Sound Test Service» to test your setup. Keep in mind that Skype may be already be running in the background — try killall skype before starting it, to force it to make a new PulseAudio connection. In my experience, Skype does not report any kind of error condition when it is not able to connect to the PulseAudio daemon.
Читайте также:  Send get request linux

Having a good ALSA configuration is desirable, even if only because certain applications (Ecasound? legacy code?) don’t work with PulseAudio. I hope that these instructions are helpful to anyone who, having configured ALSA to their liking, now wants to be able to use programs like Skype which depend on PulseAudio.

You don’t configure PulseAudio to use the ALSA default device. Instead, you configure ALSA to use pulse as the default device:

pcm.!default pulse ctl.!default pulse 

In that way, ALSA applications that are not aware of PulseAudio will use PulseAudio via that indirection layer.

The reason you need to do this is that PulseAudio always uses ALSA as backend, and on startup opens all ALSA devices, and since most ALSA devices can’t be opened multiple times, this will cause all ALSA applications that try to use an ALSA device directly when PulseAudio is running to fail.

If you have a legacy application that for some reason doesn’t work, you can use pasuspender to temporary suspend PulseAudio to run this particular application.

I was actually in a similar situation like you are now, I used ALSA for a long time, and was happy, and was then forced to switch to PulseAudio. PulseAudio has in principle a nicer, more general structure than ALSA (streams and sources/sinks), and though sometimes it has warts, one can live with it.

You can debug problems by starting pulseaudio manually and adding -v flags, like pulseaudio -vv start etc. Log messages go to the syslog. If you want to switch devices, pavucontrol is an easy-to-use GUI, and if you want more direct control, you can use pacmd or pactl (I never figured out why there are two programs) as a commandline CLI. Use the help argument for more details. If you prefer files, everything easily scriptable.

I also recommend to have a look at the available modules.

Источник

Оцените статью
Adblock
detector