20

A few iterations ago, I think this was Jaunty but could've been before, I would plug a 1/8" audio cable from the line-out of a Windows netbook to the line-in of my Ubuntu machine, so I would have all the sound from both machines without having to plug both into a mixer which I don't have. I didn't do this much, as I was pretty-much happy with Banshee at the time. But with Karmic, and still with Lucid, I can only get the output if I'm recording with Audacity. Which I'm not going to do from my web-development and systems programming workstation.

I can tell by plugging in headphones that my netbook has audio out working. I can see Sound Preferences that the Ubuntu machine is receiving them. I just want the old behavior back. Help?

Dave Jacoby
  • 497
  • 1
  • 8
  • 16

3 Answers3

22

If I understand correctly, you're trying to stream the microphone input to the audio output? The simplest I can think of is to use gst-launch for that. Open a terminal and type:

gst-launch pulsesrc ! pulsesink

The press CTRL+C to stop streaming. You may have to install the gstreamer tools to have this available:

sudo apt-get install gstreamer-tools

Note that as I don't have any suitable audio source, I didn't actually try that so it may not work. Any feedback on whether it does would be appreciated.

Bruno Girin
  • 516
  • 4
  • 5
  • It works quite alright.. – LassePoulsen Aug 22 '10 at 14:27
  • That it does. I got the answer on the weekend and have the problem on my work machine, so I didn't want to say OK until I tested it. And I'm testinb it right now. It does work. – Dave Jacoby Aug 23 '10 at 12:19
  • Is this still the only fix? Nothing in the GUI? I'm running 13.04. – Corey Apr 22 '13 at 17:29
  • 2
    On my Linux Mint system, I have to use `gst-launch-1.0` rather than just `gst-launch`. But the basic recipe works perfectly with that fix; +1. – steveha Jan 10 '16 at 22:34
  • 1
    On 16.04 this answer gives the error; ERROR: pipeline could not be constructed: no element "pulsesrc". – TenLeftFingers Dec 01 '16 at 19:45
  • My Ubuntu 18.04 can't locate the package gstreamer-tools... – OZ1SEJ Apr 16 '19 at 14:05
  • 3
    Ubuntu 19.04, preinstalled `gst-launch-1.0`, instead of `gst-launch`, if not just `sudo apt install gstreamer1.0-tools `, or [look here](https://wiki.ubuntuusers.de/Gstreamer-1.0/) – Wu Wei Sep 10 '19 at 18:56
4

If you want to use existing pulse-audio tools, use pacat (which stands for pulse-audio cat).

get your input device with

pactl list
[...]
Source #0
        State: SUSPENDED
        Name: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
        Description: Monitor of Built-in Audio Analog Stereo
        Driver: module-alsa-card.c
[...]

copy the 'name' part and use it with pacat :

pacat -r --device=alsa_input.pci-0000_00_1b.0.analog-stereo | pacat -p --latency-msec=1

where as device is the name you copied before.

This will cost a bit of CPU time (3,3% on my machine).

You can also pipe some audio converting software in between to filter, or use it over the network.

user241374
  • 41
  • 1
1

Bruno Girin's answer worked for me as well, but manually launching a process is somewhat annoying as this should just be automatic. A better solution is to install gnome-alsamixer and unmute the line-in option, as described here:

No sound from line-in

Nate
  • 111
  • 2