# w_scan



## balanga (Dec 18, 2017)

After finally getting my DVB-T dongle recognised by FreeBSD, `webcmd` seemed to work without knowingly doing anything different...
`usbconfig -d ugen0.3`

```
ugen0.3: <USB Deivce ITE Technologies, Inc.> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
```
`webcamd  -d ugen0.3`

```
Attached to ugen0.3[0]
Creating /dev/dvb/adapter0/demux0
Creating /dev/dvb/adapter0/dvr0
Creating /dev/dvb/adapter0/frontend0
Creating /dev/input/event0
```

I can now run `w_scan` but get inconsistant results... Sometimes it scans and picks up numerous stations, but sometimes it doesn't find anything...

Running `w_scan -ft -c PL` *sometimes* produces output such as:-

```
w_scan version 20170107 (compiled for DVB API 5.10)
using settings for POLAND
DVB aerial
DVB-T Europe
scan type TERRESTRIAL, channellist 4
output format vdr-2.0
WARNING: could not guess your codepage. Falling back to 'UTF-8'
output charset 'UTF-8', use -C <charset> to override
Info: using DVB adapter auto detection.
main:4007: FATAL: ***** NO USEABLE TERRESTRIAL CARD FOUND. *****
Please check wether dvb driver is loaded and
verify that no dvb application (i.e. vdr) is running.
root@Test:~ # w_scan -ft -c PL
w_scan -ft -c PL
w_scan version 20170107 (compiled for DVB API 5.10)
using settings for POLAND
DVB aerial
DVB-T Europe
scan type TERRESTRIAL, channellist 4
output format vdr-2.0
WARNING: could not guess your codepage. Falling back to 'UTF-8'
output charset 'UTF-8', use -C <charset> to override
Info: using DVB adapter auto detection.
        /dev/dvb/adapter0/frontend0 -> TERRESTRIAL "Afatech AF9033 (DVB-T)": good :-)
Using TERRESTRIAL frontend (adapter /dev/dvb/adapter0/frontend0)
-_-_-_-_ Getting frontend capabilities-_-_-_-_
Using DVB API 5.10
frontend 'Afatech AF9033 (DVB-T)' supports
INVERSION_AUTO
QAM_AUTO
TRANSMISSION_MODE_AUTO
GUARD_INTERVAL_AUTO
HIERARCHY_AUTO
FEC_AUTO
BANDWIDTH_AUTO not supported, trying 6/7/8 MHz.
FREQ (174.00MHz ... 862.00MHz)
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Scanning DVB-T...
Scanning 8MHz frequencies...
474000: (time: 00:00.410)
482000: (time: 00:02.421)
490000: (time: 00:04.437)
498000: (time: 00:06.482)
506000: (time: 00:07.042)
514000: (time: 00:07.605)         signal ok:    QAM_AUTO f = 514000 kHz I999B8C999D99
9T999G999Y999 (0:0:0)
        QAM_AUTO f = 514000 kHz I999B8C999D999T999G999Y999 (0:0:0) : updating transport_stream_id: -> (0:0:3)
        QAM_AUTO f = 514000 kHz I999B8C999D999T999G999Y999 (0:0:3) : updating network_id -> (0:13338:3)
        updating transponder:
           (QAM_AUTO f = 514000 kHz I999B8C999D999T999G999Y999 (0:13338:3)) 0x0000
        to (QAM_64   f = 514000 kHz I999B8C56D0T8G4Y0 (8808:13338:3)) 0x405A
522000: (time: 00:09.283)
530000: (time: 00:10.450)
538000: (time: 00:12.453)
546000: (time: 00:13.032)
554000: (time: 00:15.050)
562000: (time: 00:17.067)
570000: (time: 00:17.593)
578000: (time: 00:19.640)
586000: (time: 00:24.243)
594000: (time: 00:24.826)         signal ok:    QAM_AUTO f = 594000 kHz I999B8C999D999T999G999Y999 (0:0:0)
        QAM_AUTO f = 594000 kHz I999B8C999D999T999G999Y999 (0:0:0) : updating transport_stream_id: -> (0:0:3)
        QAM_AUTO f = 594000 kHz I999B8C999D999T999G999Y999 (0:0:3) : updating network_id -> (0:13342:3)
        updating transponder:
           (QAM_AUTO f = 594000 kHz I999B8C999D999T999G999Y999 (0:13342:3)) 0x0000
        to (QAM_64   f = 594000 kHz I999B8C56D0T8G4Y0 (8808:13342:3)) 0x405A
602000: (time: 00:33.301)
610000: (time: 00:34.042)
618000: (time: 00:34.885)
626000: (time: 00:36.932)
634000: (time: 00:38.947)
642000: (time: 00:39.519)
650000: (time: 00:41.525)
658000: (time: 00:42.103)
```

Sometimes it finds stations,  and sometimes it ends up with 

```
ERROR: Sorry - i couldn't get any working frequency/transponder
 Nothing to scan!!
```

Can anyone explain the differences?

I have no idea what QAM_AUTO or QAM_64 means.


----------



## tingo (Dec 18, 2017)

FWIW, I have also had inconsistent results with w_scan on some hardware. I think this isn't a fault with w_scan, but with the hardware / (Linux) drivers in question, as other hardware (which uses other drivers) works consistent with w_scan.
YMMV.


----------



## balanga (Dec 18, 2017)

Does anyone know how to deal with this sort of error?

```
WARNING:                char_coding 210: iconv_open failed.
                The conversion from 'ISO_6937-2' to 'UTF-8' is not supported.
        service = TVP Historia (EmiTel)
WARNING:                char_coding 210: iconv_open failed.
                The conversion from 'ISO_6937-2' to 'UTF-8' is not supported.
```


----------



## chrbr (Dec 18, 2017)

There exist some ports regarding conversion. May be converters/iconv or converters/libiconv provide what is missing.


----------



## RichardM (Dec 18, 2017)

What sort of aerial are you using? If you use a powered indoor aerial, even moving it a few inches can make a big difference. Try sticking it to a window, as high up as possible, for a reliable signal.


----------



## balanga (Dec 18, 2017)

RichardM said:


> What sort of aerial are you using? If you use a powered indoor aerial, even moving it a few inches can make a big difference. Try sticking it to a window, as high up as possible, for a reliable signal.



The aeriel is a communal aerial on top of a block of flats. When the TV scans digital terrestrial channels it picks up around 30, some in  HD.
When using the same dongle in my Raspberry Pi with LibreELEC it picks up most of them.

I've only just manged to get `webcamd` working today, so I'll see what progress I can make with scanning tomorrow. Maybe there is different scanning program I should try....


----------



## balanga (Dec 19, 2017)

I seem to be consistent results today. The errors such as 

```
"The conversion from 'ISO_6937-2' to 'UTF-8' is not supported."
```
do not appear when I redirect the output from `w_scan` to a file to I guess they must just be stderr errors and not really significant.

Now that I've managed to get a w_scan channel list, what program can I use it with?


----------

