<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 10pt; color: rgb(0, 111, 201); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p><br>
<span style="font-size: 11pt; color: rgb(0, 0, 0);"></span></p>
<span style="font-size: 11pt; color: rgb(0, 0, 0);"></span>
<p><span style="font-size: 11pt; color: rgb(0, 0, 0);">Hi Team,</span></p>
<p><br>
</p>
<p><span style="font-size: 11pt; color: rgb(0, 0, 0);">We have implemented a pulsemodule which listens on
<i>sink_input_new_hook</i> and establishes connection with AudioManager and based on response from AudioManager, it sends PA_HOOK_OK or PA_HOOK_CANCEL.</span></p>
<p><br>
</p>
<p><span style="font-size: 11pt; color: rgb(0, 0, 0);">And we trigger Stream event
<i>request-cork/request-uncork</i> from the pulsemodule to the corresponding sink_input, so that it reaches corresponding client application stream.</span></p>
<p><span style="font-size: 11pt; color: rgb(0, 0, 0);">This is working perfectly fine for play and pause use-cases.</span></p>
<p><br>
</p>
<p><span style="font-size: 11pt; color: rgb(0, 0, 0);">But, we have also requirement to handle stop uses i,.e client application should be able to differentiate play/pause/stop events.</span><br>
</p>
<p><br>
</p>
<p><font color="black"><font size="2" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="#006FC9"><span style="font-size:10pt;" id="divtagdefaultwrapper"><font color="black"><font size="2" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="#006FC9"><span style="font-size:10pt;" id="divtagdefaultwrapper"></span></font></font></span></font></font></p>
<div style="margin-top:0;margin-bottom:0;"><font color="black"><font size="2" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="#006FC9"><font color="black"><font size="2" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="#006FC9"><font style="font-family: Calibri, Helvetica, sans-serif, serif, "EmojiFont";" size="2" face="Calibri,Helvetica,sans-serif" color="black"><span style="font-size:11pt;">From
our current understanding, the only way to notify client applications is through </span></font><font style="font-family: Calibri, Helvetica, sans-serif, serif, "EmojiFont";" size="2" face="Calibri,Helvetica,sans-serif" color="black"><span style="font-size:11pt;"><b><i>request-cork</i></b></span></font><font style="font-family: Calibri, Helvetica, sans-serif, serif, "EmojiFont";" size="2" face="Calibri,Helvetica,sans-serif" color="black"><span style="font-size:11pt;">
and </span></font><font style="font-family: Calibri, Helvetica, sans-serif, serif, "EmojiFont";" size="2" face="Calibri,Helvetica,sans-serif" color="black"><span style="font-size:11pt;"><b><i>request-uncork</i></b></span></font><font style="font-family: Calibri, Helvetica, sans-serif, serif, "EmojiFont";" size="2" face="Calibri,Helvetica,sans-serif" color="black"><span style="font-size:11pt;">
on stream events from server side. </span></font><font style="font-family: Calibri, Helvetica, sans-serif, serif, "EmojiFont";" size="2" face="Calibri,Helvetica,sans-serif" color="black"><span style="font-size:11pt;"><br>
</span></font></font></font></font></font></div>
<font color="black"><font size="2" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="#006FC9"><font color="black"><font size="2" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="#006FC9">
<div style="margin-top:0;margin-bottom:0;"><br>
</div>
<div style="margin-top:0;margin-bottom:0;"><font style="font-family: Calibri, Helvetica, sans-serif, serif, "EmojiFont";" size="2" face="Calibri,Helvetica,sans-serif" color="black"><span style="font-size:11pt;">On client side, those could be mapped like below.</span></font><br>
</div>
<ul style="margin-top:0;margin-bottom:0;">
<li><font style="font-family: Calibri, Helvetica, sans-serif, serif, "EmojiFont";" size="2" face="Calibri,Helvetica,sans-serif" color="black"><span style="font-size:11pt;"><i>request-cork -> PAUSE</i></span></font></li><li><font style="font-family: Calibri, Helvetica, sans-serif, serif, "EmojiFont";" size="2" face="Calibri,Helvetica,sans-serif" color="black"><span style="font-size:11pt;"><i>request-uncork -> PLAY/RESUME</i></span></font><i><br>
</i></li><li><font size="2" color="black"><span style="font-size:11pt;"><i>? -> STOP</i></span></font><br>
</li></ul>
<div id="Signature">
<div id="divtagdefaultwrapper"><font size="3" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="black"><span style="font-size:12pt;" id="divtagdefaultwrapper">
<div style="margin-top:0;margin-bottom:0;"><br>
<span style="font-size: 11pt;"></span></div>
<span style="font-size: 11pt;"></span>
<div style="margin-top:0;margin-bottom:0;"><font size="2"><span style="font-size:11pt;">Other possibilities we thought and also experimented to differentiate Stop from Pause are below:</span></font></div>
<span style="font-size: 11pt;"></span>
<ol style="margin-top:0;margin-bottom:0;">
<li><font size="2"><span style="font-size:11pt;">Unlink the sinkinput from our pulsemodule side based on AudioManager policy</span></font><font size="2"><span style="font-size:11pt;"> decision.</span></font><font size="2"><span style="font-size:11pt;"><br>
</span></font><span style="font-size: 11pt;"></span>
<ul style="margin-top:0;margin-bottom:0;">
<li><font size="2"><span style="font-size:11pt;">[Concern] - This might lead to ungraceful notification on client side.</span></font></li><li><font size="2"><span style="font-size:11pt;">[Concern] - client application gets PA_STREAM_FAILED, which is difficult to differentiate whether it is stop or real stream failure at pulseaudio server side.<br>
</span></font></li></ul>
<span style="font-size: 11pt;"></span></li><li><font size="2"><span style="font-size:11pt;">We could either add/append custom property in the stream properties about the state(</span></font><font size="2"><span style="font-size:11pt;"><i><span style="font-size: 11pt;">stop</span></i></span></font><font size="2"><span style="font-size:11pt;">)
- So, that the client-application can read this custom property from the stream and act accordingly.</span></font><span style="font-size: 11pt;">
</span>
<ul style="margin-top:0;margin-bottom:0;">
<li><font size="2"><span style="font-size:11pt;">[Concern] - Every client-application has to implement this specific handling in addition to cork/uncork handling.</span></font></li><li><font size="2"><span style="font-size:11pt;">[Concern] - Still some sort of server-side
</span></font><font size="2"><span style="font-size:11pt;"><i><span style="font-size: 11pt;">trigger</span></i></span></font><font size="2"><span style="font-size:11pt;"> is required towards client so that, they could read this custom property of the stream.</span></font></li></ul>
<font size="2"><span style="font-size:11pt;"></span></font></li><li><font size="2"><span style="font-size:11pt;"></span></font><font color="black"><font size="2" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="#006FC9"><font color="black"><font size="2" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="#006FC9"><font size="3" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="black"><span style="font-size:12pt;" id="divtagdefaultwrapper"><font size="2"><span style="font-size:11pt;">As
stream events are actually textual information, we tried to send '<i>request-stop</i>' for our use case. And this is transparently transmitted to applications as stream event.</span></font></span></font></font></font></font></font>
<ol>
<li><font color="black"><font size="2" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="#006FC9"><font color="black"><font size="2" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="#006FC9"><font size="3" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="black"><span style="font-size:12pt;" id="divtagdefaultwrapper"><font size="2"><span style="font-size:11pt;"><font size="3"><span style="font-size: 11pt;">This
works fine for client applications that </span></font><span style="font-size: 11pt;">uses pulseaudio api directly.</span></span></font></span></font></font></font></font></font></li></ol>
<ul style="margin-bottom: 0px; margin-top: 0px;">
<li><font color="black"><font size="2" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="#006FC9"><font color="black"><font size="2" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="#006FC9"><font size="3" face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" color="black"><span style="font-size:12pt;" id="divtagdefaultwrapper"><font size="2"><span style="font-size:11pt;">[Concern]
- This is problematic for applications that use GStreamer. because, we need to adapt GStreamer plugins for pulseaudio to handle this custom event 'request-stop'.</span></font></span></font></font></font></font></font></li></ul>
</li></ol>
<div><br>
</div>
<div><font size="2"><span style="font-size: 11pt;">Please provide your inputs or suggestions on this matter.</span></font></div>
<div><font size="2"><span style="font-size: 11pt;">Any help would be highly appreciated.<br>
</span></font></div>
<div><font size="2"><br>
</font></div>
<div><font size="2"><span style="font-size: 11pt;">Thank you</span><br>
</font></div>
<div><font size="2"><span style="font-size: 11pt;">Regards,</span></font></div>
<div><font size="2"><span style="font-size: 11pt;">Arun</span></font><br>
</div>
</span></font></div>
</div>
</font></font></font></font>
<p></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1"><br>
This e-mail and any attachment(s) are intended only for the recipient(s) named above and others who have been specifically authorized to receive them. They may contain confidential information. If you are not the intended recipient, please do not read this
email or its attachment(s). Furthermore, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by
replying to this e-mail and then delete this e-mail and any attachment(s) or copies thereof from your system. Thank you.<br>
</font>
</body>
</html>