缓冲区长度较小的usb_fill_bulk_urb不会产生垃圾传输流数据 [英] usb_fill_bulk_urb with less buffer_length gives no garbage Transport stream data

查看:177
本文介绍了缓冲区长度较小的usb_fill_bulk_urb不会产生垃圾传输流数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在研究DVB-T2加密狗,该加密狗使用USB连接到我的Ubuntu笔记本电脑14.04

Currently I am working on a DVB-T2 dongle which is connected to my Ubuntu laptop 14.04 using USB

界面.

我正在使用以下应用程序执行扫描和频道播放. 1. w_scan-扫描并给我一个channel.conf文件 2. vlc ./channel.conf-使用channel.conf

I am using following applications to perform scanning and channel play. 1. w_scan - which scans and gives me a channel.conf file 2. vlc ./channel.conf - plays a channel using modulation parameters in channel.conf

禁用Pid过滤后,一切正常.但是启用了Pid过滤后,我会看到

Things work fine when Pid filtering is disabled. But when Pid filtering is enabled, I see

宏块,而不是平滑的AV.甚至AV也坏了很多.

macroblocks on the screen instead of smooth AV. Even AV is breaking a lot.

浏览完驱动程序代码后,我尝试将URB缓冲区的大小从3K(21 * 188)增加到

After going through the driver code, I tried increasing the URB buffer size from 3K (21*188) to

64K(348 * 188). AV变得平滑.

64K (348*188). The AV became smooth.

在以下函数中,该城市缓冲区的大小为buffer_length(传输缓冲区的长度).

This urb buffer size is buffer_length (lenght of transport buffer) in below function.

void usb_fill_bulk_urb(结构urb * urb,结构usb_device * dev, unsigned int管道,void * transfer_buffer, int buffer_length,usb_complete_t complete_fn, void * context);

void usb_fill_bulk_urb (struct urb * urb, struct usb_device * dev, unsigned int pipe, void * transfer_buffer, int buffer_length, usb_complete_t complete_fn, void * context);

如您所见,驱动程序使用USB传输的批量模式.

As you can see the driver uses bulk mode of usb transfer.

任何人都可以解释一下为什么增加缓冲区可以解决宏块问题吗?

Could anyone explain me why increasing the buffer is solving the macroblock issue ?

请给我一些指导,以更好地了解这个问题.

Give me some pointers to understand this issue better.

预先感谢, 穆拉利

推荐答案

最终找到此问题的灵魂,usb帧大小和urb缓冲区大小应该相同(在我的情况下为21x188).在我的代码中,发现USB帧大小设置为(348x188),而urb缓冲区大小为(21x188),这是造成此问题的原因.

finally found soultion for this issue, the usb frame size and urb buffer size should be same (in my case 21x188). In my code, found that USB frame size was set to (348x188) and urb buffer size was (21x188) which was causing the issue.

这篇关于缓冲区长度较小的usb_fill_bulk_urb不会产生垃圾传输流数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆