Hi,请教一下
本人使用examples\recorder\pipeline_raw_http例程,想实现多次录音上传的操作,实际测试发现只有第一次按下REC键可以录音并上传http服务器,松开rec键后上传结束;第二次及以后按下rec键后,element自动abord, 各位有解决这个问题的吗?谢谢!
使用硬件 ESP32-LyraT-V4.3
ADF版本:App version: v2.3-228-g7b844d5-dirty
IDF版本:ESP-IDF: v4.1-beta2-141-g84b5178-dirty
log:
I (15211) REC_RAW_HTTP: [ 2 ] Start codec chip
E (15211) gpio: gpio_install_isr_service(438): GPIO isr service already installed
I (15231) REC_RAW_HTTP: [3.0] Create audio pipeline for recording
I (15231) REC_RAW_HTTP: [3.1] Create http stream to post data to server
I (15241) REC_RAW_HTTP: [3.2] Create i2s stream to read audio data from codec chip
I (15281) REC_RAW_HTTP: [3.3] Register all elements to audio pipeline
I (15281) REC_RAW_HTTP: [3.4] Link it together [codec_chip]-->i2s_stream->http_stream-->[http_server]
W (15311) PERIPH_TOUCH: _touch_init
I (15351) REC_RAW_HTTP: [ 4 ] Press [Rec] button to record, Press [Mode] to exit
I (26291) REC_RAW_HTTP: [ * ] [Rec] input key event, resuming pipeline ... //第一次录音上传ok
Total bytes written: 72704
Total bytes written: 73728
I (27481) REC_RAW_HTTP: [ + ] HTTP client HTTP_STREAM_POST_REQUEST, write end chunked marker
I (27531) REC_RAW_HTTP: [ + ] HTTP client HTTP_STREAM_FINISH_REQUEST
W (27551) HTTP_CLIENT: esp_transport_read returned:-1 and errno:128
W (27551) AUDIO_PIPELINE: Without stop, st:1
W (27551) AUDIO_PIPELINE: Without wait stop, st:1
I (56951) REC_RAW_HTTP: [ * ] [Rec] input key event, resuming pipeline ... //第二次
I (56951) REC_RAW_HTTP: [ + ] HTTP client HTTP_STREAM_PRE_REQUEST, lenght=0
W (56961) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
W (56961) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
W (56961) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
Total bytes written: 8192
W (57221) AUDIO_ELEMENT: IN-[http] AEL_IO_ABORT
I (57221) REC_RAW_HTTP: [ + ] HTTP client HTTP_STREAM_POST_REQUEST, write end chunked marker
I (57281) REC_RAW_HTTP: [ + ] HTTP client HTTP_STREAM_FINISH_REQUEST
W (57301) HTTP_CLIENT: esp_transport_read returned:-1 and errno:128
I (58461) REC_RAW_HTTP: [ * ] [Rec] key released, stop pipeline ...
E (58461) AUDIO_ELEMENT: [i2s] Element already stopped
E (58461) AUDIO_ELEMENT: [http] Element already stopped
W (58461) AUDIO_PIPELINE: Without stop, st:1
W (58471) AUDIO_PIPELINE: Without wait stop, st:1
I (77841) REC_RAW_HTTP: [ * ] [Rec] input key event, resuming pipeline ...
Total bytes written: 6144
W (77901) AUDIO_ELEMENT: IN-[http] AEL_IO_ABORT
I (77901) REC_RAW_HTTP: [ + ] HTTP client HTTP_STREAM_POST_REQUEST, write end chunked marker
I (78031) REC_RAW_HTTP: [ + ] HTTP client HTTP_STREAM_FINISH_REQUEST
W (78051) HTTP_CLIENT: esp_transport_read returned:-1 and errno:128
W (78051) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
W (78051) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
W (78051) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
W (78061) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
I (80291) REC_RAW_HTTP: [ * ] [Rec] key released, stop pipeline ...
E (80291) AUDIO_ELEMENT: [i2s] Element already stopped
E (80291) AUDIO_ELEMENT: [http] Element already stopped
W (80291) AUDIO_PIPELINE: Without stop, st:1
W (80301) AUDIO_PIPELINE: Without wait stop, st:1
pipeline_raw_http例程只能执行一次录音
-
- Posts: 184
- Joined: Fri Dec 15, 2017 2:45 am
Re: pipeline_raw_http例程只能执行一次录音
pipeline_raw_http 这个例程是支持多次上传的。每次长按录音键即可以上传,松开就停止上传。
对于你的这个问题,我建议你吧 http server 端的(Python 脚本运行的PC端) log 也贴出来看看。
对于你的这个问题,我建议你吧 http server 端的(Python 脚本运行的PC端) log 也贴出来看看。
Re: pipeline_raw_http例程只能执行一次录音
感谢回复!
我使用的是python 3.8.5版本,我的server端的log如下,还请再帮看下,谢谢
Serving HTTP on 0.0.0.0 port 8000
Audio information, sample rates: 16000, bits: 16, channel(s): 2
Total bytes received: 1024
[FTotal bytes received: 2048
[FTotal bytes received: 3072
。。。。。。
[FTotal bytes received: 77824
----------------------------------------
Exception happened during processing of request from ('192.168.43.230', 51789)
Traceback (most recent call last):
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Users\cary.liurk\Anaconda3\lib\http\server.py", line 647, in __init__
super().__init__(*args, **kwargs)
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 720, in __init__
self.handle()
File "C:\Users\cary.liurk\Anaconda3\lib\http\server.py", line 427, in handle
self.handle_one_request()
File "C:\Users\cary.liurk\Anaconda3\lib\http\server.py", line 415, in handle_one_request
method()
File "server.py", line 66, in do_POST
filename = self._write_wav(data, int(sample_rates), int(bits), int(channel))
File "server.py", line 34, in _write_wav
wavfile.writeframes(bytearray(data))
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 438, in writeframes
self.writeframesraw(data)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 427, in writeframesraw
self._ensure_header_written(len(data))
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 468, in _ensure_header_written
self._write_header(datasize)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 480, in _write_header
self._file.write(struct.pack('<L4s4sLHHLLHH4s',
struct.error: required argument is not an integer
----------------------------------------
Exception ignored in: <function Wave_write.__del__ at 0x00000207B966DAF0>
Traceback (most recent call last):
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 327, in __del__
self.close()
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 445, in close
self._ensure_header_written(0)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 468, in _ensure_header_written
self._write_header(datasize)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 480, in _write_header
self._file.write(struct.pack('<L4s4sLHHLLHH4s',
struct.error: required argument is not an integer
[FAudio information, sample rates: 16000, bits: 16, channel(s): 2 //第二次失败
Total bytes received: 1024
[FTotal bytes received: 2048
[FTotal bytes received: 3072
[FTotal bytes received: 4096
[FTotal bytes received: 5120
[FTotal bytes received: 6144
[FTotal bytes received: 7168
[FTotal bytes received: 8192
[FTotal bytes received: 8192
----------------------------------------
Exception happened during processing of request from ('192.168.43.230', 51790)
Traceback (most recent call last):
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Users\cary.liurk\Anaconda3\lib\http\server.py", line 647, in __init__
super().__init__(*args, **kwargs)
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 720, in __init__
self.handle()
File "C:\Users\cary.liurk\Anaconda3\lib\http\server.py", line 427, in handle
self.handle_one_request()
File "C:\Users\cary.liurk\Anaconda3\lib\http\server.py", line 415, in handle_one_request
method()
File "server.py", line 66, in do_POST
filename = self._write_wav(data, int(sample_rates), int(bits), int(channel))
File "server.py", line 34, in _write_wav
wavfile.writeframes(bytearray(data))
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 438, in writeframes
self.writeframesraw(data)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 427, in writeframesraw
self._ensure_header_written(len(data))
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 468, in _ensure_header_written
self._write_header(datasize)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 480, in _write_header
self._file.write(struct.pack('<L4s4sLHHLLHH4s',
struct.error: required argument is not an integer
----------------------------------------
Exception ignored in: <function Wave_write.__del__ at 0x00000207B966DAF0>
Traceback (most recent call last):
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 327, in __del__
self.close()
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 445, in close
self._ensure_header_written(0)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 468, in _ensure_header_written
self._write_header(datasize)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 480, in _write_header
self._file.write(struct.pack('<L4s4sLHHLLHH4s',
struct.error: required argument is not an integer
python 3对应的文件是:
import os, datetime, sys
from urllib import parse
import http.server
import wave
PORT = 8000
HOST = '0.0.0.0'
class Handler(http.server.SimpleHTTPRequestHandler):
def _set_headers(self, length):
self.send_response(200)
if length > 0:
self.send_header('Content-length', str(length))
self.end_headers()
def _get_chunk_size(self):
data = self.rfile.read(2)
while data[-2:] != b"\r\n":
data += self.rfile.read(1)
return int(data[:-2], 16)
def _get_chunk_data(self, chunk_size):
data = self.rfile.read(chunk_size)
self.rfile.read(2)
return data
def _write_wav(self, data, rates, bits, ch):
t = datetime.datetime.utcnow()
time = t.strftime('%Y%m%dT%H%M%SZ')
filename = str.format('{}_{}_{}_{}.wav', time, rates, bits, ch)
wavfile = wave.open(filename, 'wb')
wavfile.setparams((ch, bits/8, rates, 0, 'NONE', 'NONE'))
wavfile.writeframes(bytearray(data))
wavfile.close()
return filename
def do_POST(self):
urlparts = parse.urlparse(self.path)
request_file_path = urlparts.path.strip('/')
total_bytes = 0
sample_rates = 0
bits = 0
channel = 0
if (request_file_path == 'upload'
and self.headers.get('Transfer-Encoding', '').lower() == 'chunked'):
data = []
sample_rates = self.headers.get('x-audio-sample-rates', '').lower()
bits = self.headers.get('x-audio-bits', '').lower()
channel = self.headers.get('x-audio-channel', '').lower()
sample_rates = self.headers.get('x-audio-sample-rates', '').lower()
print("Audio information, sample rates: {}, bits: {}, channel(s): {}".format(sample_rates, bits, channel))
# https://stackoverflow.com/questions/245 ... ttp-client
while True:
chunk_size = self._get_chunk_size()
total_bytes += chunk_size
print("Total bytes received: {}".format(total_bytes))
sys.stdout.write("\033[F")
if (chunk_size == 0):
break
else:
chunk_data = self._get_chunk_data(chunk_size)
data += chunk_data
filename = self._write_wav(data, int(sample_rates), int(bits), int(channel))
body = 'File {} was written, size {}'.format(filename, total_bytes)
self._set_headers(len(body))
self.wfile.write(body)
self.wfile.close()
else:
return http.server.SimpleHTTPRequestHandler.do_GET(self)
httpd = http.server.HTTPServer((HOST, PORT), Handler)
print("Serving HTTP on {} port {}".format(HOST, PORT));
httpd.serve_forever()
我使用的是python 3.8.5版本,我的server端的log如下,还请再帮看下,谢谢
Serving HTTP on 0.0.0.0 port 8000
Audio information, sample rates: 16000, bits: 16, channel(s): 2
Total bytes received: 1024
[FTotal bytes received: 2048
[FTotal bytes received: 3072
。。。。。。
[FTotal bytes received: 77824
----------------------------------------
Exception happened during processing of request from ('192.168.43.230', 51789)
Traceback (most recent call last):
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Users\cary.liurk\Anaconda3\lib\http\server.py", line 647, in __init__
super().__init__(*args, **kwargs)
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 720, in __init__
self.handle()
File "C:\Users\cary.liurk\Anaconda3\lib\http\server.py", line 427, in handle
self.handle_one_request()
File "C:\Users\cary.liurk\Anaconda3\lib\http\server.py", line 415, in handle_one_request
method()
File "server.py", line 66, in do_POST
filename = self._write_wav(data, int(sample_rates), int(bits), int(channel))
File "server.py", line 34, in _write_wav
wavfile.writeframes(bytearray(data))
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 438, in writeframes
self.writeframesraw(data)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 427, in writeframesraw
self._ensure_header_written(len(data))
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 468, in _ensure_header_written
self._write_header(datasize)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 480, in _write_header
self._file.write(struct.pack('<L4s4sLHHLLHH4s',
struct.error: required argument is not an integer
----------------------------------------
Exception ignored in: <function Wave_write.__del__ at 0x00000207B966DAF0>
Traceback (most recent call last):
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 327, in __del__
self.close()
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 445, in close
self._ensure_header_written(0)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 468, in _ensure_header_written
self._write_header(datasize)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 480, in _write_header
self._file.write(struct.pack('<L4s4sLHHLLHH4s',
struct.error: required argument is not an integer
[FAudio information, sample rates: 16000, bits: 16, channel(s): 2 //第二次失败
Total bytes received: 1024
[FTotal bytes received: 2048
[FTotal bytes received: 3072
[FTotal bytes received: 4096
[FTotal bytes received: 5120
[FTotal bytes received: 6144
[FTotal bytes received: 7168
[FTotal bytes received: 8192
[FTotal bytes received: 8192
----------------------------------------
Exception happened during processing of request from ('192.168.43.230', 51790)
Traceback (most recent call last):
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Users\cary.liurk\Anaconda3\lib\http\server.py", line 647, in __init__
super().__init__(*args, **kwargs)
File "C:\Users\cary.liurk\Anaconda3\lib\socketserver.py", line 720, in __init__
self.handle()
File "C:\Users\cary.liurk\Anaconda3\lib\http\server.py", line 427, in handle
self.handle_one_request()
File "C:\Users\cary.liurk\Anaconda3\lib\http\server.py", line 415, in handle_one_request
method()
File "server.py", line 66, in do_POST
filename = self._write_wav(data, int(sample_rates), int(bits), int(channel))
File "server.py", line 34, in _write_wav
wavfile.writeframes(bytearray(data))
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 438, in writeframes
self.writeframesraw(data)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 427, in writeframesraw
self._ensure_header_written(len(data))
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 468, in _ensure_header_written
self._write_header(datasize)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 480, in _write_header
self._file.write(struct.pack('<L4s4sLHHLLHH4s',
struct.error: required argument is not an integer
----------------------------------------
Exception ignored in: <function Wave_write.__del__ at 0x00000207B966DAF0>
Traceback (most recent call last):
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 327, in __del__
self.close()
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 445, in close
self._ensure_header_written(0)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 468, in _ensure_header_written
self._write_header(datasize)
File "C:\Users\cary.liurk\Anaconda3\lib\wave.py", line 480, in _write_header
self._file.write(struct.pack('<L4s4sLHHLLHH4s',
struct.error: required argument is not an integer
python 3对应的文件是:
import os, datetime, sys
from urllib import parse
import http.server
import wave
PORT = 8000
HOST = '0.0.0.0'
class Handler(http.server.SimpleHTTPRequestHandler):
def _set_headers(self, length):
self.send_response(200)
if length > 0:
self.send_header('Content-length', str(length))
self.end_headers()
def _get_chunk_size(self):
data = self.rfile.read(2)
while data[-2:] != b"\r\n":
data += self.rfile.read(1)
return int(data[:-2], 16)
def _get_chunk_data(self, chunk_size):
data = self.rfile.read(chunk_size)
self.rfile.read(2)
return data
def _write_wav(self, data, rates, bits, ch):
t = datetime.datetime.utcnow()
time = t.strftime('%Y%m%dT%H%M%SZ')
filename = str.format('{}_{}_{}_{}.wav', time, rates, bits, ch)
wavfile = wave.open(filename, 'wb')
wavfile.setparams((ch, bits/8, rates, 0, 'NONE', 'NONE'))
wavfile.writeframes(bytearray(data))
wavfile.close()
return filename
def do_POST(self):
urlparts = parse.urlparse(self.path)
request_file_path = urlparts.path.strip('/')
total_bytes = 0
sample_rates = 0
bits = 0
channel = 0
if (request_file_path == 'upload'
and self.headers.get('Transfer-Encoding', '').lower() == 'chunked'):
data = []
sample_rates = self.headers.get('x-audio-sample-rates', '').lower()
bits = self.headers.get('x-audio-bits', '').lower()
channel = self.headers.get('x-audio-channel', '').lower()
sample_rates = self.headers.get('x-audio-sample-rates', '').lower()
print("Audio information, sample rates: {}, bits: {}, channel(s): {}".format(sample_rates, bits, channel))
# https://stackoverflow.com/questions/245 ... ttp-client
while True:
chunk_size = self._get_chunk_size()
total_bytes += chunk_size
print("Total bytes received: {}".format(total_bytes))
sys.stdout.write("\033[F")
if (chunk_size == 0):
break
else:
chunk_data = self._get_chunk_data(chunk_size)
data += chunk_data
filename = self._write_wav(data, int(sample_rates), int(bits), int(channel))
body = 'File {} was written, size {}'.format(filename, total_bytes)
self._set_headers(len(body))
self.wfile.write(body)
self.wfile.close()
else:
return http.server.SimpleHTTPRequestHandler.do_GET(self)
httpd = http.server.HTTPServer((HOST, PORT), Handler)
print("Serving HTTP on {} port {}".format(HOST, PORT));
httpd.serve_forever()
Re: pipeline_raw_http例程只能执行一次录音
你好,采用python 2版本的server端log如下:ESP_HengYC wrote: ↑Thu Feb 24, 2022 2:19 ampipeline_raw_http 这个例程是支持多次上传的。每次长按录音键即可以上传,松开就停止上传。
对于你的这个问题,我建议你吧 http server 端的(Python 脚本运行的PC端) log 也贴出来看看。
Serving HTTP on 0.0.0.0 port 8000
Audio information, sample rates: 16000, bits: 16, channel(s): 2
Total bytes received: 1024
[FTotal bytes received: 2048
[FTotal bytes received: 3072
。。。。。。
[FTotal bytes received: 98304
[F192.168.43.230 - - [24/Feb/2022 15:00:50] "POST /upload HTTP/1.1" 200 -
Audio information, sample rates: 16000, bits: 16, channel(s): 2
Total bytes received: 1024
[FTotal bytes received: 2048
[FTotal bytes received: 3072
[FTotal bytes received: 4096
[FTotal bytes received: 5120
[FTotal bytes received: 6144
[FTotal bytes received: 7168
[FTotal bytes received: 8192
[FTotal bytes received: 8192
[F192.168.43.230 - - [24/Feb/2022 15:00:59] "POST /upload HTTP/1.1" 200 -
Audio information, sample rates: 16000, bits: 16, channel(s): 2
Total bytes received: 1024
[FTotal bytes received: 2048
[FTotal bytes received: 3072
[FTotal bytes received: 4096
[FTotal bytes received: 4096
[F192.168.43.230 - - [24/Feb/2022 15:01:24] "POST /upload HTTP/1.1" 200 -
-
- Posts: 184
- Joined: Fri Dec 15, 2017 2:45 am
Re: pipeline_raw_http例程只能执行一次录音
看 log 上传 2 次是成功了的啊
Re: pipeline_raw_http例程只能执行一次录音
Serving HTTP on 0.0.0.0 port 8000
Audio information, sample rates: 16000, bits: 16, channel(s): 2
Total bytes received: 1024
[FTotal bytes received: 2048
......
[FTotal bytes received: 98304
[FTotal bytes received: 98304 //第一次 接收到此时OK的
[F192.168.43.230 - - [24/Feb/2022 15:00:50] "POST /upload HTTP/1.1" 200 -
Audio information, sample rates: 16000, bits: 16, channel(s): 2
Total bytes received: 1024
[FTotal bytes received: 2048
[FTotal bytes received: 3072
[FTotal bytes received: 4096
[FTotal bytes received: 5120
[FTotal bytes received: 6144
[FTotal bytes received: 7168
[FTotal bytes received: 8192
[FTotal bytes received: 8192 //第二次接收了很少的数据,此时我并没有松开按键去中止上传,从最开始我上传的client端log看都是"HTTP client HTTP_STREAM_POST_REQUEST, write end chunked marker"
[F192.168.43.230 - - [24/Feb/2022 15:00:59] "POST /upload HTTP/1.1" 200 -
Audio information, sample rates: 16000, bits: 16, channel(s): 2
Total bytes received: 1024
[FTotal bytes received: 2048
[FTotal bytes received: 3072
[FTotal bytes received: 4096
[FTotal bytes received: 4096 //第三次同样是很少的数据
[F192.168.43.230 - - [24/Feb/2022 15:01:24] "POST /upload HTTP/1.1" 200 -
-
- Posts: 184
- Joined: Fri Dec 15, 2017 2:45 am
Re: pipeline_raw_http例程只能执行一次录音
你好,
我在你的 log 看到了 `W (57301) HTTP_CLIENT: esp_transport_read returned:-1 and errno:128` 这样的错误异常。
不确定是不是由 esp_transport bug导致的, 我给你建议,你使用 最新 release v4.4 IDF 重新编译测试此例程。
看看是否可以修复上述的问题,谢谢你了。
我在你的 log 看到了 `W (57301) HTTP_CLIENT: esp_transport_read returned:-1 and errno:128` 这样的错误异常。
不确定是不是由 esp_transport bug导致的, 我给你建议,你使用 最新 release v4.4 IDF 重新编译测试此例程。
看看是否可以修复上述的问题,谢谢你了。
Re: pipeline_raw_http例程只能执行一次录音
你好,我用了idf V4.4的版本编译测试,首次上传都会失败的ESP_HengYC wrote: ↑Mon Feb 28, 2022 8:00 am你好,
我在你的 log 看到了 `W (57301) HTTP_CLIENT: esp_transport_read returned:-1 and errno:128` 这样的错误异常。
不确定是不是由 esp_transport bug导致的, 我给你建议,你使用 最新 release v4.4 IDF 重新编译测试此例程。
看看是否可以修复上述的问题,谢谢你了。
I (482) cpu_start: Application information:
I (486) cpu_start: Project name: record_raw_http
I (492) cpu_start: App version: v2.3-228-g7b844d5-dirty
I (498) cpu_start: Compile time: Mar 2 2022 15:16:13
I (504) cpu_start: ELF file SHA256: f7d3918d731c1cb1...
I (510) cpu_start: ESP-IDF: v4.4-dirty
I (516) heap_init: Initializing. RAM available for dynamic allocation:
I (523) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (529) heap_init: At 3FFB7890 len 00028770 (161 KiB): DRAM
I (535) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (541) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (548) heap_init: At 400964DC len 00009B24 (38 KiB): IRAM
I (555) spi_flash: detected chip: generic
I (559) spi_flash: flash io: dio
I (564) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (671) REC_RAW_HTTP: [ 1 ] Initialize Button Peripheral & Connect to wifi network
W (1821) PERIPH_WIFI: Wi-Fi disconnected from SSID LRK, auto-reconnect enabled, reconnect after 1000 ms
W (4871) PERIPH_WIFI: Wi-Fi disconnected from SSID LRK, auto-reconnect enabled, reconnect after 1000 ms
W (5941) PERIPH_WIFI: WiFi Event cb, Unhandle event_base:WIFI_EVENT, event_id:4
I (6671) REC_RAW_HTTP: [ 2 ] Start codec chip
E (6671) gpio: gpio_install_isr_service(449): GPIO isr service already installed
I (6691) REC_RAW_HTTP: [3.0] Create audio pipeline for recording
I (6691) REC_RAW_HTTP: [3.1] Create http stream to post data to server
I (6701) REC_RAW_HTTP: [3.2] Create i2s stream to read audio data from codec chip
I (6711) REC_RAW_HTTP: [3.3] Register all elements to audio pipeline
I (6711) REC_RAW_HTTP: [3.4] Link it together [codec_chip]-->i2s_stream->http_stream-->[http_server]
I (6721) REC_RAW_HTTP: [ 4 ] Press [Rec] button to record, Press [Mode] to exit
W (6751) PERIPH_TOUCH: _touch_init
I (75051) REC_RAW_HTTP: [ * ] [Rec] input key event, resuming pipeline ...
Total bytes written: 2048
E (75481) TRANSPORT_BASE: poll_write select error 104, errno = Connection reset by peer, fd = 54
W (75481) TRANSPORT_BASE: Poll timeout or error, errno=Success, fd=54, timeout_ms=30000
E (75491) HTTP_STREAM: Failed to process user callback
E (75491) AUDIO_ELEMENT: OUT-[http] AEL_STATUS_ERROR_OUTPUT
E (75501) AUDIO_ELEMENT: [http] ERROR_PROCESS, AEL_IO_FAIL
W (75511) AUDIO_ELEMENT: [http] audio_element_on_cmd_error,3
E (75511) HTTP_STREAM: POST_REQUEST 2
I (75521) REC_RAW_HTTP: [ + ] HTTP client HTTP_STREAM_POST_REQUEST, write end chunked marker
E (75531) TRANSPORT_BASE: poll_write select error 0, errno = Success, fd = 54
W (75531) TRANSPORT_BASE: Poll timeout or error, errno=Success, fd=54, timeout_ms=30000
I (76741) REC_RAW_HTTP: [ * ] [Rec] key released, stop pipeline ...
E (76741) AUDIO_ELEMENT: [http] Element already stopped
W (76741) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
W (76741) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
W (76751) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
W (76751) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
W (76761) AUDIO_PIPELINE: Without stop, st:1
W (76761) AUDIO_PIPELINE: Without wait stop, st:1
I (81721) REC_RAW_HTTP: [ * ] [Rec] input key event, resuming pipeline ...
W (81721) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
W (81721) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
W (81721) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
W (81731) AUDIO_ELEMENT: OUT-[i2s] AEL_IO_ABORT
Total bytes written: 3072
E (81921) TRANSPORT_BASE: poll_write select error 104, errno = Connection reset by peer, fd = 54
W (81921) TRANSPORT_BASE: Poll timeout or error, errno=Success, fd=54, timeout_ms=30000
E (81931) HTTP_STREAM: Failed to process user callback
E (81941) AUDIO_ELEMENT: OUT-[http] AEL_STATUS_ERROR_OUTPUT
E (81941) AUDIO_ELEMENT: [http] ERROR_PROCESS, AEL_IO_FAIL
W (81951) AUDIO_ELEMENT: [http] audio_element_on_cmd_error,3
E (81961) HTTP_STREAM: POST_REQUEST 2
I (81961) REC_RAW_HTTP: [ + ] HTTP client HTTP_STREAM_POST_REQUEST, write end chunked marker
E (81971) TRANSPORT_BASE: poll_write select error 0, errno = Success, fd = 54
W (81981) TRANSPORT_BASE: Poll timeout or error, errno=Success, fd=54, timeout_ms=30000
I (82991) REC_RAW_HTTP: [ * ] [Rec] key released, stop pipeline ...
E (82991) AUDIO_ELEMENT: [i2s] Element already stopped
E (82991) AUDIO_ELEMENT: [http] Element already stopped
W (82991) AUDIO_PIPELINE: Without stop, st:1
W (83001) AUDIO_PIPELINE: Without wait stop, st:1
Who is online
Users browsing this forum: No registered users and 18 guests