Fastest way to release pulseaudio sink to allow another application access

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











up vote
0
down vote

favorite












I need to convenience switch the audio sink ( USB DAC ) between pulseaudio and a high-res proprietary music render that uses direct ALSA card access. Some background; two applications - a Bluetooth AD2P streamer ( hence pulseaudio ) and a network based HiRes Audio streamer. Both can be "connected" at the same time but only one will render audio. Pressing play on one, pauses the other and takes the sound sink and visa-vera. I have this all working but when switching from the proprietary network application to bluetooth the change over takes 5 seconds+.
Example: 1) music is being streamed via Bluetooth ( bluez5.48)/pulse audio 9.0 2) User decides he wants to listen to a DSD or something. Press play on his tablet etc. 3) The embedded Hi-res application gets notified of a play request and starts to teardown the Bluetooth side 4) Bluetooth incoming gets paused and pasuspender grabs the audio sink 5) Hi-res app detects the sink is free, bolts up and starts to stream the users DSD.



As mentioned it all works. However pasuspender takes almost 5 seconds to secure/free the audio sink; thi sis just too long. Any ideas.



To summarise, I need a quick and reliable way to take ownership of a pulseaudio sink need by an indepedant application.



Thanks.









share







New contributor




ed trx850 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    0
    down vote

    favorite












    I need to convenience switch the audio sink ( USB DAC ) between pulseaudio and a high-res proprietary music render that uses direct ALSA card access. Some background; two applications - a Bluetooth AD2P streamer ( hence pulseaudio ) and a network based HiRes Audio streamer. Both can be "connected" at the same time but only one will render audio. Pressing play on one, pauses the other and takes the sound sink and visa-vera. I have this all working but when switching from the proprietary network application to bluetooth the change over takes 5 seconds+.
    Example: 1) music is being streamed via Bluetooth ( bluez5.48)/pulse audio 9.0 2) User decides he wants to listen to a DSD or something. Press play on his tablet etc. 3) The embedded Hi-res application gets notified of a play request and starts to teardown the Bluetooth side 4) Bluetooth incoming gets paused and pasuspender grabs the audio sink 5) Hi-res app detects the sink is free, bolts up and starts to stream the users DSD.



    As mentioned it all works. However pasuspender takes almost 5 seconds to secure/free the audio sink; thi sis just too long. Any ideas.



    To summarise, I need a quick and reliable way to take ownership of a pulseaudio sink need by an indepedant application.



    Thanks.









    share







    New contributor




    ed trx850 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I need to convenience switch the audio sink ( USB DAC ) between pulseaudio and a high-res proprietary music render that uses direct ALSA card access. Some background; two applications - a Bluetooth AD2P streamer ( hence pulseaudio ) and a network based HiRes Audio streamer. Both can be "connected" at the same time but only one will render audio. Pressing play on one, pauses the other and takes the sound sink and visa-vera. I have this all working but when switching from the proprietary network application to bluetooth the change over takes 5 seconds+.
      Example: 1) music is being streamed via Bluetooth ( bluez5.48)/pulse audio 9.0 2) User decides he wants to listen to a DSD or something. Press play on his tablet etc. 3) The embedded Hi-res application gets notified of a play request and starts to teardown the Bluetooth side 4) Bluetooth incoming gets paused and pasuspender grabs the audio sink 5) Hi-res app detects the sink is free, bolts up and starts to stream the users DSD.



      As mentioned it all works. However pasuspender takes almost 5 seconds to secure/free the audio sink; thi sis just too long. Any ideas.



      To summarise, I need a quick and reliable way to take ownership of a pulseaudio sink need by an indepedant application.



      Thanks.









      share







      New contributor




      ed trx850 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I need to convenience switch the audio sink ( USB DAC ) between pulseaudio and a high-res proprietary music render that uses direct ALSA card access. Some background; two applications - a Bluetooth AD2P streamer ( hence pulseaudio ) and a network based HiRes Audio streamer. Both can be "connected" at the same time but only one will render audio. Pressing play on one, pauses the other and takes the sound sink and visa-vera. I have this all working but when switching from the proprietary network application to bluetooth the change over takes 5 seconds+.
      Example: 1) music is being streamed via Bluetooth ( bluez5.48)/pulse audio 9.0 2) User decides he wants to listen to a DSD or something. Press play on his tablet etc. 3) The embedded Hi-res application gets notified of a play request and starts to teardown the Bluetooth side 4) Bluetooth incoming gets paused and pasuspender grabs the audio sink 5) Hi-res app detects the sink is free, bolts up and starts to stream the users DSD.



      As mentioned it all works. However pasuspender takes almost 5 seconds to secure/free the audio sink; thi sis just too long. Any ideas.



      To summarise, I need a quick and reliable way to take ownership of a pulseaudio sink need by an indepedant application.



      Thanks.







      linux pulseaudio bluez





      share







      New contributor




      ed trx850 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      ed trx850 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      ed trx850 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 4 mins ago









      ed trx850

      1




      1




      New contributor




      ed trx850 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      ed trx850 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      ed trx850 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          ed trx850 is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478749%2ffastest-way-to-release-pulseaudio-sink-to-allow-another-application-access%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          ed trx850 is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          ed trx850 is a new contributor. Be nice, and check out our Code of Conduct.












          ed trx850 is a new contributor. Be nice, and check out our Code of Conduct.











          ed trx850 is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478749%2ffastest-way-to-release-pulseaudio-sink-to-allow-another-application-access%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay