Audio control with Ubuntu inside Docker

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












Trying to achive:



  • Docker running Ubuntu xenial.

  • Process inside the docker is launching Chromium. Chromium is connecting to WebRTC session (peer to peer meeting with audio).

  • The Chromium is connected to the default audio device

  • While playing the audio from chromium, the process which is able to "listen" to the audio device output, can decide to play audio into the microphone stream, so it can be received by the other peer.

so in general, the process should be able to listen to the audio from the device, and write audio as if it is recived by the microphon. The process knows how to do that if the audio device is configured.



To active this, I tried to setup PulseAudio and have a virtual device that can handle both input and output.



First setup was:



pulseaudio -D --exit-idle-time=-1
pactl load-module module-null-sink sink_name=DummyOutput sink_properties=device.description="Virtual_Dummy_Output"
pacmd load-module module-virtual-sink sink_name=v-sink
pacmd set-default-sink v-sink
pacmd set-default-source v-sink.monitor


(inspired by this answer)



That enabled to listen to the audio from the virtual device output.
To add also audio input (microphone) I added the following to add virtual microphone:



pactl load-module module-null-sink sink_name=MicOutput sink_properties=device.description="Virtual_Microphone_Output"
pacmd load-module module-virtual-source source_name=VirtualMic


After adding this, I started to get mixed audio - speaker & mic - which cause the peer connection to get echos and not a clear sound.



I understand that I need to separate the virtual device to 2 different sinks, but any configuration that I tries caused other unexpected results.



I don't have much experience with PulseAudio so appreciate any help / reference.



How can PulseAudio be configured to have default Virtual Device/s which can act as regular line-in and Speakers. And when piping audio to the mic it will not be heard by the speakers?







share|improve this question
























    up vote
    0
    down vote

    favorite












    Trying to achive:



    • Docker running Ubuntu xenial.

    • Process inside the docker is launching Chromium. Chromium is connecting to WebRTC session (peer to peer meeting with audio).

    • The Chromium is connected to the default audio device

    • While playing the audio from chromium, the process which is able to "listen" to the audio device output, can decide to play audio into the microphone stream, so it can be received by the other peer.

    so in general, the process should be able to listen to the audio from the device, and write audio as if it is recived by the microphon. The process knows how to do that if the audio device is configured.



    To active this, I tried to setup PulseAudio and have a virtual device that can handle both input and output.



    First setup was:



    pulseaudio -D --exit-idle-time=-1
    pactl load-module module-null-sink sink_name=DummyOutput sink_properties=device.description="Virtual_Dummy_Output"
    pacmd load-module module-virtual-sink sink_name=v-sink
    pacmd set-default-sink v-sink
    pacmd set-default-source v-sink.monitor


    (inspired by this answer)



    That enabled to listen to the audio from the virtual device output.
    To add also audio input (microphone) I added the following to add virtual microphone:



    pactl load-module module-null-sink sink_name=MicOutput sink_properties=device.description="Virtual_Microphone_Output"
    pacmd load-module module-virtual-source source_name=VirtualMic


    After adding this, I started to get mixed audio - speaker & mic - which cause the peer connection to get echos and not a clear sound.



    I understand that I need to separate the virtual device to 2 different sinks, but any configuration that I tries caused other unexpected results.



    I don't have much experience with PulseAudio so appreciate any help / reference.



    How can PulseAudio be configured to have default Virtual Device/s which can act as regular line-in and Speakers. And when piping audio to the mic it will not be heard by the speakers?







    share|improve this question






















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Trying to achive:



      • Docker running Ubuntu xenial.

      • Process inside the docker is launching Chromium. Chromium is connecting to WebRTC session (peer to peer meeting with audio).

      • The Chromium is connected to the default audio device

      • While playing the audio from chromium, the process which is able to "listen" to the audio device output, can decide to play audio into the microphone stream, so it can be received by the other peer.

      so in general, the process should be able to listen to the audio from the device, and write audio as if it is recived by the microphon. The process knows how to do that if the audio device is configured.



      To active this, I tried to setup PulseAudio and have a virtual device that can handle both input and output.



      First setup was:



      pulseaudio -D --exit-idle-time=-1
      pactl load-module module-null-sink sink_name=DummyOutput sink_properties=device.description="Virtual_Dummy_Output"
      pacmd load-module module-virtual-sink sink_name=v-sink
      pacmd set-default-sink v-sink
      pacmd set-default-source v-sink.monitor


      (inspired by this answer)



      That enabled to listen to the audio from the virtual device output.
      To add also audio input (microphone) I added the following to add virtual microphone:



      pactl load-module module-null-sink sink_name=MicOutput sink_properties=device.description="Virtual_Microphone_Output"
      pacmd load-module module-virtual-source source_name=VirtualMic


      After adding this, I started to get mixed audio - speaker & mic - which cause the peer connection to get echos and not a clear sound.



      I understand that I need to separate the virtual device to 2 different sinks, but any configuration that I tries caused other unexpected results.



      I don't have much experience with PulseAudio so appreciate any help / reference.



      How can PulseAudio be configured to have default Virtual Device/s which can act as regular line-in and Speakers. And when piping audio to the mic it will not be heard by the speakers?







      share|improve this question












      Trying to achive:



      • Docker running Ubuntu xenial.

      • Process inside the docker is launching Chromium. Chromium is connecting to WebRTC session (peer to peer meeting with audio).

      • The Chromium is connected to the default audio device

      • While playing the audio from chromium, the process which is able to "listen" to the audio device output, can decide to play audio into the microphone stream, so it can be received by the other peer.

      so in general, the process should be able to listen to the audio from the device, and write audio as if it is recived by the microphon. The process knows how to do that if the audio device is configured.



      To active this, I tried to setup PulseAudio and have a virtual device that can handle both input and output.



      First setup was:



      pulseaudio -D --exit-idle-time=-1
      pactl load-module module-null-sink sink_name=DummyOutput sink_properties=device.description="Virtual_Dummy_Output"
      pacmd load-module module-virtual-sink sink_name=v-sink
      pacmd set-default-sink v-sink
      pacmd set-default-source v-sink.monitor


      (inspired by this answer)



      That enabled to listen to the audio from the virtual device output.
      To add also audio input (microphone) I added the following to add virtual microphone:



      pactl load-module module-null-sink sink_name=MicOutput sink_properties=device.description="Virtual_Microphone_Output"
      pacmd load-module module-virtual-source source_name=VirtualMic


      After adding this, I started to get mixed audio - speaker & mic - which cause the peer connection to get echos and not a clear sound.



      I understand that I need to separate the virtual device to 2 different sinks, but any configuration that I tries caused other unexpected results.



      I don't have much experience with PulseAudio so appreciate any help / reference.



      How can PulseAudio be configured to have default Virtual Device/s which can act as regular line-in and Speakers. And when piping audio to the mic it will not be heard by the speakers?









      share|improve this question











      share|improve this question




      share|improve this question










      asked May 10 at 15:51









      Satumba

      1011




      1011

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1034554%2faudio-control-with-ubuntu-inside-docker%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1034554%2faudio-control-with-ubuntu-inside-docker%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          pylint3 and pip3 broken

          Missing snmpget and snmpwalk

          How to enroll fingerprints to Ubuntu 17.10 with VFS491