<div dir="ltr">I set the second parameter of pa_stream_connect_record with NULL.<div>I could get PA_STREAM READY in the stream callback!<br></div><div><br></div><div>OK<br> pa_stream_connect_record(s, NULL, NULL, 0)<br></div><div><br></div><div>NG<br> pa_stream_connect_record(s, source, NULL, 0)<br></div>  (source : bluez_source.00_14_BE_8A_7B_<wbr>FE)<br><div><br></div><div><div>I got a problem, but I can't understand mechanism.<br></div></div><div>I checked the pactl like this:<br></div><div>root@OpenWrt:/opt/ipkt/lib# pactl info list<br>Server String: /var/run/pulse/native<br>Library Protocol Version: 30<br>Server Protocol Version: 30<br>Is Local: yes<br>Client Index: 3<br>Tile Size: 4056<br>User Name: pulse<br>Host Name: OpenWrt<br>Server Name: pulseaudio<br>Server Version: 6.0-dirty<br>Default Sample Specification: s16be 2ch 44100Hz<br>Default Channel Map: front-left,front-right<br>Default Sink: bluez_sink.00_14_BE_8A_7B_FE<br>Default Source: bluez_source.00_14_BE_8A_7B_FE<br>Cookie: e5ae:1788<br></div><div><br></div><div>I used the second parameter of pa_stream_connect_record as a bluez_source.00_14_BE_8A_7B_FE.<br></div><div>This is a same value of default source.</div><div>What is the difference on this?<br></div><div><br></div><div>Best Regards,</div><div>Shinnnosuke Suzuki<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-10-23 1:10 GMT+09:00 Tanu Kaskinen <span dir="ltr"><<a href="mailto:tanuk@iki.fi" target="_blank">tanuk@iki.fi</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, 2017-10-21 at 12:11 +0900, Shinnosuke Suzuki wrote:<br>
> Sorry for leading you to misunderstand.<br>
><br>
> > Doesn't your compiler warn you about passing an argument of wrong type<br>
> > to pa_context_errno()? The function expects a pa_context object, but in<br>
> > the first case you're passing it a pa_stream object.<br>
><br>
> I got warning in the first case, so I changed the code like this:<br>
><br>
> switch(pa_stream_get_state(s))<wbr>{<br>
> case PA_STREAM_FAILED:<br>
>   printf("%s\n, pa_strerror(pa_context_errno(<wbr>pa_stream_get_context(s))));<br>
><br>
> After that, I got error “Invalid argument”.<br>
<br>
</span>Ok, then this is starting to look less strange. You're probably giving<br>
some bad argument to the pa_stream_connect_* functions.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Tanu<br>
<br>
<a href="https://www.patreon.com/tanuk" rel="noreferrer" target="_blank">https://www.patreon.com/tanuk</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--<br>Shinnosuke Suzuki<br>E-mail : <a href="mailto:suzukisn@gmail.com" target="_blank">suzukisn@gmail.com</a></div>
</div>