[Request] tv_on_start=true (UPDATE: patch available)

everything about the next not so big update

Moderator: Moderator

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

[Request] tv_on_start=true (UPDATE: patch available)

Postby acmelabs » Sat Mar 24, 2007 2:08 pm

Hi everybody,

Thanks to Roman I've built a "libxineoutput/vdr-sxfe & MMS single remote control solution" for my livingroom.

Advantages:
  • clean intergration
  • vdr-sxfe can scale the picture automatically (letter-box-auto-cut-out)
  • only one remote control is needed (less key-presses)
  • no patching needed (either VDR nor MMS)
  • single sound source for the receiver

Disadvantages:
  • slower on zapping
  • picture is below PAL-quality (tweaking possible?)
  • no TV on MMS startup( 7 key-presses instead of 1 )
  • difficult setup (irxevent must run in bg to close vdr-sxfe)


I can live with the disadvantages, except the "no TV on MMS startup". Since our TV set is used (by my wife) most of the time for watching TV, it's a regression for us, because we have now to press seven keys on the remote, until we see a TV signal. Before it's been one single press on the remote. To solve this, MMS should be able to start in TV mode instantly by e.g. such a switch in the /etc/mms/config:

Code: Select all

tv_on_start = true

Another solution could be, to remember if TV was running or not. I'd like the latter, because I'm not a friend of a gigantic config files with plenty of switches in there. I must admit, If anybody ask me for the meaning of a switch in the config, the possibility is high, I wouldn't know the answer.

My config-strings for vdr-sxfe & MMS:

Here's my config strings for /etc/mms/config:

Code: Select all

tv_path = /usr/bin/vdr-sxfe
tvopts=--post tvtime:method=Linear,cheap_mode=1,pulldown=0,use_progressive_frame_flag=1 xvdr://127.0.0.1 --lirc=/dev/lircd --fullscreen --aspect=16:10 --width=1280 --height=768


And here's the string in my /usr/sbin/runvdr:

Code: Select all

-P'xineliboutput --local=none --remote=37890'


For shutting down vdr-sxfe I have this entry in my .lircrc for irxevent:

Code: Select all

begin
   remote = ir.conf
   prog = irxevent
   button = vt2
   config = Key Escape VDR
end


Regards,
Andreas
Last edited by acmelabs on Sun Mar 25, 2007 2:24 pm, edited 1 time in total.

User avatar
PT
veteran
Posts: 119
Joined: Sat Mar 10, 2007 9:08 pm
Location: Denmark

Postby PT » Sun Mar 25, 2007 12:31 am

tv_on_start = true


Good idea, that would help my wife and children too. Today, I moved TV to be on position 1 in the start menu and therefore I only have one keypress after start.

Don't do it too complicated regarding remembering last exit state, this flag is a good solution.

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

tv_on_start patch

Postby acmelabs » Sun Mar 25, 2007 2:23 pm

Hi,
here's my very first mms patch: :D

This patch is done agains mms-1.0.9-RevNo-1133 and enables mms to start in TV mode if configured in /etc/mms/config:

Code: Select all

tv_on_start = true


Patch for my_config_parameters:

Code: Select all

--- mms-1.0.9/my_config_parameters      2007-03-25 16:04:53.000000000 +0200
+++ mms-1.0.9-tv/my_config_parameters   2007-03-25 16:06:41.000000000 +0200
@@ -125,6 +125,7 @@
 PARAMETER_STR("convert_mp3_locale",convert_mp3_locale, "ISO-8859-1")
 PARAMETER_STR("tv_path",      tv_path,       "/usr/bin/tvtime")
 PARAMETER_STR("tvopts",       tv_opts,       "")
+PARAMETER_BOOL("tv_on_start",       tv_on_start,       false)

 // internal
 PARAMETER_STR("replay_read",      replay_read,    "last_replay.rep")


Patch for startmenu.cpp:

Code: Select all

--- mms-1.0.9/startmenu.cpp     2007-03-25 16:05:38.000000000 +0200
+++ mms-1.0.9-tv/startmenu.cpp  2007-03-25 16:06:54.000000000 +0200
@@ -272,8 +272,15 @@
 #ifdef use_epg
   Epg *epg = Epg::get_instance();
   epg->startup_updater();
+#endif
+
+#ifdef use_tv
+          if (conf->p_tv_on_start() ) {
+            Tv::get_instance().mainloop();
+          }
 #endif

   updater.start();
   updater.activate();


Here's the complete patch including also the config files patches:

Regards,
Andreas

User avatar
PT
veteran
Posts: 119
Joined: Sat Mar 10, 2007 9:08 pm
Location: Denmark

Postby PT » Sun Mar 25, 2007 9:10 pm

Hi acmelabs,

I tried it and it works. 8)

I will suggest to change the code to the following (see below), because it insures an easier maintenance of the code (and if someone in the future makes some "dirty" code). The busy icon will show up too. Here is a handmade patch, hope you can see the difference:


string Startmenu::mainloop()
{
+ char first_tv_start_flag = true;

Input input;


input_master->cur_map = &input_master->startmenu;
module = "startmenu";

list<startmenu_row>::iterator iter = startmenu.begin();
list<startmenu_item>::iterator iter_row = iter->items.begin();

print((*iter), (*iter_row));

// updater
Updater &updater = Updater::get_instance();

BusyIndicator &busy_indicator = BusyIndicator::get_instance();
Shutdown &sd = Shutdown::get_instance();

#ifdef c_music
Audio* audio = Audio::get_instance();
audio->startup_updater();
#endif

#ifdef c_picture
Pictures &pictures = Pictures::get_instance();
pictures.startup_updater();
#endif

#ifdef use_epg
Epg *epg = Epg::get_instance();
epg->startup_updater();
#endif

updater.start();
updater.activate();

bool update_needed = true;

while (!(input.command == "action" && iter_row->action == "quit"))
{
if (update_needed)
print((*iter), (*iter_row));

busy_indicator.idle();



+ #ifdef use_tv
+ if (first_tv_start_flag && conf->p_tv_on_start() ) {
+ first_tv_start_flag = false;
+ iter_row->action = "tv";
+ input.command = "action";
+ }
+ else {
+ input = input_master->device->get_input();
+ }
+ #else
+ input = input_master->device->get_input();
+ #endif

- input = input_master->device->get_input();

busy_indicator.busy();

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Sun Mar 25, 2007 9:26 pm

PT wrote:...

wow, cool! Didn't think about that. Thanks.
Would be cool to have it configurable in options, instead of config. Will look next WE for it.

Thanks, Regards,
Andreas

ps: if you use [ code ] & [ / code ] tags, the code would be more readable here in the forum ;-)
And for creating a patch use:

Code: Select all

diff -aur original-file-name.cpp modified-file-name.cpp > my-own.patch

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Mon Mar 26, 2007 8:56 am

acmelabs wrote:
ps: if you use [ code ] & [ / code ] tags, the code would be more readable here in the forum ;-)
And for creating a patch use:

Code: Select all

diff -aur original-file-name.cpp modified-file-name.cpp > my-own.patch


Or, even easier, bzr diff <file> > my-own-patch
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Mon Mar 26, 2007 9:00 am

lorenzodes wrote:
acmelabs wrote:
ps: if you use [ code ] & [ / code ] tags, the code would be more readable here in the forum ;-)
And for creating a patch use:

Code: Select all

diff -aur original-file-name.cpp modified-file-name.cpp > my-own.patch


Or, even easier, bzr diff <file> > my-own-patch

Wow, cool, didn't know that. Does it work for subdirectories like ./cfg also, because I've changed the config files too?

Regards,
Andreas

User avatar
Uatschitchun
Overlord
Posts: 3189
Joined: Tue Dec 06, 2005 6:55 pm
Location: Germany
Contact:

Postby Uatschitchun » Mon Mar 26, 2007 9:18 am

So how is this patch working?

Starting up MMS and making it switch to TV immediatly?
If one exit TV, MMS shows up?
Lg
Roman

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Mon Mar 26, 2007 9:22 am

acmelabs wrote:
lorenzodes wrote:
acmelabs wrote:
ps: if you use [ code ] & [ / code ] tags, the code would be more readable here in the forum ;-)
And for creating a patch use:

Code: Select all

diff -aur original-file-name.cpp modified-file-name.cpp > my-own.patch


Or, even easier, bzr diff <file> > my-own-patch

Wow, cool, didn't know that. Does it work for subdirectories like ./cfg also, because I've changed the config files too?

Regards,
Andreas


If you do bzr diff (no file name) it prints a patch text that includes every file that has been modified from the original branch.

You can also do like this:

bzr diff <file1> <file2> <file3>... etc.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Mon Mar 26, 2007 9:34 am

Uatschitchun wrote:So how is this patch working?

Starting up MMS and making it switch to TV immediatly?
If one exit TV, MMS shows up?

MMS starts up, you see for a sec or something the MMS main screen, and then the TV app (here vdr-sxfe) comes up.
Either you can use now the function on VDR to shut down the system (I have the same shutdown script like in MMS), or you can leave vdr-sxfe (here with irxevent ) and you are back in the MMS main menu again. MMS does not shut down, you can use it now, as if you have started MMS the normal way.

My wife really appreciate it :-)

Regards,
Andreas

PS: Thanks a lot for your engagement regarding this vdr & mms documentation. The picture looks also good now, since I've found some switches in vdr-sxfe to increase the picture quality (ffmpeg, tvtime and stuff), and I have only one remote now! cool!
Last edited by acmelabs on Mon Mar 26, 2007 11:26 am, edited 3 times in total.

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Mon Mar 26, 2007 9:36 am

lorenzodes wrote:...If you do bzr diff (no file name) it prints a patch text that includes every file that has been modified from the original branch.

Way cool. This makes it really easy to provide working patches. Thanks a lot for this info.

Regards,
Andreas

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Mon Mar 26, 2007 11:28 am

Uatschitchun wrote:So how is this patch working?

Starting up MMS and making it switch to TV immediatly?
If one exit TV, MMS shows up?

Sorry for the long answer: Here's the short one:

Yes, it does.


Regards,
Andreas


Return to “1.0.9”

Who is online

Users browsing this forum: No registered users and 1 guest