# TeVii S660 USB DVB-S2 working?



## kjeacle (Jun 29, 2020)

Hi! Is anyone using a TeVii S660 USB DVB-S2 receiver?

I'm using webcamd 5.3.7.1_1 on 12.1-RELEASE and webcamd says:

```
Attached to ugen1.3[0]
Loading firmware at '/boot/modules/dvb-usb-s660.fw', f=8
Creating /dev/dvb/adapter0/demux0
Creating /dev/dvb/adapter0/dvr0
Creating /dev/dvb/adapter0/frontend0
Creating /dev/lirc0
Creating /dev/input/event2
```

But when I try w_scan, I get:

```
w_scan -c GB -fs -s S28E2 -a0 -C UTF-8
w_scan version 20170107 (compiled for DVB API 5.10)
using settings for 28.2 east Astra 2E/F + Eutelsat 28A
scan type SATELLITE, channellist 62
output format vdr-2.0
output charset 'UTF-8'
-_-_-_-_ Getting frontend capabilities-_-_-_-_ 
main:4019: FATAL: FE_GET_INFO failed: 6 Device not configured
```

And webcamd says:

```
Loading firmware at '/boot/modules/dvb-fe-ds3000.fw', f=8
Bus error
```

Am I out of luck with this device? 

If so, I see some alternatives on the WebcamCompat wiki but personal recommendations are welcome. Thanks!


----------



## hselasky@ (Jul 3, 2020)

See if there is a *.core file somewhere.
Open it with gdb91 webcamd webcamd.core
Then enter:
bt

And post the output.


----------



## hselasky@ (Jul 3, 2020)

Does the file "/boot/modules/dvb-fe-ds3000.fw" exist?


----------



## hselasky@ (Jul 3, 2020)

If you figure out the issue, patches are welcome at: https://github.com/hselasky/webcamd


----------



## kjeacle (Jul 3, 2020)

Hi, thanks for the replies. Here's the gdb output. I notice that the code block is for M88TS2022 whereas I think this TeVii S660 is M88TS2020 - but perhaps that is not relevent.

```
Core was generated by `/usr/ports/multimedia/webcamd/work/webcamd-5.7.1.1/webcamd -i 0 -d ugen1.3 -U we'.
Program terminated with signal SIGBUS, Bus error.
#0  0x002dafbc in ts2020_read_tuner_gain (fe=<optimized out>, v_agc=0, _gain=0x207b31de)
    at media_tree/drivers/media/dvb-frontends/ts2020.c:380
380         *_gain = -((__s64)gain1 * 2650 +
[Current thread is 1 (LWP 100158)]
(gdb) bt
#0  0x002dafbc in ts2020_read_tuner_gain (fe=<optimized out>, v_agc=0, _gain=0x207b31de)
    at media_tree/drivers/media/dvb-frontends/ts2020.c:380
#1  ts2020_get_tuner_gain (fe=<optimized out>, _gain=0x207b31de)
    at media_tree/drivers/media/dvb-frontends/ts2020.c:421
#2  ts2020_stat_work (work=<optimized out>) at media_tree/drivers/media/dvb-frontends/ts2020.c:437
#3  0x002db21c in ts2020_init (fe=<optimized out>) at media_tree/drivers/media/dvb-frontends/ts2020.c:148
#4  0x00350cc4 in dvb_frontend_init (fe=0x207b2f08) at media_tree/drivers/media/dvb-core/dvb_frontend.c:336
#5  dvb_frontend_thread (data=0x207b2f08) at media_tree/drivers/media/dvb-core/dvb_frontend.c:664
#6  0x00113d98 in kthread_wrapper (arg=0x20c56000) at kernel/linux_thread.c:531
#7  0x2058cd84 in thread_start (curthread=0x20c57000) at /usr/src/lib/libthr/thread/thr_create.c:292
#8  0x2058c830 in _pthread_create (thread=<error reading variable: Cannot access memory at address 0xbdae500c>,
    attr=<optimized out>, start_routine=<optimized out>, arg=<optimized out>)
    at /usr/src/lib/libthr/thread/thr_create.c:188
#9  0x20c44008 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
```


----------



## hselasky@ (Jul 4, 2020)

What platform is this? ARM/I386/AMD64/AARCH64 or something else?


----------



## hselasky@ (Jul 4, 2020)

I see that the write address is not aligned like it should for a 64-bit write:
(0x207b31de & 7) != 0

Try to type in GDB:
frame 0
print *_gain


----------



## kjeacle (Jul 4, 2020)

gdb says:

```
(gdb) frame 0
#0  0x002dafbc in ts2020_read_tuner_gain (fe=<optimized out>, v_agc=0, _gain=0x207b31de)
    at media_tree/drivers/media/dvb-frontends/ts2020.c:380
380         *_gain = -((__s64)gain1 * 2650 +
(gdb) print *_gain
$1 = 0
```
It's a Wandboard Dual running FreeBSD-12.1-RELEASE-arm-armv7-WANDBOARD. I was able to successfully configure a DVB-T tuner on the Wandboard, so I thought the TeVii might not be compatible with FreeBSD.

But I have just tried FreeBSD-12.1-RELEASE-arm64-aarch64-RPI3 and w_scan on the TeVii worked. As I am not tied to the Wandboard, I can use the Pi instead. Thanks for questioning the architecture!


----------



## hselasky@ (Jul 4, 2020)

It is a bug in the Linux code. Should probably be reported upstream Linux!
I just sent the Linux guys an e-mail, and let's see if someone will pick it up.


----------

