<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 10.02.2018 02:11, Shinnosuke Suzuki
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:170FE7A5-EC46-4529-A69E-84A96EE32BC8@gmail.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Hi<br class="">
<div><br class="">
</div>
<div>
<blockquote type="cite" class="">PA 11.1 should work fine with
your kernel and bluez version.<br class="">
</blockquote>
<br class="">
</div>
<div>Thank you, I’ll try that.</div>
<div><br class="">
</div>
<div>
<blockquote type="cite" class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">When you record from the BT
headset, the BT headset is set to HSP/HFP.<br class="">
This means that recording and playback stream are at 8kHz,
not 16kHz.<br class="">
</blockquote>
</blockquote>
</blockquote>
</div>
<div><br class="">
</div>
<div>I want to handle voice packet as <span style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">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);" class=""> static pa_sample_spec samplespec = {
.format = PA_SAMPLE_S16LE, /* Linear 16bit */
.rate = 16000, /* 16000Hz */
.channels = 1 /* mono */
}</pre>
<div class="">Does it means .rate should be 8000?</div>
</div>
</blockquote>
<br>
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?<br>
<br>
<blockquote type="cite"
cite="mid:170FE7A5-EC46-4529-A69E-84A96EE32BC8@gmail.com">
<div>
<div class=""><br class="">
</div>
</div>
<div>
<blockquote type="cite" class="">You should not expect to get a
fixed number of bytes in a fixed time<br class="">
interval. This is only true on average but not for a single
callback. Are<br class="">
the 96 bytes an average value?<br class="">
If your application needs constant size data packets, you may
have to<br class="">
buffer some data.<br class="">
Did you take a look at the pacat code to see how reading data
from<br class="">
a stream is done correctly?<br class="">
</blockquote>
<br class="">
</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);" class="">Linear 16bit little endian 16000Hz</span>.</div>
<div><br class="">
</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);" class="">I implemented like pacat except
silence hole using pa_silence_memory().</div>
</div>
</blockquote>
<br>
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>
</body>
</html>