Opened 14 years ago

Closed 14 years ago

#427 closed defect (fixed)

channel change/format change

Reported by: jacques.facquet@… Owned by: danielk
Priority: minor Milestone: 0.19
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

I use tuner and SVideo Input, when I start from tuner (SECAM), its ok, if I change for SVideo (PAL) its ok, if I come back to tuner mythtv say to the driver to change in PAL format (not ok), I have to patch ivtv driver to put secam in the format. I have done some tests with mythtv/trunk but stopped when I was even disabled to use SVideo input, so, I don't know if it works with recent revision (less than 2 months). The format change seem to be late on the channel change.

Change History (13)

comment:1 Changed 14 years ago by Isaac Richards

Priority: majorminor
Severity: highmedium

Can someone translate this into english, please? I'm not understanding the problem.

comment:2 Changed 14 years ago by jacques.facquet@…

sorry, I'll try. The tuner is in SECAM, the SVideo input in PAL. I can record in SECAM on the tuner, then in PAL on SVideo input, but, then if I want record on tuner again, mythtv want record in PAL.

comment:3 Changed 14 years ago by danielk

Milestone: unknown

Can you reproduce this with the latest SVN?

Also what is the global format? SECAM or PAL? What are the formats of the two channels?

If this bug still exists, please attach a backend log with "-v record,channel" where you switch from SECAM->PAL->SECAM where it fails on that second switch.

BTW to use the SVideo input you probably need to attach a source to that input with a single channel in the video mode you need.

comment:4 Changed 14 years ago by danielk

Owner: changed from Isaac Richards to danielk

comment:5 Changed 14 years ago by jacques.facquet@…

Can you reproduce this with the latest SVN?

worst with the latest unstable svn : SVideo/PAL Input #0: 'Composite 0' Input #1: 'Composite 1' Input #2: 'Composite 2' Input #3: 'Composite 3' Input #4: 'Tuner 0' Input #5: 'Composite 4' Input #6: 'S-Video 0' Input #7: 'S-Video 1' Input #8: 'S-Video 2' Input #9: 'S-Video 3' Channel is correct.

changing for tuner SECAM :

Channel(/dev/v4l/video0)::SwitchToInput?(in 4): Error -1 while setting video mode 'PAL' (v2), "Périphérique ou ressource occupé", trying v4l v1 Channel(/dev/v4l/video0)::SwitchToInput?(in 4): Error -1 while setting video mode 'PAL' (v1): Périphérique ou ressource occupé TVRec(1) Error: Failed to set channel to 1. Reverting to kState_None TVRec(1): Changing from WatchingLiveTV to None

That's all :-(

Also what is the global format? SECAM or PAL? What are the formats of the two channels?

Global format is SECAM. format for tuners channels is SECAM, for SVideo channels is PAL.

If this bug still exists, please attach a backend log with "-v record,channel" where you switch from SECAM->PAL->SECAM where it fails on that second switch.

latest stable svn switch to SVideo/PAL : Failed to find channel(309) on current input (Tuner 0) of card (1). Found channel(309) on another input (S-Video 0) of card (1). Failed to find channel(309) on current input (Tuner 0) of card (1). Found channel(309) on another input (S-Video 0) of card (1). Channel(/dev/v4l/video0)::SwitchToInput?(in 6) Channel(/dev/v4l/video0)::SwitchToInput?() setting video mode to SECAM Channel(/dev/v4l/video0):SetFormat?(): Probed input: 0, name = Composite 0 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 1, name = Composite 1 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 2, name = Composite 2 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 3, name = Composite 3 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 4, name = Tuner 0 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 5, name = Composite 4 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 6, name = S-Video 0 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 7, name = S-Video 1 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 8, name = S-Video 2 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 9, name = S-Video 3 Channel(/dev/v4l/video0)::TuneTo?(K06): curList[5].freq(184000) Channel(/dev/v4l/video0)::TuneToFrequency?(2944)

switch to SECAM : Failed to find channel(1) on current input (S-Video 0) of card (1). Found channel(1) on another input (Tuner 0) of card (1). Failed to find channel(1) on current input (S-Video 0) of card (1). Found channel(1) on another input (Tuner 0) of card (1). Channel(/dev/v4l/video0)::SwitchToInput?(in 4) Channel(/dev/v4l/video0)::SwitchToInput?() setting video mode to PAL Channel(/dev/v4l/video0)::SwitchToInput?(in 4): Error -1 while setting video mode (v2), "Périphérique ou ressource occupé", trying v4l v1 Channel(/dev/v4l/video0)::SwitchToInput?() setting video mode to PAL Channel(/dev/v4l/video0)::SwitchToInput?(in 4): Error -1 while setting video mode (v1): Périphérique ou ressource occupé Channel(/dev/v4l/video0):SetFormat?(): Probed input: 0, name = Composite 0 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 1, name = Composite 1 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 2, name = Composite 2 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 3, name = Composite 3 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 4, name = Tuner 0 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 5, name = Composite 4 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 6, name = S-Video 0 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 7, name = S-Video 1 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 8, name = S-Video 2 Channel(/dev/v4l/video0):SetFormat?(): Probed input: 9, name = S-Video 3 Channel(/dev/v4l/video0)::TuneTo?(28): curList[52].freq(527250) Channel(/dev/v4l/video0)::TuneToFrequency?(8436)

As you can see, if I switch to PAL mythtv want switch to SECAM, and if I switch to SECAM, mythtv want switch to PAL ..... I have a patch to force SECAM format on tuner, so, It's working fine but ... I have tried a code which force SECAM when I reveive PAL or SECAM when I receive PAL, it's working too :-(

BTW to use the SVideo input you probably need to attach a source to that input with a single channel in the video mode you need.

Yes, it's a dummy channel with PAL format.

comment:6 Changed 14 years ago by danielk

(In [7597]) References #427.

This makes Channel::SwitchToInput?() set the video format based on the channel video format when it is asked to set the channel rather being told to just switch to the input.

I think the problem may have been that SwitchToInput?() was failing because the default format was invalid for the input, so it never got to the point of setting the correct format when it set the channel.

comment:7 Changed 14 years ago by bjm <bjm@…>

[7597] breaks ToggleInputs?. When pressing "C" playback freezes on the last frame from the current input. After several seconds the a dialog is displayed for "Error was encountered while displaying video.". "Return to menu" goes back to a black screen rather than the menu. After several more seconds a popup says "The connection to the master backend server has gone away for some reason.. Is it running?". The MBE process is running but cannot be contacted even after restarting the frontend.

Frontend log:
2005-10-26 10:45:13.055 Video timing method: SGI OpenGL

[Press "C" at ~10:45:33 to switch from Television to S-Video input]

2005-10-26 10:45:53.451 ReadStringList timeout (quick).
2005-10-26 10:45:53.452 RemoteEncoder::SendReceiveStringList(): No response.
2005-10-26 10:45:53.452 WriteStringList: Bad socket
2005-10-26 10:45:53.452 ReadStringList: Bad socket
2005-10-26 10:45:53.452 RemoteEncoder::SendReceiveStringList(): No response.
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
2005-10-26 10:45:53.452 WriteStringList: Bad socket
2005-10-26 10:45:53.452 ReadStringList: Bad socket
2005-10-26 10:45:53.452 RemoteEncoder::SendReceiveStringList(): No response.
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)
2005-10-26 10:45:53.454 WriteStringList: Bad socket
2005-10-26 10:45:53.454 ReadStringList: Bad socket
2005-10-26 10:45:53.454 RemoteEncoder::SendReceiveStringList(): No response.
2005-10-26 10:45:53.454 decodeLongLong() called with offset >= list size.
2005-10-26 10:45:53.465 WriteStringList: Bad socket
2005-10-26 10:45:53.465 ReadStringList: Bad socket
2005-10-26 10:45:53.465 RemoteEncoder::SendReceiveStringList(): No response.
2005-10-26 10:45:53.465 decodeLongLong() called with offset >= list size.
2005-10-26 10:46:23.462 ReadStringList timeout (quick).
2005-10-26 10:46:23.463 RemoteFile::Read(): No response from control socket.
2005-10-26 10:46:23.463 RemoteFile::Read() failed in RingBuffer::safe_read().
2005-10-26 10:46:23.463 RemoteFile::Read() failed in RingBuffer::safe_read().
2005-10-26 10:46:23.463 RemoteFile::Read() failed in RingBuffer::safe_read().
2005-10-26 10:46:23.463 RemoteFile::Read() failed in RingBuffer::safe_read().
2005-10-26 10:46:23.463 RemoteFile::Read() failed in RingBuffer::safe_read().
2005-10-26 10:46:23.463 RemoteFile::Read() failed in RingBuffer::safe_read().

Backend log:

2005-10-26 10:45:12.907 TVRec(2): SetFlags(FrontendReady,) -> FrontendReady,RunMainLoop,AskAllowRecording,RecorderRunning,

[Press "C" at ~10:45:33 to switch from Television to S-Video input]

2005-10-26 10:45:33.450 TVRec(2): ClearFlags(RingBufferReset,) -> FrontendReady,RunMainLoop,AskAllowRecording,RecorderRunning,
2005-10-26 10:45:33.469 TVRec(2): Request: Program(no) channel(ToggleInputs) input() flags(LiveTV,)
2005-10-26 10:45:33.469 TVRec(2): ClearFlags(PENDINGACTIONS,) -> FrontendReady,RunMainLoop,AskAllowRecording,RecorderRunning,
2005-10-26 10:45:33.469 TVRec(2): SetFlags(WaitingForRecPause,) -> FrontendReady,RunMainLoop,AskAllowRecording,WaitingForRecPause,RecorderRunning,
2005-10-26 10:45:33.469 TVRec(2): ClearFlags(WaitingForRecPause,) -> FrontendReady,RunMainLoop,AskAllowRecording,RecorderRunning,
2005-10-26 10:45:33.469 TVRec(2): SetFlags(RingBufferReset,) -> FrontendReady,RunMainLoop,AskAllowRecording,RecorderRunning,RingBufferReset,
2005-10-26 10:45:33.469 Channel(/dev/video1)::SwitchToInput(in 2, set ch)
2005-10-26 10:45:33.472 Channel(/dev/video1): SetInputAndFormat(2, NTSC) setting format (v4l v2)
2005-10-26 10:45:33.474 TVRec(2) Error: Failed to set channel to ToggleInputs.Reverting to kState_None

[---------------------------------------^^^^^^^^^^^^^^^^^^^^^]

2005-10-26 10:45:33.474 TVRec(2): Changing from WatchingLiveTV to None
2005-10-26 10:45:33.474 TVRec(2): ClearFlags(FrontendReady,CancelNextRecording,) -> RunMainLoop,AskAllowRecording,RecorderRunning,RingBufferReset,
2005-10-26 10:45:33.474 TVRec(2): SetFlags(AskAllowRecording,) -> RunMainLoop,AskAllowRecording,RecorderRunning,RingBufferReset,
2005-10-26 10:45:33.474 TVRec(2): Request: Program(no) channel() input() flags(KillRec,)

comment:8 Changed 14 years ago by danielk

(In [7599]) References #427. Adds more debugging to SwitchToInput?().

Bruce can you try it with this, it won't fix the problem, but might point to the cause.

comment:9 Changed 14 years ago by bjm <bjm@…>

Log for "mythbackend -v record,channel":

2005-10-26 11:56:09.762 TVRec(2): SetFlags(FrontendReady,) -> FrontendReady,RunMainLoop,AskAllowRecording,RecorderRunning,

[Press "C" at ~11:56:41 to switch from Television to S-Video input]

2005-10-26 11:56:41.405 TVRec(2): ClearFlags(RingBufferReset,) -> FrontendReady,RunMainLoop,AskAllowRecording,RecorderRunning,
2005-10-26 11:56:41.406 TVRec(2): Request: Program(no) channel(ToggleInputs) input() flags(LiveTV,)
2005-10-26 11:56:41.406 TVRec(2): ClearFlags(PENDINGACTIONS,) -> FrontendReady,RunMainLoop,AskAllowRecording,RecorderRunning,
2005-10-26 11:56:41.406 TVRec(2): SetFlags(WaitingForRecPause,) -> FrontendReady,RunMainLoop,AskAllowRecording,WaitingForRecPause,RecorderRunning,
2005-10-26 11:56:41.432 TVRec(2): ClearFlags(WaitingForRecPause,) -> FrontendReady,RunMainLoop,AskAllowRecording,RecorderRunning,
2005-10-26 11:56:41.432 TVRec(2): SetFlags(RingBufferReset,) -> FrontendReady,RunMainLoop,AskAllowRecording,RecorderRunning,RingBufferReset,
2005-10-26 11:56:41.432 Channel(/dev/video1)::SwitchToInput(in 2, 'Undefined')
2005-10-26 11:56:41.435 Channel(/dev/video1): SetInputAndFormat(2, NTSC) setting format (v4l v2)
2005-10-26 11:56:41.437 Channel(/dev/video1): SwitchToInput(in 2, set ch):
                        Default channel 'Undefined' is not valid.
2005-10-26 11:56:41.437 TVRec(2) Error: Failed to set channel to ToggleInputs.Reverting to kState_None
2005-10-26 11:56:41.437 TVRec(2): Changing from WatchingLiveTV to None
2005-10-26 11:56:41.437 TVRec(2): ClearFlags(FrontendReady,CancelNextRecording,) -> RunMainLoop,AskAllowRecording,RecorderRunning,RingBufferReset,
2005-10-26 11:56:41.437 TVRec(2): SetFlags(AskAllowRecording,) -> RunMainLoop,AskAllowRecording,RecorderRunning,RingBufferReset,
2005-10-26 11:56:41.437 TVRec(2): Request: Program(no) channel() input() flags(KillRec,)

mysql> select * from cardinput where cardid=2\G
*************************** 1. row ***************************
    cardinputid: 2
         cardid: 2
       sourceid: 1
      inputname: Television
externalcommand:
     preference: 0
      shareable: N
       tunechan:
      startchan: 56
  freetoaironly: 1
    diseqc_port: NULL
     diseqc_pos: NULL
 lnb_lof_switch: 11700000
     lnb_lof_hi: 10600000
     lnb_lof_lo: 9750000
*************************** 2. row ***************************
    cardinputid: 6
         cardid: 2
       sourceid: 2
      inputname: S-Video
externalcommand: /bin/true
     preference: 0
      shareable: N
       tunechan:
      startchan: 204
  freetoaironly: 1
    diseqc_port: NULL
     diseqc_pos: NULL
 lnb_lof_switch: 11700000
     lnb_lof_hi: 10600000
     lnb_lof_lo: 9750000
2 rows in set (0.00 sec)

mysql> select * from channel where channum=204\G
*************************** 1. row ***************************
       chanid: 2204
      channum: 204
     sourceid: 2
     callsign: HBOCP
         name: Home Box Office Comedy (Pacific)
         icon: /home/bjm/.mythtv/channels/hbocomedy.jpg
     finetune: NULL
 videofilters: adjust=-1
      xmltvid: 18430
     contrast: 23420
   brightness: 36580
       colour: 32768
  recpriority: 0
       freqid: 204
          hue: 32768
     tvformat: Default
     commfree: 1
      visible: 1
outputfilters:
useonairguide: 0
      mplexid: NULL
    serviceid: NULL
    atscsrcid: NULL
1 row in set (0.00 sec)

comment:10 Changed 14 years ago by danielk

Milestone: unknown0.19
Version: 0.18.1head

Can you try it again, I just checked something in that may fix it...

comment:11 Changed 14 years ago by bjm <bjm@…>

Verified fix for the ToggleInputs? issue. I can't speak to the original format change issue.

One nit; UpdateOSDInput() is not called to display the card number and input as it should when changing inputs on the same card with TOGGLEINPUTS. It is, however, still correctly displayed when changing cards with SWITCHCARDS and when starting live TV.

comment:12 Changed 14 years ago by danielk

(In [7614]) References #427. Show new input in OSD in ToggleInputs?().

comment:13 Changed 14 years ago by danielk

Resolution: fixed
Status: newclosed

Jacques, I'm going to close this ticket now.

I tried setting my S-Video input to PAL, and it seemed to be doing the right things when switching. If this is still a problem for you, reopen the ticket with logs using the new code...

Note: See TracTickets for help on using tickets.