Re: container support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can use whichever server you want. In its simplest form

<?php 
  if($_SERVER['REQUEST_METHOD'] == 'HEAD') {
    header('Vary: Origin');
    header("Access-Control-Allow-Origin: chrome-extension://lmkllhfhgnmbcmhdagfhejkpicehnida");
    header("Access-Control-Allow-Methods: GET, OPTIONS, HEADERS");
    header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers");    
    header("X-Powered-By:");
    header("HTTP/1.1 200 OK");
    die();
  }
  if (isset($_GET["start"])) {
    header('Vary: Origin');
    header("Access-Control-Allow-Origin: chrome-extension://lmkllhfhgnmbcmhdagfhejkpicehnida");
    header("Access-Control-Allow-Methods: GET, OPTIONS, HEAD");
    header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers");    
    header("Content-Type: text/plain");
    header("X-Powered-By:");
    echo passthru("parec -v --raw -d alsa_output.pci-0000_00_1b.0.analog-stereo.monitor");
    exit();
  }
adjust the device name passed to PHP passthru().

You can capture microphone using parec or parecord. I am banned from SO so I won't be able to answer your question there, at least for another few years.

On Sun, Dec 13, 2020 at 2:34 AM Jan Van den Audenaerde <jan.vandenaudenaerde@xxxxxxxxx> wrote:
Thanks for the response. 

How did you setup pulseaudio daemon/server ?

FYI I have also created following stackoverflow question to make my needs mode clear : https://stackoverflow.com/questions/65274557/how-to-configure-pulseaudio-on-the-host-for-docker-containers

kr
Jan

Op za 12 dec. 2020 om 16:58 schreef guest271314 <guest271314@xxxxxxxxx>:
Moreover it should be possible that different docker containers can access the microphone and speaker at the same time.

Any help would be much appreciated.

I have not used pulseaudio server/client functionality. I have used pulse audio to get system audio and specific application audio output in Firefox and streamed that data to Chrome and Chromium, which does not support capturing system audio.

One option would be to serve the audio data using parec or parecord from  

CentOs 8 on a headless device (intel-nuc)

where

my docker containers should be able to use pulseaudio client to communicate with the pulseaudio server

request and receive PCM or PCM re-encoded to a different codec.

This can be achieved using a server-client template, e.g., fetch('/http://localhost:1234?device=microphone'), parse the PCM response at the client containers https://github.com/WebAudio/web-audio-api-v2/issues/97#issue-688754941. Other means of achieving the requirement include using WebRTC PeerConnection https://gist.github.com/guest271314/04a539c00926e15905b86d05138c113c.

PulseAudio has a WebRTC Audio Processing component though I have not tried that either. See also https://github.com/aiortc/aiortchttps://git.aweirdimagination.net/perelman/minimal-webrtc-gstreamer.

On Sat, Dec 12, 2020 at 7:19 AM Jan Van den Audenaerde <jan.vandenaudenaerde@xxxxxxxxx> wrote:
Hi,

I have spend several days without success figuring out how I can use pulseaudio in a container setup on an embedded device.

I am running CentOs 8 on a headless device (intel-nuc) which is also running docker.
I would like to run pulseaudio server on the host (CentOs 8) and my docker containers should be able to use pulseaudio client to communicate with the pulseaudio server via pulseaudio unix socket.
Moreover it should be possible that different docker containers can access the microphone and speaker at the same time.



The main problem I am facing I have reported in following forum post: 


Any help would be much appreciated.
I also think that pulseaudio has the good requirements for use in a container setup if  I only can make it work.
Jan.


_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux