MythTV-Clients / MythTV-Android-Frontend

Implementation of MythTV .25+ Services API for Android
GNU General Public License v3.0
66 stars 16 forks source link

Recordings Screen: Add icon not working for slave backend recordings #148

Closed billmeek closed 11 years ago

billmeek commented 11 years ago

The episode exists in the MAF database. The hostname is slave-mc1, which is correct. No protocol was seen and (of course) no backend messages were seen when the Add icon (Play It Now) was pressed. Also fails on normal (non-slave) episodes.

The toast message said "Recorded program not found"

Running on: mythtv-android-frontend-1.10.1-398-g2305cc5 (master)

I added the following debug and found that the starttime is 0, yet, the channelId was correct.

diff --git a/src/org/mythtv/service/dvr/LiveStreamService.java b/src/org/mythtv/service/dvr/LiveStreamService.java
index 2bbabff..289ef54 100644
--- a/src/org/mythtv/service/dvr/LiveStreamService.java
+++ b/src/org/mythtv/service/dvr/LiveStreamService.java
@@ -225,6 +225,7 @@ public class LiveStreamService extends MythtvService {
        int channelId = extras.getInt( KEY_CHANNEL_ID );
        long startTimestamp = extras.getLong( KEY_START_TIMESTAMP );

+       Log.v( TAG, "createLiveStream : intent=" + intent + ", chanId=" + channelId + ", startTimestamp=" + startTimestamp);
        return mRecordedDaoHelper.findOne( this, locationProfile, channelId, new DateTime( startTimestamp ) );
    }

LogCat with Garbage Collection and W/ProgramDaoHelper(...): load : details messages edited out.

08-20 23:21:28.643: V/DvrNavigationDrawerActivity(9700): onOptionsItemSelected : enter
08-20 23:21:28.643: V/DvrNavigationDrawerActivity(9700): onOptionsItemSelected : exit
08-20 23:21:28.643: D/AbstractMythtvFragmentActivity(9700): onOptionsItemSelected : enter
08-20 23:21:28.643: D/AbstractMythtvFragmentActivity(9700): onOptionsItemSelected : exit
08-20 23:21:28.643: V/RecordingsFragment(9700): onOptionsItemSelected : enter
08-20 23:21:28.643: V/RecordingsFragment(9700): onOptionsItemSelected : exit
08-20 23:21:28.643: V/EpisodeFragment(9700): onOptionsItemSelected : enter
08-20 23:21:28.643: D/EpisodeFragment(9700): onOptionsItemSelected : add selected
08-20 23:21:30.223: I/EpisodeFragment(9700): startCreateStreamService : enter
08-20 23:21:30.233: I/EpisodeFragment(9700): startCreateStreamService : exit
08-20 23:21:30.233: D/LiveStreamService(9462): onHandleIntent : enter
08-20 23:21:30.303: V/LiveStreamService(9462): sendCompleteRecordedProgramNotFound : enter
08-20 23:21:30.303: V/LiveStreamService(9462): sendCompleteRecordedProgramNotFound : exit
08-20 23:21:30.303: D/LiveStreamService(9462): onHandleIntent : exit, Recorded program not found
08-20 23:21:30.333: I/EpisodeFragment(9700): LiveStreamReceiver.onReceive : enter
08-20 23:21:30.333: I/EpisodeFragment(9700): LiveStreamReceiver.onReceive : complete=null
08-20 23:21:30.333: V/EpisodeFragment(9700): updateHlsDetails : enter
08-20 23:21:30.333: D/LiveStreamDaoHelper(9700): findByProgram : enter
08-20 23:21:30.333: D/LiveStreamDaoHelper(9700): findOne : enter
08-20 23:21:30.343: D/LiveStreamDaoHelper(9700): findOne : exit
08-20 23:21:30.343: D/LiveStreamDaoHelper(9700): findByProgram : exit
08-20 23:21:30.343: V/EpisodeFragment(9700): updateHlsMenuButtons : enter
08-20 23:21:30.343: D/LiveStreamDaoHelper(9700): findByProgram : enter
08-20 23:21:30.343: D/LiveStreamDaoHelper(9700): findOne : enter
08-20 23:21:30.453: D/LiveStreamDaoHelper(9700): findOne : exit
08-20 23:21:30.453: D/LiveStreamDaoHelper(9700): findByProgram : exit
08-20 23:21:30.453: V/EpisodeFragment(9700): updateHlsMenuButtons : exit
08-20 23:21:30.453: V/EpisodeFragment(9700): updateHlsDetails : exit
08-20 23:21:30.453: I/EpisodeFragment(9700): RecordedRemovedReceiver.onReceive : exit
dmfrey commented 11 years ago

still happening in beta v1.20.0?

billmeek commented 11 years ago

Yes, it's still happening on the latest commit.

Could be my misunderstanding of Eclipse, but in Git there are no tags for beta v1.20.0 (or branches.)

Running on: mythtv-android-frontend-1.10.1-414-g6745950

billmeek commented 11 years ago

Retested both before and after 155 was fixed. Fails for the slave backend recording, but WORKS OK for master backend recordings now.

dmfrey commented 11 years ago

Yeah. Saw that. Am working on a fix. On Aug 28, 2013 5:07 PM, "billmeek" notifications@github.com wrote:

Retested both before and after 155 was fixed. Fails for the slave backend recording, but WORKS OK for master backend recordings now.

— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/148#issuecomment-23447702 .

billmeek commented 11 years ago

It appears that the channel and starttime are getting passed OK And, the location profile correctly shows the backend's hostname of mc0. However, in the database, this recording is mc1-slave.

When appendLocationHostname is run, it uses: FIELD_MASTER_HOSTNAME and or locationProfile.getHostname().

So, I think loadRecorded fails to find the program because the slave's hostname isn't used.

EpisodeFragment.java: startCreateStreamService
  LiveStreamService.java: loadRecorded
     RecordedDaoHelper.java: findOne
        AbstractDaoHelper.java: appendLocationHostname
08-28 17:41:35.796: I/EpisodeFragment(15002): startCreateStreamService : enter
08-28 17:41:35.796: I/EpisodeFragment(15002): startCreateStreamService : chanId=2141
08-28 17:41:35.796: I/EpisodeFragment(15002): startCreateStreamService : start=1377716940000
08-28 17:41:35.806: I/EpisodeFragment(15002): startCreateStreamService : exit
08-28 17:41:35.906: V/MainApplication(15140): onCreate : enter
08-28 17:41:36.056: D/dalvikvm(15140): GC_CONCURRENT freed 592K, 11% free 7425K/8327K, paused 4ms+2ms
08-28 17:41:36.196: D/dalvikvm(15140): GC_CONCURRENT freed 754K, 12% free 8001K/9031K, paused 2ms+5ms
08-28 17:41:36.386: V/MainApplication(15140): onCreate : exit
08-28 17:41:36.396: D/LiveStreamService(15140): onHandleIntent : enter
08-28 17:41:36.436: D/LiveStreamService(15140): onHandleIntent : locationProfile=LocationProfile [id=1, type=HOME, name=Mythbackend on mc0, url=http://192.168.1.204:6544/, selected=true, connected=true, version=0.27.20130820-2, protocolVersion=77, wolAddress=, hostname=mc0, ]
08-28 17:41:36.436: D/LiveStreamService(15140): onHandleIntent : intent.extras.chanid=2141
08-28 17:41:36.436: D/LiveStreamService(15140): onHandleIntent : intent.extras.startt=1377716940000
08-28 17:41:36.496: V/LiveStreamService(15140): sendCompleteRecordedProgramNotFound : enter
billmeek commented 11 years ago

Argh - or I could have read my email before pressing the comment button.

dmfrey commented 11 years ago

If you let the hls transcode finish on the backend, the service stops in the app. Then you can execute the delete. But while the update is running you can't execute another action against the same service. It is the same reason why pressing play wouldn't start playback either.

I am working on making sure the service gets stopped before it tries send another action to it.

Problem now is the service is adding a bogus livestream entry in the db which contains a bad segment size and percent complete.

I hope to have it cleaned up tonight sometime. On Aug 28, 2013 7:14 PM, "billmeek" notifications@github.com wrote:

It appears that the channel and starttime are getting passed OK And, the location profile correctly shows the backend's hostname of mc0. However, in the database, this recording is mc1-slave.

When appendLocationHostname is run, it uses: FIELD_MASTER_HOSTNAME and or locationProfile.getHostname().

So, I think loadRecorded fails to find the program because the slave's hostname isn't used.

EpisodeFragment.java: startCreateStreamService LiveStreamService.java: loadRecorded RecordedDaoHelper.java: findOne AbstractDaoHelper.java: appendLocationHostname

08-28 17:41:35.796: I/EpisodeFragment(15002): startCreateStreamService : enter 08-28 17:41:35.796: I/EpisodeFragment(15002): startCreateStreamService : chanId=2141 08-28 17:41:35.796: I/EpisodeFragment(15002): startCreateStreamService : start=1377716940000 08-28 17:41:35.806: I/EpisodeFragment(15002): startCreateStreamService : exit 08-28 17:41:35.906: V/MainApplication(15140): onCreate : enter 08-28 17:41:36.056: D/dalvikvm(15140): GC_CONCURRENT freed 592K, 11% free 7425K/8327K, paused 4ms+2ms 08-28 17:41:36.196: D/dalvikvm(15140): GC_CONCURRENT freed 754K, 12% free 8001K/9031K, paused 2ms+5ms 08-28 17:41:36.386: V/MainApplication(15140): onCreate : exit 08-28 17:41:36.396: D/LiveStreamService(15140): onHandleIntent : enter 08-28 17:41:36.436: D/LiveStreamService(15140): onHandleIntent : locationProfile=LocationProfile [id=1, type=HOME, name=Mythbackend on mc0, url=http://192.168.1.204:6544/, selected=true, connected=true, version=0.27.20130820-2, protocolVersion=77, wolAddress=, hostname=mc0, ] 08-28 17:41:36.436: D/LiveStreamService(15140): onHandleIntent : intent.extras.chanid=2141 08-28 17:41:36.436: D/LiveStreamService(15140): onHandleIntent : intent.extras.startt=1377716940000 08-28 17:41:36.496: V/LiveStreamService(15140): sendCompleteRecordedProgramNotFound : enter

— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/148#issuecomment-23456113 .

billmeek commented 11 years ago

I just updated the title of the issue. It's Circled +, not Circled X. The failure I was trying to address happens on a fresh database and no previous/ existing transcodes. I agree, menu->Delete fails too.

billmeek commented 11 years ago

This is still failing. MAF can't find the recording. No protocol is received by the MythTV backend.

dmfrey commented 11 years ago

@billmeek can you verify the data is correct on the backend and what is being sent from the app?

nothing is received on the secondary backend? Is there any error on the primary backend?

billmeek commented 11 years ago

Looking at the slave backend with upnp logging on, there are no messages and looking with tshark, no protocol is exchanged.

Looking at the master backend with the same tools. The only message in the backend log is: GetHostName : GET /Myth/GetHostName and the same is seen using tshark.

The above were captured (or not captured) after the Circled + followed by Process were pressed.

For this test, mc0 = Master Backend, mc1 = Slave Backend, slave-mc1 = the Slave Backend's profile

As for the data, here's a copy of:

http://mc0:6544/Dvr/GetRecordedList?TitleRegEx=Fly-Away%20Baby

The same result comes back if the hostname is changed to mc1.

<ProgramList version="1.0" serializerVersion="1.1">
<StartIndex>0</StartIndex>
<Count>1</Count>
<TotalAvailable>1</TotalAvailable>
<AsOf>2013-08-29T20:48:01Z</AsOf>
<Version>0.27.20130827-1</Version>
<ProtoVer>77</ProtoVer>
<Programs>
<Program>
<StartTime>2013-08-29T16:45:00Z</StartTime>
<EndTime>2013-08-29T18:00:00Z</EndTime>
<Title>Fly-Away Baby</Title>
<SubTitle/>
<Category>Crime drama</Category>
<CatType/>
<Repeat>false</Repeat>
<VideoProps>2</VideoProps>
<AudioProps>0</AudioProps>
<SubProps>0</SubProps>
<SeriesId/>
<ProgramId>MV000409810000</ProgramId>
<Stars>0.5</Stars>
<FileSize>167323384</FileSize>
<LastModified>2013-08-29T17:29:51Z</LastModified>
<ProgramFlags>5</ProgramFlags>
<FileName>2143_20130829171700.mpg</FileName>
<HostName>slave-mc1</HostName>
<Airdate/>
<Description>Newswoman Torchy Blane (Glenda Farrell) shows her policeman boyfriend (Barton MacLane) she can crack a murder case.</Description>
<Inetref>167060</Inetref>
<Season>0</Season>
<Episode>0</Episode>
<Channel>
<ChanId>2143</ChanId>
<ChanNum>143</ChanNum>
<CallSign>TCM</CallSign>
<IconURL>/Guide/GetChannelIcon?ChanId=2143</IconURL>
<ChannelName>Turner Classic Movies</ChannelName>
<MplexId>0</MplexId>
<TransportId>0</TransportId>
<ServiceId>0</ServiceId>
<NetworkId>0</NetworkId>
<ATSCMajorChan>0</ATSCMajorChan>
<ATSCMinorChan>0</ATSCMinorChan>
<Format/>
<Modulation/>
<Frequency>0</Frequency>
<FrequencyId/>
<FrequencyTable/>
<FineTune>0</FineTune>
<SIStandard/>
<ChanFilters/>
<SourceId>0</SourceId>
<InputId>0</InputId>
<CommFree>0</CommFree>
<UseEIT>false</UseEIT>
<Visible>true</Visible>
<XMLTVID/>
<DefaultAuth/>
<Programs/>
</Channel>
<Recording>
<Status>-3</Status>
<Priority>0</Priority>
<StartTs>2013-08-29T17:17:00Z</StartTs>
<EndTs>2013-08-29T17:25:00Z</EndTs>
<RecordId>761</RecordId>
<RecGroup>Default</RecGroup>
<PlayGroup>Default</PlayGroup>
<StorageGroup>Default</StorageGroup>
<RecType>0</RecType>
<DupInType>15</DupInType>
<DupMethod>6</DupMethod>
<EncoderId>0</EncoderId>
<Profile>Default</Profile>
</Recording>
<Artwork>
<ArtworkInfos/>
</Artwork>
</Program>
</Programs>
</ProgramList>

The data in the MAF DB looks like:

sqlite> .mode line
sqlite> select * from recorded where title='Fly-Away Baby';
               _id = 260
        START_TIME = 1377794700000
          END_TIME = 1377799200000
             TITLE = Fly-Away Baby
         SUB_TITLE = 
          CATEGORY = Crime drama
     CATEGORY_TYPE = 
            REPEAT = 0
       VIDEO_PROPS = 2
       AUDIO_PROPS = 0
         SUB_PROPS = 0
         SERIES_ID = 
        PROGRAM_ID = MV000409810000
             STARS = 0.5
         FILE_SIZE = 167323384
     LAST_MODIFIED = 2013-08-29T17:29:51
     PROGRAM_FLAGS = 5
          HOSTNAME = slave-mc1
          FILENAME = 2143_20130829171700.mpg
          AIR_DATE = 
       DESCRIPTION = Newswoman Torchy Blane (Glenda Farrell) shows her policeman boyfriend (Barton MacLane) she can crack a murder case.
           INETREF = 167060
            SEASON = 0
           EPISODE = 0
        CHANNEL_ID = 2143
         RECORD_ID = 761
          IN_ERROR = 0
   MASTER_HOSTNAME = mc0
LAST_MODIFIED_DATE = 1377797882763

And the record in the MythTV DB is:

mysql> select * from recorded where title='fly-away baby'\G
*************************** 1. row ***************************
         chanid: 2143
      starttime: 2013-08-29 17:17:00
        endtime: 2013-08-29 17:25:00
          title: Fly-Away Baby
       subtitle: 
    description: Newswoman Torchy Blane (Glenda Farrell) shows her policeman boyfriend (Barton MacLane) she can crack a murder case.
         season: 0
        episode: 0
       category: Crime drama
       hostname: slave-mc1
       bookmark: 0
        editing: 0
        cutlist: 0
     autoexpire: 1
    commflagged: 1
       recgroup: Default
       recordid: 761
       seriesid: 
      programid: MV000409810000
        inetref: 167060
   lastmodified: 2013-08-29 12:29:51
       filesize: 167323384
          stars: 0.5
previouslyshown: 0
originalairdate: 0000-00-00
       preserve: 0
         findid: 0
  deletepending: 0
     transcoder: 0
    timestretch: 1
    recpriority: 0
       basename: 2143_20130829171700.mpg
      progstart: 2013-08-29 16:45:00
        progend: 2013-08-29 18:00:00
      playgroup: Default
        profile: Default
      duplicate: 0
     transcoded: 0
        watched: 0
   storagegroup: Default
 bookmarkupdate: 0000-00-00 00:00:00
1 row in set (0.00 sec)
dmfrey commented 11 years ago

@billmeek does this fail when you press the button? Or does it fail when you go to the VideoActivity and it never plays?

billmeek commented 11 years ago

It happens when I press the Circled + (followed by Process in the warning pop up.)

dmfrey commented 11 years ago

@billmeek does this now work with the change you made in 0413e0b9c4c19e8de9fa8003b9a25b3d2c6ef6d6 to resolve issue #168?

billmeek commented 11 years ago

@dmfrey, No, I still get the "Recorded program not found" Toast. FWIW, pressing Menu/Delete/Delete shows 2 Toasts: "Episode NOT deleted!" and "Recorded program not found".

Running on: mythtv-android-frontend-1.10.1-490-gb2a8ac9

dmfrey commented 11 years ago

pull the latest head. I removed the toasts last night and fixed some things with delete

On Thu, Sep 12, 2013 at 11:20 AM, billmeek notifications@github.com wrote:

@dmfrey https://github.com/dmfrey, No, I still get the "Recorded program not found" Toast. FWIW, pressing Menu/Delete/Delete shows 2 Toasts: "Episode NOT deleted!" and "Recorded program not found".

Running on: mythtv-android-frontend-1.10.1-490-gb2a8ac9

— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/148#issuecomment-24329480 .

My Google Profile http://www.google.com/profiles/dmfrey

billmeek commented 11 years ago

Grrr, I had done the pull for, mythtv-android-frontend-1.10.1-490-gb2a8ac9. But it helps to do a build too (got distracted.)

However, still no joy. The Toast is gone. I see the following in LogCat:

09-12 10:43:09.571: D/LiveStreamService(28500): onHandleIntent : exit, Recorded program not found

I'm trying to look inside the extras for the hostname, and not doing well. Is the master hostname being used or the slave's hostname?

dmfrey commented 11 years ago

@billmeek, does a entry ever get created in the live_stream table in the sqlite db? If so, what is the source host set to?

On Thu, Sep 12, 2013 at 12:43 PM, billmeek notifications@github.com wrote:

Grrr, I had done the pull for, mythtv-android-frontend-1.10.1-490-gb2a8ac9. But it helps to do a build too (got distracted.)

However, still no joy. The Toast is gone. I see the following in LogCat:

09-12 10:43:09.571: D/LiveStreamService(28500): onHandleIntent : exit, Recorded program not found

I'm trying to look inside the extras for the hostname, and not doing well. Is the master hostname being used or the slave's hostname?

— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/148#issuecomment-24336410 .

My Google Profile http://www.google.com/profiles/dmfrey

billmeek commented 11 years ago

No, the live_stream table is empty. Looking at:

AbstractDaoHelper.java: appendLocationHostname, uses locationProfile.getHostname()

The host used to look-up the recording will be that of the master backend, it should be the slave (slave-mc1 in my test case, not mc0.)

dmfrey commented 11 years ago

no, that statement is just in place to keep the items that are from the same master backend in line from items from another backend. That is used all over the code so you know you are only querying the db for items from the backend you are currently connected to.

Can you see what the data being returned from GetRecordedList is setting for the Hostname for those recordings that are on your slave backend. Then we need to make sure they are getting stored in the sqlite db that way.

On Thu, Sep 12, 2013 at 4:39 PM, billmeek notifications@github.com wrote:

No, the live_stream table is empty. Looking at:

AbstractDaoHelper.java: appendLocationHostname, uses locationProfile.getHostname()

The host used to look-up the recording will be that of the master backend, it should be the slave (slave-mc1 in my test case, not mc0.)

— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/148#issuecomment-24353924 .

My Google Profile http://www.google.com/profiles/dmfrey

billmeek commented 11 years ago

Please look a the comment 10 boxes above this one on the issues web page. I've dumped the MythTV db, the XML and the SqLite.

In all three cases, the hostname is: slave-mc1.

dmfrey commented 11 years ago

I had a thought...I wonder if this is the same problem as #170 where were are staring the connection to the backend, instead of the frontend? I don't recall having to call the slave backend directly previously. Could that have changed with v.27+?

billmeek commented 11 years ago

I don't think it's a Frontend issue. but you bring up a good point. And I agree the conversation should be between MAF and the Master backend, not the Slave backend.

The 1st message below is what a GOOD request looks like for a recording that is on my test platform running as a Master. This kicks off a mythtranscode session, as we would expect. Nothing new here.

mc1:6544Content/AddLiveStream?StorageGroup=Default&FileName=1021_20130911022300.mpg&HostName=mc1&Height=540&Bitrate=1000000&AudioBitrate=128000&SampleRate=48000

Using the above as a template, I modified the request for what I thought a request should look for a recording made on my test platform when running as a Slave to my production platform which is a Master (slave-mc1 and mc0 respectively.)

mc0:6544/Content/AddLiveStream?StorageGroup=Default&FileName=2143_20130829171700.mpg&HostName=slave-mc1&Height=540&Bitrate=1000000&AudioBitrate=128000&SampleRate=48000

The above worked. A mythtranscode session is running now on my master (mc0) for a recording that exists on my test platform running as a Slave.

Doesn't fix the problem, but it does show what the proper message should be.

Keep in mind that MAF never gets this close. It can't even find the recording to begin with.

08-28 17:41:36.496: V/LiveStreamService(15140): sendCompleteRecordedProgramNotFound : enter
billmeek commented 11 years ago

If you'd like to connect to my Master and see this, send me a private email. I believe you're still setup, but for access to my test platform.

Here's the response from mc0 for the recording made on slave-mc1:

<LiveStreamInfo version="1.0" serializerVersion="1.1">
<Id>144</Id>
<Width>0</Width>
<Height>540</Height>
<Bitrate>1000000</Bitrate>
<AudioBitrate>128000</AudioBitrate>
<SegmentSize>10</SegmentSize>
<MaxSegments>0</MaxSegments>
<StartSegment>0</StartSegment>
<CurrentSegment>0</CurrentSegment>
<SegmentCount>0</SegmentCount>
<PercentComplete>0</PercentComplete>
<Created>2013-09-14T03:06:55Z</Created>
<LastModified>2013-09-14T03:06:55Z</LastModified>
<RelativeURL/>
<FullURL/>
<StatusStr>Queued</StatusStr>
<StatusInt>0</StatusInt>
<StatusMessage/>
<SourceFile>myth://Default@slave-mc1/2143_20130829171700.mpg</SourceFile>
<SourceHost>mc0</SourceHost>
<SourceWidth>0</SourceWidth>
<SourceHeight>0</SourceHeight>
<AudioOnlyBitrate>32000</AudioOnlyBitrate>
</LiveStreamInfo>
dmfrey commented 11 years ago

I believe I am sending in the hostname in the call to the backend.

For these programs, can you see if the start time is different in the recorded table and the recording table on the backend and local Sqlite dB's? On Sep 13, 2013 11:26 PM, "billmeek" notifications@github.com wrote:

If you'd like to connect to my Master and see this, send me a private email. I believe you're still setup, but for access to my test platform.

Here's the response from mc0 for the recording made on slave-mc1:

144 0 540 1000000 128000 10 0 0 0 0 0 2013-09-14T03:06:55Z 2013-09-14T03:06:55Z Queued 0 myth://Default@slave-mc1/2143_20130829171700.mpg mc0 0 0 32000

— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/148#issuecomment-24435917 .

billmeek commented 11 years ago

Interesting. Of the 8 slave-mc1 recordings, only 2 are in the recording_recorded table (hope that's the one you meant.) And the one I've been testing with isn't there.

I tested one of the matches, and it's 74% transcodied as I write this response (per the backend, not MAF.)

sqlite> select TITLE,START_TIME from recorded where HOSTNAME='slave-mc1';
Live Free or Die Hard|1366480800000 <----------
Flea Market Flip|1368207000000
Without a Trace|1379026800000
Fly-Away Baby|1377794700000
Flea Market Flip|1368208800000 <---------- 5/10 @ 1300
Castle|1379030400000
Friday the 13th, Part VI: Jason Lives|1379026800000
My Cousin Vinny|1366479000000

select * from recording_recorded where start_ts in (1366480800000,1368207000000,1379026800000,1377794700000,1368208800000,1379030400000,1379026800000,1366479000000);
37|-3|0|1366480800000|1366491600000|741|Default|Default|Default|0|0|0|0|Default||1366480800000|mc0|1379032218130
124|-3|0|1368208800000|1368210600000|745|Default|Default|Default|0|0|0|0|Default||1368208800000|mc0|1379032218130
dmfrey commented 11 years ago

can you see what the db has on the backend as well?

billmeek commented 11 years ago

Backend:

starttime: 2013-08-29 17:17:00
basename: 2143_20130829171700.mpg
progstart: 2013-08-29 16:45:00
hostname: slave-mc1

XML:

<StartTime>2013-08-29T16:45:00Z</StartTime>
<StartTs>2013-08-29T17:17:00Z</StartTs>
<HostName>slave-mc1</HostName>
<FileName>2143_20130829171700.mpg</FileName>

There's a full dump of the MySQL, XML and Sqlite about midway above. But, let me know if you need fresh full dumps.

dmfrey commented 11 years ago

I think that is the issue. If I remember correctly, I am passing in the program start time and not the recording start time. But I think i need to solve why not all the recorded programs don't have a corresponding recorded_recording. On Sep 14, 2013 1:53 PM, "billmeek" notifications@github.com wrote:

Backend:

starttime: 2013-08-29 17:17:00 basename: 2143_20130829171700.mpg progstart: 2013-08-29 16:45:00 hostname: slave-mc1

XML:

2013-08-29T16:45:00Z 2013-08-29T17:17:00Z slave-mc1 2143_20130829171700.mpg

There's a full dump of the MySQL, XML and Sqlite about midway above. But, let me know if you need fresh full dumps.

— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/148#issuecomment-24451987 .

billmeek commented 11 years ago

Sounds good. Converting the MAF times, below is a working episode followed by a failing one. MAF DB/MythTV DB.

Live Free or Die Hard|1366480800000 = Sat Apr 20 18:00:00 UTC 2013 Fly-Away Baby|1377794700000 = Thu Aug 29 16:45:00 UTC 2013

+---------------------------------------+---------------------+---------------------+
| title                                 | starttime           | progstart           |
+---------------------------------------+---------------------+---------------------+
| Live Free or Die Hard                 | 2013-04-20 18:00:00  = 2013-04-20 18:00:00 |
| Fly-Away Baby                         | 2013-08-29 17:17:00 != 2013-08-29 16:45:00 |
+---------------------------------------+---------------------+---------------------+
dmfrey commented 11 years ago

@billmeek

can you change your query from above where only 2 entries were returned from the recording_recorded table to the following:

select
  r.title, r.sub_title, r.start_time, rr.start_ts, rr.start_time
from
  recorded r
    left join recording_recorded rr on r.start_time = rr.start_time and r.record_id = rr.record_id and r.master_hostname = rr.master_hostname
where
    r.master_hostname = 'mythcenter'
order by
    r.start_time desc;

Then if you want to see where they aren't equal, add this to the where statement

    and not rr.start_time = rr.start_ts

There is a join column in the recording_recorded table called START_TIME, which maps to the START_TIME in the recorded table. I noticed early on that these sometimes did match up (i.e. a program is supposed to start at 6:00 pm, and you either press the Record button on the remote at 6:02 pm or set a new rule to record just one program now an you are at 6:02 pm, get the idea??).

That is why there is a discrepancy between the two.

In your previous query, you were joining in the recording_recorded.START_TS, which is wrong in this case.

If the above returns a record per program (data from both recorded and recording_recorded, then all the data is getting loaded correctly. I think what it boils down to is I am trying to do a lookup for a recorded program, probably off of the wrong timstamp, so that is the real reason we are not finding it and not that it can't be played on the secondary backend.

billmeek commented 11 years ago

OK, the 1st query returns 228 rows. The 2nd returns 7 rows.

Castle|Den of Thieves|1379030400000|1379030460000|1379030400000
Without a Trace|Lone Star|1379026800000|1379030040000|1379026800000
Friday the 13th, Part VI: Jason Lives||1379026800000|1379030460000|1379026800000
Fly-Away Baby||1377794700000|1377796620000|1377794700000
Woodsmith Shop|Our 5 Favorite Shop Jigs|1370115000000|1370115540000|1370115000000
Flea Market Flip||1368207000000|1368207960000|1368207000000
My Cousin Vinny||1366479000000|1366480980000|1366479000000
billmeek commented 11 years ago

Fixed by d8a1448. Master Backend got the request and started transcoding the recording (which is stored on the Slave Backend.)

GET /Content/AddLiveStream?StorageGroup=Default&FileName=2143_20130829171700.mpg&HostName=slave-mc1&Height=540&Bitrate=1000000&AudioBitrate=128000&SampleRate=48000

Transcoding completed, however, there were no updates to the % processing and I can't play it. The Master Backend shows 100% complete in the livestreaming table (sounds like #164, but I'll test that separately.) Closing this issue.

LogCat: http://pastebin.com/raw.php?i=9KY4nRRw

dmfrey commented 11 years ago

I closed #164 just after this one. If it's not playing then I am probably sending in the wrong timestamp to the play command as well. On Sep 14, 2013 5:17 PM, "billmeek" notifications@github.com wrote:

Fixed by d8a1448https://github.com/MythTV-Clients/MythTV-Android-Frontend/commit/d8a1448. Master Backend got the request and started transcoding the recording (which is stored on the Slave Backend.)

GET /Content/AddLiveStream?StorageGroup=Default&FileName=2143_20130829171700.mpg&HostName=slave-mc1&Height=540&Bitrate=1000000&AudioBitrate=128000&SampleRate=48000

Transcoding completed, however, there were no updates to the % processing and I can't play it. The Master Backend shows 100% complete in the livestreaming table (sounds like #164https://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/164, but I'll test that separately.) Closing this issue.

LogCat: http://pastebin.com/raw.php?i=9KY4nRRw

— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/148#issuecomment-24459344 .