You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Audio frames are dropped during on-ongoing record session "retire_capture_urb" #40
When recording an on-going Audio session, using on-board audio device, kernel log shows:
"retire_capture_urb: NN callbacks suppressed"
During this time-frame, the produced audio file is missing frames.
Reproduced on
TinkerOS versions 2.0.7 and 2.0.8
Kernel versions: 4.4.103+ and 4.4.132+
Hi @jamess-huang , Thanks for the prompt reply.
I've attached alsa.conf (as alsa.conf.log in order to comply to GitHub's allowed extensions policy) alsa.conf.log
The recording code snippet is the following (Python3 code):
`
import time, redis
class Record():
def init(self):
self.r = redis.StrictRedis(unix_socket_path="/var/run/redis/redis.sock")
Sorry to ask this: Did you try to use the same python code on Raspberry Pi or another SBC board ?
Just make sure that there is no issue in this python code.
I've setup a test environment on an RPi 3B+, using an external / USB audio device (as the RPi onboard does not have a capture interface).
Kernel version: 4.19.25-v7+
This device does not seem to have any callback drops nor missing audio chunks on the recorded data.
Hi
I've just encountered the same problem with tinkerOS 2.0.8, there are a lot of audio chunks drops. @james-huang did you find any resolution to this problem?
@topdjgod
Thank you for your support.
The proposed code does not use a callback method for capturing audio, thus no callbacks would ever be missed.
This method of reading (sequential stream.read) is not good enough when you need to know the exact time stamp of the captured data (normally provided by the audio driver to the callback function as an argument).
Will you please try to reproduce with the code sample I have posted above ?
@shaycohen recording_redis.zip
Use your sample code as attached file with redis 5.0.4 to test, but still not reproduce it.
Could you help to try the attached sample code again?
ps. redis 5.0.4 default the position of redis.sock is in /tmp
Activity
jamess-huang commentedon Mar 25, 2019
Can you give us a detail configuration and the duplicate step (including the recording command/APP)
shaycohen commentedon Mar 25, 2019
Hi @jamess-huang , Thanks for the prompt reply.
I've attached alsa.conf (as alsa.conf.log in order to comply to GitHub's allowed extensions policy)
alsa.conf.log
The recording code snippet is the following (Python3 code):
`
import time, redis
class Record():
def init(self):
self.r = redis.StrictRedis(unix_socket_path="/var/run/redis/redis.sock")
rec = Record()
rec.record()
`
jamess-huang commentedon Mar 25, 2019
Sorry to ask this: Did you try to use the same python code on Raspberry Pi or another SBC board ?
Just make sure that there is no issue in this python code.
shaycohen commentedon Apr 2, 2019
I've setup a test environment on an RPi 3B+, using an external / USB audio device (as the RPi onboard does not have a capture interface).
Kernel version: 4.19.25-v7+
This device does not seem to have any callback drops nor missing audio chunks on the recorded data.
rotemtim commentedon Apr 22, 2019
Hi
I've just encountered the same problem with tinkerOS 2.0.8, there are a lot of audio chunks drops.
@james-huang did you find any resolution to this problem?
shaycohen commentedon Apr 28, 2019
Hi @jamess-huang
Will you please post a short update / ETA about this ?
Thank you very much for your support,
Shay
topdjgod commentedon May 2, 2019
@shaycohen
Could you help to try below sample code to check if it can reproduce?
We use below sample code can't reproduce your issue.
import pyaudio
import wave
CHUNK = 4096
FORMAT = 8
CHANNELS = 1
RATE = 44100
RECORD_SECONDS = 60
WAVE_OUTPUT_FILENAME = "output.wav"
p = pyaudio.PyAudio()
stream = p.open(format=FORMAT,channels=CHANNELS,rate=RATE,input=True,frames_per_buffer=CHUNK)
print("recording")
frames = []
for i in range(0,int(RATE/CHUNKRECORD_SECONDS)):
data = stream.read(CHUNK)
frames.append(data)
print("*done recording")
stream.stop_stream()
stream.close()
p.terminate()
wf = wave.open(WAVE_OUTPUT_FILENAME, 'wb')
wf.setnchannels(CHANNELS)
wf.setsampwidth(p.get_sample_size(FORMAT))
wf.setframerate(RATE)
wf.writeframes(b"".join(frames))
wf.close()
@anyone
Do you have a simple way to reproduce the problem?
shaycohen commentedon May 2, 2019
@topdjgod
Thank you for your support.
The proposed code does not use a callback method for capturing audio, thus no callbacks would ever be missed.
This method of reading (sequential stream.read) is not good enough when you need to know the exact time stamp of the captured data (normally provided by the audio driver to the callback function as an argument).
Will you please try to reproduce with the code sample I have posted above ?
topdjgod commentedon May 3, 2019
@shaycohen
recording_redis.zip
Use your sample code as attached file with redis 5.0.4 to test, but still not reproduce it.
Could you help to try the attached sample code again?
ps. redis 5.0.4 default the position of redis.sock is in /tmp
xfrm6: avoid potential infinite loop in _decode_session6()
netfilter: ebtables: handle string from userspace with care