Results 1 to 4 of 4

Thread: Pulseaudio: add a sink and output to 2 sinks concurrently

  1. #1
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,114
    Distro
    Xubuntu 18.04 Bionic Beaver

    Pulseaudio: add a sink and output to 2 sinks concurrently

    is this even possible? i want to have my executable program be added to Pulseaudio as a sink. i don't even know what format i'd get the audio stream in, yet. i guess that would be described in its API documentation (when i find it). i also would like have Pulseaudio concurrently output to 2 or 3 sinks. i read one post somewhere that said this was impossible. seeks like a silly design decision.

    i read somewhere that Pulseaudio used shared memory to transfer audio samples with lower latency. i'm guessing some kind of ring buffer would be used.
    What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.

  2. #2
    Join Date
    Dec 2014
    Beans
    1,124

    Re: Pulseaudio: add a sink and output to 2 sinks concurrently

    No need to write your own pa-sink, just use module-pipe-sink to write the output to a fifo and read from that in your program. Format should be raw audio with configurable sample format, sample rate, channels and channel-mapping.

    In Pulse a stream has one source and one sink. But there's module-combine-sink to create one virtual sink that links multiple sinks together.

    See https://www.freedesktop.org/wiki/Sof...entation/User/ for more details, especially the section 'Modules'.

    Holger

  3. #3
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,114
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: Pulseaudio: add a sink and output to 2 sinks concurrently

    i want to be able to hear the audio uninterrupted when i engage and disengage my program from getting audio. so i will need to get "module-combine-sink" going first, and hope that "module-pipe-sink" can go idle when nothing is reading the other end (just throw samples into the black-hole-sink).

    i still think it's a wrong design for the core audio server to not distribute to as many sinks as requested. i would have made it like a multi-channel mixer where every sink can get whatever mix of sources it is configured to get, through whatever filters are available. a GUI app could change the mix settings and visually show a mixer board.
    What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.

  4. #4
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,114
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: Pulseaudio: add a sink and output to 2 sinks concurrently

    i wonder if module-pipe-sink can be tricked into writing directly to a regular file.
    What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •