Code Monkey home page Code Monkey logo

vbit2's People

Contributors

ali1234 avatar avrovulcanxh607 avatar peterkvt80 avatar pjfdirect avatar zxguesser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vbit2's Issues

dead links, hosting and dailyprog

I noticed many links are broken. It seems you've reach the bandwidth quota.

We are a bunch of programmers chatting and hacking together. Some of us are interested by teletext. We have a server and we can host some parts or your project if you want.

Feel free to reach us on http://dailyprog.org/chat/ and/or to delete that issue.

Cheers

Windows-precompiled vbit2.exe

Hi I was wondering if you could compile vbit2 for windows and post it somewhere or tell me how to compile that properly on msys2 and g++ as compiler if possible

Thanks for Anwsering and Best Regards

Teletext into DVB.

Not sure if the raw teletext produced by vbit2 can be somehow injected into pes? I guess old to new format?

Newfor subtitles don't work

I can't get newfor subtitles to work with vbit2. I get: "java.net.ConnectException: Connection refused: connect".

Carousels

Since updating vbit2 yesterday (Monday), blank lines on carousel pages aren't transmitted, so pages have the remains of the previous page superimposed (if you know what I mean). Maybe this is normal and I'll have to change some of my own code?

Improve vbit-config script

  • Implement custom ancillary services
  • Implement "directory" type custom services
  • UI to select output command (raspi-teletext, packet-server, etc)

Serial magazine support

Currently when you select Page 111, the teletext header only shows pages from 100-199 while seeking the page. Could you please add an option for serial magazine support (so that all pages from 100-899 can be seen in the header while looking for page 111)?

Using the vbit config

Hi gents hoping I can get round this. When using the config tool I get this error "svn checkout failed with error 1". Is this an issue I can get help with?

TIA

windows tcp bug?

Hello, I'm encountering an issue with Ncat on Windows. Whenever I send a "P310000" command or any other page command, the vbit2 application closes the connection, and it becomes impossible to reconnect until the process is restarted
tries on windows 11,telnet,ncat ,putty,windows firewall off
teefax demo pages
default vbit config, plus connection vars on port 5570

this vbit answer to P310000 command
[TCPClient::addChar] finished cmd='7
[PageList::FindPage] Selecting 31000
thx!

issues showing subpages in vbit2?

I create .tti files for pages that can have subpages.
The issue: they "flicker", where all / parts are shown multiple times a second. As if the cycle time is ignored and it is trying to show all pages at once.

In my .tti files I set the PN,mppss and also the Cycle info. E.g.:

DE,702-00 - 2018-02-20 23:03:34
PN,70200
CT,5,T
SC,0000
PS,8040

and subpage:

DE,702-01 - 2018-02-20 23:03:34
PN,70201
CT,5,T
SC,0001
PS,8040

The same for the standard sample page R12400.TTIx and R12401.TTIx.

vbit-config doesn't work after update

The new config script depends on the dialog package. This is installed when doing a fresh install, but not when running the update script.

Additionally, these commands are not run when updating, only when doing a new install.
systemctl --user link $HOME/vbit2/teletext-update.timer
systemctl --user link $HOME/vbit2/teletext-update.service

vbit2 gives up after about half an hour

Output from systemctl status shows no output since it stopped, yet still showing as running?!
A restart gets it working for another half hour.

pi@hestia:~/vbit2 $ sudo systemctl status vbit2
● vbit2.service - (null)
   Loaded: loaded (/etc/init.d/vbit2.sh)
   Active: active (running) since Sun 2017-02-05 22:17:10 UTC; 23h ago
  Process: 394 ExecStart=/etc/init.d/vbit2.sh start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/vbit2.service
           ├─399 /bin/bash ./vb2
           ├─432 /home/pi/vbit2/vbit2 --dir /home/pi/teletext
           └─433 /home/pi/raspi-teletext-master/teletext -

Feb 06 18:17:43 hestia.cy2.uk vbit2.sh[394]: [Mag::GetPacket] Header thisSubcode=5
Feb 06 18:17:43 hestia.cy2.uk vbit2.sh[394]: [Carousel::nextCarousel] page 52101 cycle time=10
Feb 06 18:17:43 hestia.cy2.uk vbit2.sh[394]: [Mag::GetPacket] Header thisSubcode=1
Feb 06 18:17:44 hestia.cy2.uk vbit2.sh[394]: [Carousel::nextCarousel] page 52001 cycle time=8
Feb 06 18:17:44 hestia.cy2.uk vbit2.sh[394]: [Mag::GetPacket] Header thisSubcode=2
Feb 06 18:17:44 hestia.cy2.uk vbit2.sh[394]: [Carousel::nextCarousel] page 19a01 cycle time=4
Feb 06 18:17:44 hestia.cy2.uk vbit2.sh[394]: [Mag::GetPacket] Header thisSubcode=4
Feb 06 18:17:44 hestia.cy2.uk vbit2.sh[394]: mpp=19a subcode=4
Feb 06 18:17:44 hestia.cy2.uk vbit2.sh[394]: [Carousel::nextCarousel] page 80001 cycle time=8
Feb 06 18:17:44 hestia.cy2.uk vbit2.sh[394]: [Mag::GetPacket] Header thisSubcode=8

accented characters?

Not really a vbit issue, but it is not clear to me how to use accented characters in .tti files.
At the moment I am creating UTF-8 files, with language set to German (PS,8080).
With vbit2 | teletext this results in garbled row.

Carousel subpage IDs

I've updated to vbit2, and have encountered an issue similar to peterkvt80/vbit-pi-stream#2

In this version, all pages of a carousel are being seen by my TV as subpage 0001.
Usually my TV caches all subpages and I can select them at will, but this issue means they just refresh under subpage 1.

I'm undecided as to whether this is an improvement :) but it's certainly more consistent.

Remove redundant code

Purge irrelevant code carried over from editor.

  • Page saving is used in commented out debug code in SendSubtitle is this needed, would a simpler page dump suffice for debugging?
  • There is code for multiple formats but we only read tti. Do we want to (re)implement loading the other formats or should we throw them out? Affects #19

Using my own page server

Hi Peter. Great article and software. Thank you for sharing. I am hoping to use my own page server with this. I have a Subversion server on my local network with modified pages set up. Is it just a case of changing the destination in the getvbit2 file to point to the new repo?
Thanks.

TCP packet server crashes on Linux when client disconnects

Run vbit like this:

./vbit2 --packetserver 30000 --format none

Connect to port 30000 and then disconnect, eg:

telnet localhost 30000

and then type ctrl-] q

Result:

[Configure::Configure] Pages directory is ./pages
[Configure::Configure] Config file is vbit.conf
[Configure::LoadConfigFile] opened ./pages/vbit.conf
[Configure::LoadConfigFile] open failed
[PageList::LoadPageList] recursing into ./pages/National
[PageList::LoadPageList] recursing into ./pages/Engineering
[PacketServer::run] TCP packet server thread started
[Service::run] Lines per field: 16
[FileMonitor::run] Monitoring ./pages
[Service::_updateEvents] Resynchronising master clock
[PacketServer::run] new connection from 127.0.0.1:34946 as socket 4
[PacketServer::run] closing connection from 127.0.0.1:34946 on socket 4
*** bit out of range 0 - FD_SETSIZE on fd_set ***: terminated
Aborted (core dumped)

Issue is apparently caused by this:

_clientSocks[i] = -1; /* free slot */

Somewhere that socket is being used without first checking if it is negative...

teletext project

hello Peter , how i can contact u for discuss if is possible a pay mod to your project
thx so much

Support for ETT (.ttp) file format

Maybe you are interested in adding support for the FAB ETT file format.
This is the format description:

	When teletext pages are stored in FAB ETT file format the files are stored with extension .TTP and contain following data:

	Byte 0:				Number of used rows (1 to 49)

	Byte 1..42:	Row 0
		Byte 1:			SO (0Eh)
		Byte 2:			80h
		Byte 3...32:	Page name + odd parity (first 30 bytes, rest starts at position 2060)
		Byte 33..35:	80h
		Byte 36:		Left Margin (0 to 38) + odd parity
		Byte 37:		Right Margin (1 to 39) + odd parity
		Byte 38:		Top Margin (1 to 22) + odd parity
		Byte 39:		Bottom Margin (2 to 23) + odd parity

		Byte 40:		Time for display (3 to 60), bit with value 64 should be set to disable numbering of subpages (FAB System only)+ odd parity

		Byte 41:
			bit 0 (1) 	= C7, header suppress
			bit 1 (2)	= C4, erase page
			bit 2 (4)	= C9, interrupted sequence
			bit 3 (8)	= C10, inhibit display
			bit 4 (16)	= C5, newsflash
			bit 5 (32)	= C6, subtitle
			bit 6 (64)	= set to 0
			bit 7 (128)	= odd parity

		Byte 42:		Character Set + odd parity	(0=GB, 4=D, 2=S, 6=I, 1=F, 5=E, 3=CS)

	Byte 43..2059:		Data rows (as specified in byte 0 minus 1), each consisting of block of 42 bytes:
		Byte 0:			SO (0Eh)
		Byte 1:			Packet (Row) number + odd parity
		Byte 2..41:		Contents of data line

	Byte 2060..2069:	Page name + odd parity (last 10 bytes)

	Remarks:
	1. Data lines should be stored in the following order: X/27 (0 or 1 packets),  X/26 (0 to 15 packets),  X/1..X/23 (only lines which contain characters other than 20h), X/24 (0 or 1 packet), X/25 (0 or 1 packet)
	2. Data in data lines should be encoded according to teletext specification. For lines X/1 to X/23 use odd parity characters.
	3. Unused space at the end of file can be filled up with character 20h.

Each page file has a size of 2070 bytes. I can provide some sample files.

Here is some sample PHP code to read a ETT file:

	public function loadETT($filename) {
		if (filesize($filename) == 2070) {
			$fh = fopen($filename, 'rb');

			//fseek($fh, 0);
			//print "Number of used content rows: ".ord(fread($fh, 1))."\r\n";

			fseek($fh, 3);
			$this->PageContent[0] = $this->ParityStrip(fread($fh, 30));

			fseek($fh, 40);
			$this->Duration = ord(fread($fh, 1)) & 0x7f;

			fseek($fh, 41);
			$flags = ord(fread($fh, 1));
			$this->FlagInhibitHeader  = $this->TestBit($flags, 0);
			$this->FlagErasePage      = $this->TestBit($flags, 1);
			$this->FlagOutOfSequence  = $this->TestBit($flags, 2);
			$this->FlagInhibitDisplay = $this->TestBit($flags, 3);
			$this->FlagNewsflash      = $this->TestBit($flags, 4);
			$this->FlagSubtitle       = $this->TestBit($flags, 5);

			fseek($fh, 42);
			$this->CharacterSet = ord(fread($fh, 1)) & 0x7f;

			for ($i = 0; $i < 48; $i++) {
				fseek($fh, ($i) * 42 + 44);
				$rownum = ord(fread($fh, 1)) & 0x7f;

				fseek($fh, ($i) * 42 + 45);
				$rowdata = fread($fh, TTX_LINELENGTH);
				if ($rownum < 26) {
					$this->PageContent[$rownum] = $this->ParityStrip($rowdata);
					if ($rownum == 24) $this->extractX24($this->PageContent[$rownum], $this->char_replacement_map[$i]);
				}
				else {
					$this->PageExtension[$rownum][] = $rowdata;
					switch ($rownum) {
						case 26:
							$this->decodeX26($rowdata);
							break;
						case 27:
							$this->decodeX27($rowdata);
							break;
					}
				}
			}

			fseek($fh, 2060);
			$this->PageContent[0] .= $this->ParityStrip(fread($fh, 10));

			fclose($fh);
		}
	}

Page number and Subpage number have to be parsed from the filename (like 100_00.ttp) or may be written to Row 0 as text like "100.00 Some Page Title here". Most systems parse it from the filename.

There is also a variant of this file format to support multiple subpages in one file but I did not have a look at it and do not have a format description yet.

Missing headers and duplicated packets

The new implementation seems to be eating page headers, possibly other packets too. It's also duplicating packets again, I expect the same way as before where the return value of a function is ignored.

--reverse not working

Latest update seems to have broken --reverse. Could probably do without, but a nice feature to have

Command Interface

When I try to select a page with P, vbit crashes and I get a segmentation fault

Vbit continually crashes

Running ./vb2 puts up the usual page adding messages, before ending with:
[Packet830::Packet830] constructor
[~TTXPage] none
[~TTXPage] none
[Service::worker]This is the worker process
[Command::run] Newfor subtitle listener started
[Command::run] Ready for a client to connect
[Service::run]Loop starts
[FileMonitor::run] Monitoring /home/pi/Pages
[Service::run] No packet available for this line
[Service::run] No packet available for this line
[Service::run] No packet available for this line
[Service::run] No packet available for this line
[Service::run] No packet available for this line
[Service::run] No packet available for this line
[Service::run] No packet available for this line
[Service::run] No packet available for this line
[FileMonitor::run] Adding a new pageP363.TTI
[FileMonitor::run] Adding a new pageMENU115.tti
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 10) >= this->size() (which is 10)
teletext: teletext.c:172: main: Assertion `ret == 0' failed.
./vb2: line 41: 14949 Aborted $HOME/vbit2/vbit2 --dir $PAGESDIRECTORY
14950 | $HOME/raspi-teletext-master/teletext -
VBIT2 Server crashed with exit code 0. Respawning..

This then goes into an endless loop until i stop it with Ctrl-c.

vbit-config traceback when adding "Directory" as a custom service

When trying to add a custom service from a directory, vbit-config exits unexpectedly with a traceback.

OS: Raspberry Pi OS 11 "bullseye" 32-bit

Steps to reproduce:

  1. Start vbit-config
  2. Select "Install service"
  3. Select "Custom service"
  4. Select "Directory"

Actual result:

Traceback (most recent call last):
  File "/home/gkm/.local/bin/vbit-config", line 289, in <module>
    mainMenu()
  File "/home/gkm/.local/bin/vbit-config", line 273, in mainMenu
    installServiceMenu(servicesData)
  File "/home/gkm/.local/bin/vbit-config", line 54, in installServiceMenu
    customServiceMenu()
  File "/home/gkm/.local/bin/vbit-config", line 129, in customServiceMenu
    code, string = d.dselect(os.getenv('HOME')+"/", title="Enter teletext service directory:", height=8)
  File "/usr/lib/python3/dist-packages/dialog.py", line 2363, in dselect
    return self._widget_with_string_output(
  File "/usr/lib/python3/dist-packages/dialog.py", line 1719, in _widget_with_string_output
    code, output = self._perform(args, **kwargs)
  File "/usr/lib/python3/dist-packages/dialog.py", line 1518, in _perform
    exit_code, output = self._handle_program_exit(child_pid,
  File "/usr/lib/python3/dist-packages/dialog.py", line 1484, in _handle_program_exit
    self._wait_for_program_termination(child_pid,
  File "/usr/lib/python3/dist-packages/dialog.py", line 1430, in _wait_for_program_termination
    raise DialogError(
dialog.DialogError: dialog-like terminated due to an error: the dialog-like program exited with status 3 (which was passed to it as the DIALOG_ERROR environment variable). Sometimes, the reason is simply that dialog was given a height or width parameter that is too big for the terminal in use. Its output, with leading and trailing whitespace stripped, was:


This error is apparently caused by line 129 of vbit2/scripts/vbit-config.py where the parameter height=7 is too short for the directory dialog. Changing this to height=18 allows the directory dialog to appear, allowing installation of the custom service to complete correctly.

Teletext-Output to OpenCaster?

Have not tried it yet but should it be possible to send VBIT2s stream directly to OpenCaster to packetize and mux it into a DVB service?

Possible security vulnerabilities

At the suggestion of Alistair Cree I’m logging this security issue which I think is worth mentioning.

The TCP connection set up to send subtitles over the network seems to listen on all IPs. It should really only be visible on the LAN. A lot of people have their PIs visible to the internet and a faulty router configuration could leave the system vulnerable.

There would of course need to be a vulnerability in VBIT2 itself to make this a problem, but it seems to be something worse closing off.

Static Bar at The Top of the Screen

Hello,

I'm using a RPI 3B+ with latest Raspbian Stretch installed. I'm getting a bar of static at the top of the screen when I run Teefax, and no image. I can only see the desktop.

Does this program work with NTSC televisions since sdtv must be set to 2 (which doesn't work on my set)?

TS encapsulation of Teletext PES for tsduck

I made some tests with including teletext packets to tsduck live streams
This worked for me: (written in Python)

The PES packets need to include PTS timestamp. Because tsduck merge plugin controls the insert rate. pts_increment is 1800 for 50Hz time advance, or 3600 for 25Hz time advance. It is in 90kHz units.
Next goes the encapsulation to 188 byte TS packets. pid is the required PID from 0x0100 to 0x1FFE.
It is possible to inject the resulting packets into live tsduck steam with acceptable time error:
-P merge "gener .... "

Of course, there is also need to add the reqired signalisation to PSI tables:
ttx.xml.

edit your language, start page, PID and VBI lines used. And patch the PMT table by
-P pmt --patch-xml ttx.xml

Source files are in next message

Have a nice day
source.zip

Stream timing related improvements

  • Regulate packet generation to internal master clock rather than relying on output buffer blocking.

Possible future enhancements:

  • Migrate all time related functions to use internal master clock synchronised to field rate and bsdp generation.
  • Build packet buffer forwards into future time.

Affects #31

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.