<div dir="ltr"><div><div><div>Hi<span class="gmail-im"></span><span class="gmail-im"></span><br><br><span class="gmail-im"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF">
</div></blockquote></div></span><span class="gmail-im"><span class="gmail-im">
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)"><span class="gmail-im"><blockquote type="cite" style="font-family:Helvetica">Did you test other resample methods? There are quite a few available<br>and "trivial" is definitely the worst of them.<br></blockquote></span></div></span></span><div class="gmail_quote"><div>Although it maybe depend on CPU, Is there any recommend setting for resampling-method?<br></div><div>Could you tell me a character for each parameters in
resampling-method?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF">Sorry, currently I have no idea what goes wrong. The number of 96
bytes / 10ms<br>
sounds weird and does not match any of the involved sample rates /
formats.<br>
Is your code available somewhere so that I can take a look?<br>
</div>
</blockquote></div>
<br></div>I attached source code to control pulseaudio.Could you take a look my code?<br></div>start function<br> usbbtf_hs_start()<br></div>read callback<br> usbbtf_hs_stream_read_cb()<br><div><div><br></div><div>I got 96bytes voice data as a parameter
of usbbtf_hs_stream_read_cb().<br>So I didn't have a clue to find any hint on this code.<br><br><div><div><div class="gmail_extra">Is there any sample code for implement to control pulseaudio?<br></div><div class="gmail_extra">Is it possibly code for parec and another command for pulseaudio?<br></div><div class="gmail_extra">I refered to Linux Sound Programming.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Best Regards,<br></div><div class="gmail_extra">Shinnosuke Suzuki<br></div><div class="gmail_extra"><div class="gmail_quote">2018-02-11 6:12 GMT+09:00 Georg Chini <span dir="ltr"><<a href="mailto:georg@chini.tk" target="_blank">georg@chini.tk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF"><span class="gmail-">
<div class="gmail-m_6002881904753637942moz-cite-prefix">On 10.02.2018 02:11, Shinnosuke Suzuki
wrote:<br>
</div>
<blockquote type="cite">
Hi<br>
<div><br>
</div>
<div>
<blockquote type="cite">PA 11.1 should work fine with
your kernel and bluez version.<br>
</blockquote>
<br>
</div>
<div>Thank you, I’ll try that.</div>
<div><br>
</div>
<div>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">When you record from the BT
headset, the BT headset is set to HSP/HFP.<br>
This means that recording and playback stream are at 8kHz,
not 16kHz.<br>
</blockquote>
</blockquote>
</blockquote>
</div>
<div><br>
</div>
<div>I want to handle voice packet as <span style="white-space:pre-wrap;background-color:rgb(255,255,255)">Linear 16bit little endian 16000Hz,</span></div>
<div>I configure stream as follows.</div>
<div>
<pre style="white-space:pre-wrap;background-color:rgb(255,255,255)"> static pa_sample_spec samplespec = {
.format = PA_SAMPLE_S16LE, /* Linear 16bit */
.rate = 16000, /* 16000Hz */
.channels = 1 /* mono */
}</pre>
<div>Does it means .rate should be 8000?</div>
</div>
</blockquote>
<br></span>
It should work if you specify 16kHz because PA will do the
resampling.<br>
But I would try with 8kHz, just to see if something changes.<br>
Did you try another source? Does parecord work with your headset?<span class="gmail-"><br>
<br>
<blockquote type="cite">
<div>
<div><br>
</div>
</div>
<div>
<blockquote type="cite">You should not expect to get a
fixed number of bytes in a fixed time<br>
interval. This is only true on average but not for a single
callback. Are<br>
the 96 bytes an average value?<br>
If your application needs constant size data packets, you may
have to<br>
buffer some data.<br>
Did you take a look at the pacat code to see how reading data
from<br>
a stream is done correctly?<br>
</blockquote>
<br>
</div>
<div>I don’t expect fixed number of bytes. So, I implemented to
buffer voice packets in read callback.</div>
<div>However I got voice packet on my callback at 96 bytes per
10ms constantly.</div>
<div>It means I couldn’t get sufficient voice packet because voice
packet needs </div>
<div>at least 320bytes per 10ms in case of <span style="white-space:pre-wrap;background-color:rgb(255,255,255)">Linear 16bit little endian 16000Hz</span>.</div>
<div><br>
</div>
<div>I read pacat how to handle voice packet in read callback.</div>
<div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">I implemented like pacat except
silence hole using pa_silence_memory().</div>
</div>
</blockquote>
<br></span>
Sorry, currently I have no idea what goes wrong. The number of 96
bytes / 10ms<br>
sounds weird and does not match any of the involved sample rates /
formats.<br>
Is your code available somewhere so that I can take a look?<br>
</div>
</blockquote></div><br><br>-- <br><div class="gmail_signature">--<br>Shinnosuke Suzuki<br>E-mail : <a href="mailto:suzukisn@gmail.com" target="_blank">suzukisn@gmail.com</a></div>
</div></div></div></div></div></div>