Opened 14 years ago

Closed 13 years ago

#750 closed patch (wontfix)

Patch: Add simple ability for frontend to autodiscover backend server

Reported by: Sean.Jensen@… Owned by: Isaac Richards
Priority: minor Milestone: 0.20
Component: mythtv Version: head
Severity: low Keywords: zeroconfig autoconfig
Cc: Ticket locked: no

Description

This is a fairly simple enhancement to the MythTV system. Granted there's mfd and some other things going on that are very similar and when finished will make this patch look silly but for the time being there's no way for a frontend to automatically figure out where the backend system is. This I believe is a problem, and so I've decided to try and fix it.

The problem is that the end user must specify all the details (database IP, database name, username, and password) of where the backend server is. I believe that to most end users, and even developers (like myself) find this not a fun task to do. So to solve this I created ZeroConfig?; yes I realize that mfd has a plugin called ZeroConfig?, which is quite simple. When the mythbackend starts up a separate thread is started containing a listening UDP server which listens for broadcasts from the mythfrontend. If it catches a packet containing such a broadcast it then responds by telling the frontend the details needed to connect. (*WARNING* This is not secure, and is/was never meant to be. *END WARNING*)

Example exchange:

Frontend:
    Sends udp broadcast message "MYTHTVDISCOVER"
Backend:
    Receives udp broadcast message
    Sends "dbHostName:vvv;dbUserName:www;dbPassword:xxx;dbType:yyy;dbName:zzz"
Frontend:
    Receives response
    Tries to connect using the response's parsed data
    If failed goes to standard startup (aka ask user for information)

The reason everything is in clear test is that the mythbackend is probably on a private network and the mythfrontend is on the same private network. Since these are private networks sending data in the clear (database name, IP, username, and password) is okay. To be on the safe side ZeroConfig? is not enabled by default on the backend; on the frontend it is, to enable it you must pass the parameter '--usezeroconfig' when starting mythbackend.

The result in this patch allows people the simplicity of being able to start mythbackend on a server in another room or on the same machine as mythfrontend, and then start mythfrontend and it finds the backend with out any user input.

The limitation of this software is that only Live (I assume, I don't use this feature), and recorded TV work currently. The reason for this is that some of the other plugins (mythmusic, mythvideo, etc) assume that the filesystem(s) containing the data are mounted locally on the frontend machine; this is usually done via nfs or smbfs (Personally I would prefer to see everything streamed from the backend server with out the need for the frontend to mount any filesystems other than it's local ones, but this is just my view)

Attachments (1)

zeroconfig_patch.patch (14.1 KB) - added by Sean.Jensen@… 14 years ago.
The patch to add ZeroConfig? functionality tested on svn rev: 8106

Download all attachments as: .zip

Change History (7)

Changed 14 years ago by Sean.Jensen@…

Attachment: zeroconfig_patch.patch added

The patch to add ZeroConfig? functionality tested on svn rev: 8106

comment:1 Changed 14 years ago by Isaac Richards

Did you look at using the code from mfd at all?

comment:2 Changed 14 years ago by Sean.Jensen@…

I actually did when I was looking to see if anyone had implemented this type of feature before. I started reading up on mfd and found it to be a very promising project, I'll probably use it later on, but for my use it didn't quite fit the bill. I also have to admit that I didn't take a look at the source code to much, I mainly read about it on the mailing list.

I decided all I needed was something fairly simple, and not to complex. So I decided to implement my own version of Zero Configuration. Only after finishing my work did I notice that my choice of names had been identical to mfd's ZeroConfig?. In no way was I looking to side-step mfd. (Good work mfd coders!)

I've just finished taking a look at the source code and I still find it a bit to complex for the simple operation I'm trying to do here. Pretty much the goal of this patch was to make the setup of the frontend almost completely automatic with little to no configuration input needed from the end-user.

Think of it like this. You have a backend machine that's recording away and you have a KnoppMyth? CD both running with my patch. All you have to do is boot the CD and you have a serviceable myth frontend machine, with no to little user input. All the user has to do is put the CD in, boot the box, and the select the recording they want to watch. Nice and simple.

I still believe that in a perfect world the backend should stream out all the data (video, audio, pictures, etc) to the frontends, and that all the frontend has to worry about is playing back CD's, DVD's or managing USB drives with media on them. This would make the frontends a little lighter on the bulk they have to have. Granted a good CPU, Graphics card, and memory are still needed, but most of the work would be done by the backend, and there would be no need for mounting remote filesystems to the frontends. Again trying to keep it nice and simple. Granted this goes back to the age old debate of client-server, peer-to-peer, or some kind of mesh between the two.

comment:3 Changed 14 years ago by Isaac Richards

Milestone: unknown0.20

comment:4 Changed 14 years ago by GuyPaddock

NOTE: You may want to go the route of SSDP instead here, as it's already a standard that's meant for server discovery.

comment:5 Changed 14 years ago by mythtv@…

NOTE: Patch #1495 has SSDP support in it. It would not be difficult to extend it to be used in the frontend.

comment:6 Changed 13 years ago by Isaac Richards

Resolution: wontfix
Status: newclosed

Different implementation is part of autoconf SoC project.

Note: See TracTickets for help on using tickets.