Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#1671 closed task (fixed)

SA4200HD channel changer

Reported by: eris3@… Owned by: jwestfall
Priority: minor Milestone: 0.20
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

Channel Change control for SA4200 via firewire.

The SA3250 channel change utility does not work for the SA4200 box. It seems to have a different command structure. After putzing around with a bunch of bit settings, I think I found one that works. (Basically SA4200's vendor id is 0x14f8 and model_id is 0x1072 and you send the same command, except cmd[1] is simply CTL_CMD1 | (chn << 8);

sa4200ch.c is attached.

I don't think the key_release command in sa3250 was being sent right, I've found that simply sending it in one transaction works better.

I don't know howto make this an internal thing instead of an external tool, if someone could point me in the right direction I'll create a patch for that as well.

Attachments (4)

sa4200ch.c (3.8 KB) - added by eris3@… 18 years ago.
sa3250.patch (13.6 KB) - added by chris@… 18 years ago.
Patch to sa3250ch.c and README to support alternate mode and other enhancements
internalfw4200.patch (2.1 KB) - added by chris@… 18 years ago.
Patch to add support for SA4200HD into internal firewire ch. changer
sa3250ch.patch (5.5 KB) - added by chris@… 18 years ago.
Patch to sa3250ch.c with only new vendor/model ids (including SA4200) and '-s' mode

Download all attachments as: .zip

Change History (20)

Changed 18 years ago by eris3@…

Attachment: sa4200ch.c added

comment:1 Changed 18 years ago by cpinkham

Can you add an optional command-line argument to the sa3250ch program to work with the sa4200 if it really is that small of a difference between the two programs and then resubmit a patch to sa3250ch.c?

comment:2 Changed 18 years ago by eris3@…

Yeah, I'll do that. Actually I was thinking of just detecting the device and have it work that way automatically.

comment:3 Changed 18 years ago by chris@…

Haha... I was just looking around seeing if there was a good place for me to paste up my patched sa3250 channel changing code. I spent some time and reverse engineered it last night and reached the same conclusion, for some reason on some of these boxes (I'm assuming it has a lot to do with provider and software version) you need to send the entire channel as 12 bits (actually it's probably more like 9 bits since I can't imagine why you'd need the whole 12 for a channel number), as one command.

In any case, I can verify that this approach works with the SA3250HD from Comcast Digital of Alexandria, VA running Passport software (not next to the box so I don't know the version).

comment:4 Changed 18 years ago by danielk

Milestone: 0.20
Owner: changed from Isaac Richards to danielk
Version: head

comment:5 Changed 18 years ago by danielk

Chris, do you think you could add this to the internal FirewireRecorder? channel changer as well?

comment:6 in reply to:  5 Changed 18 years ago by chris@…

Replying to danielk:

Chris, do you think you could add this to the internal FirewireRecorder? channel changer as well?

If nobody else is working on this at the moment (eris3?) I'd be happy to post up a patched version of the CLI code as well as get something put into the internal code (which I haven't tracked down and looked at yet, to be fair, but code is code).

On that note, eris3, or anyone else monitoring this who might have an SA4200 box, or really any Scientific Atlanta STB that they try to change channels over firewire with, the output from an "saXXXXch -v" run would be nice to have, there seems to be a rather sharp distinction in the way different vendor/model/software combinations act over firewire.

So somebody at some point will have to try to make things a little bit more adaptive, or at least better informed on the fly. Figure it's probably best to get as much of that taken care of sooner rather than later to the extent possible.

comment:7 Changed 18 years ago by chris@…

In the meantime, here's a patch against r10007 for sa3250ch.c and the README. This includes the extra option to use the single-command mode for the SA4200 and at least my SA3250 box. There are also numerous other little enhancements in there that I had added, including:


  • "-s" (single command) mode for SA4200/some SA3250 models
  • 1394 port/node autodetection (on by default, but that can be changed if problematic)
  • "-p" argument to manually specify port on 1394 bus
  • "-n" argument to manually specify node on 1394 port
  • "-f" (force) mode to force sending of command(s) even if compatible device not detected
  • "-a" (autodetection/report) mode which just attempts to detect a device automatically or using a user specified port and/or node, then exits
  • Various other cleanups

Now that I think about it, it probably wouldn't be a terrible idea to add a hook in there so that if the command is invoked as "sa4200ch" it magically switches to "-s" mode so you could just symlink it to the alternate name to avoid having to add extra arguments on the command line.

Anyway, this should hopefully be helpful until I get the Internal FirewireChanger? code integrated. Can't imagine that will be that tough, but I have to briefly acquaint myself with the MythTV codebase enough to do some damage and I need to get the svn version building and running.

Changed 18 years ago by chris@…

Attachment: sa3250.patch added

Patch to sa3250ch.c and README to support alternate mode and other enhancements

Changed 18 years ago by chris@…

Attachment: internalfw4200.patch added

Patch to add support for SA4200HD into internal firewire ch. changer

comment:8 Changed 18 years ago by chris@…

Resolution: worksforme
Status: newclosed

Attached is a patch against r10231 (source:/trunk/mythtv/libs/libmythtv) to add support for the SA4200HD.

I just added an additional "SA4200HD" option in the tuner config info and updated the help text to indicate that it also works for some SA3200HD units. Perhaps not the most user friendly way of doing it in the world, but it keeps the patch small and hopefully lowers the risk of it blowing anything else up.

Works fine here, but I only have this one system and my SA3250 to test with. Let me know if it gives anyone any problems.

comment:9 Changed 18 years ago by chris@…

Resolution: worksforme
Status: closedreopened

I just realized I was probably mapping my regular non-MythTV Trac workflow into the MythTV process and probably screwed up a query somewhere by marking it as "worksforme". I'll just sit down and shut up now.

comment:10 Changed 18 years ago by danielk

Resolution: invalid
Status: reopenedclosed

I applied internalfw4200.patch in [10237].

I did not apply sa3250.patch, it appears to remove a vendor ID and it makes some unrelated changes to the channel changer. I'm not averse to cleanup patches, but they need to be seperate patches.

Reopen when there you have a patch which doesn't remove vendor IDs and doesn't contain unrelated (formatting) changes.. thx

comment:11 Changed 18 years ago by chris@…

Resolution: invalid
Status: closedreopened

Sorry for the delay, if only I could get paid to hack on MythTV :)

Anyway, there's a new sa3250.patch which only includes a new '-s' command to send the command in the manner specified above, accompanying text in the usage(), and an SA3250 vendor ID that corresponds to the one I have, and the SA4200 ids specified above.

Note that if the SA4200 vendor/model ID are detected, it automatically switches into '-s' mode. This is not the case for the new SA3250 vendor id, as I wasn't sure if it was a safe assumption to make (if anyone else can confirm/deny that their SA3250 with vendor ID 0x00001692 works with '-s' mode, I'd love to hear about it).

Changed 18 years ago by chris@…

Attachment: sa3250ch.patch added

Patch to sa3250ch.c with only new vendor/model ids (including SA4200) and '-s' mode

comment:12 Changed 18 years ago by danielk

Owner: changed from danielk to jwestfall
Status: reopenednew

comment:13 Changed 18 years ago by jwestfall

Resolution: fixed
Status: newclosed

(In [10759]) applies modified patch from chris at spicecoffee.org to add an additional channel change method for sa3250/sa4200. closes #1671

comment:14 Changed 17 years ago by danielk

(In [11786]) Refs #1671. Adds a vendor ID for the Scientific Atlanta 4200HD channel changer.

comment:15 Changed 17 years ago by eric.broszeit@…

Type: enhancementtask

I have tried the 4200 script, but I keep getting an error stating that it cannot find the sa4200hd on the 1394 bus. I am not a programmer, and I am lost looking at the script. Can anyone assist?

comment:16 Changed 17 years ago by eric.broszeit@…

I got it working. My model ID was the same for the 4200HD, but the vendor ID is 1692.

Note: See TracTickets for help on using tickets.