Page 1 of 4 123 ... LastLast
Results 1 to 10 of 32

Thread: Earthsoft PT2 (Japanese ISDB-T/S Capture Card)

  1. #1
    Join Date
    Nov 2008
    Location
    Oita, Japan
    Beans
    429
    Distro
    Ubuntu

    Earthsoft PT2 (Japanese ISDB-T/S Capture Card)

    This is an update to my previous thread.

    I have managed to get the card working in Ubuntu 12.04.

    The process is a bit easier this time, though quite mendokusai (troublesome).


    Part one - Setup

    First of all, you're going to need the hardware:

    1 Earthsoft PT2 (although the process shouldn't be much different for pt1 or pt3)
    1 PCSC card reader (lots of companies sell these)
    1 B-CAS card (only available with a digital television, set-top box, or capture card; the RED one covers terrestrial and satellite broadcasting, the BLUE one only terrestrial, i don't know which color covers cable)
    1 Computer with enough CPU and/or GPU to decode the stream, and a monitor to watch it on (which is really beyond the scope of this tutorial).

    Install PCSC daemon, tools, and development files:
    Code:
    sudo apt-get install libccid libpcsclite-dev pcsc-tools pcscd
    The latest versions should be fine!
    Newer versions of these packages are dangerous and broken. Install the versions from Maverick:
    Code:
    mkdir pcsc-debs
    cd pcsd-debs
    wget http://launchpadlibrarian.net/35198253/libccid_1.3.11-1_amd64.deb
    wget http://launchpadlibrarian.net/70522546/libpcsclite-dev_1.5.5-3ubuntu2.1_amd64.deb
    wget http://launchpadlibrarian.net/70522551/libpcsclite1_1.5.5-3ubuntu2.1_amd64.deb
    wget http://launchpadlibrarian.net/70522552/pcscd_1.5.5-3ubuntu2.1_amd64.deb
    wget http://launchpadlibrarian.net/38659322/pcsc-tools_1.4.16-1_amd64.deb
    sudo dpkg -i *.deb
    cd ..
    Create apt-pins to keep them at those versions (in /etc/apt/preferences.d/pcsc)
    Code:
    Package: libccid
    Pin: version 1.3.11-1
    Pin-Priority: 1001
    
    Package: libpcsclite-dev
    Pin: version 1.5.5-3ubuntu2.1
    Pin-Priority: 1001
    
    Package: libpcsclite1
    Pin: version 1.5.5-3ubuntu2.1
    Pin-Priority: 1001
    
    Package: pcscd
    Pin: version 1.5.5-3ubuntu2.1
    Pin-Priority: 1001
    
    Package: pcsc-tools
    Pin: version 1.4.16-1
    Pin-Priority: 1001
    You will need mercurial to use the repository, autoconf and automake for one of the compiles:
    Code:
    sudo apt-get install mercurial autoconf automake
    Get the source code for "b25", an AIRB decryption program and library.
    Code:
    hg clone http://hg.honeyplanet.jp/pt1 b25
    Make and install b25
    Code:
    cd b25
    hg update b25
    cd arib25
    make
    make install
    cd ../..
    Get the source code for the PT2 Driver and recpt1, the capture program.
    Code:
    hg clone http://hg.honeyplanet.jp/pt1 PT2
    make and install the driver
    Code:
    cd PT2/driver
    make
    sudo make install 
    cd ../..
    make and install recpt1
    Code:
    cd PT2/recpt1
    ./autogen.sh
    ./configure --enable b25
    make
    sudo make install
    cd ../..
    Finally, blacklist the outdated (though functional) v4l-dvb pt1 driver ( in /etc/modprobe.d/blacklist-pt1):
    Code:
    blacklist earth_pt1
    This is a good time to reboot.

    Part 2 - Testing
    Important: If Ubuntu will not reboot after the above process, you probably have the new PCSC packages. They are seriously broken; the latest version of the PCSC driver will freeze udev if a USB PCSC card reader is attached at boot. Disconnect the device and use the power button to reboot; make sure to downgrade those packages.
    Also Important: Make sure everything is connected to the right connection, on, and functioning, particularly that something is connected to at least one of the PT2's 4 coaxial terminals (Sattelite1, Terrestrial1, Sattelite2, Terrestrial2).

    Find a working channel:
    Code:
    checksignal 0
    Keep increasing the number until you find one that works.

    Try to record 10 seconds of channel 14 (NHK in Oita; use a channel that's available in your region):
    Code:
    recpt1 --b25 --strip 14 10 test.ts
    If this says "Fall back to encrypted recording" then there's a problem with the PCSC card reader.
    Make sure the card is in the right way.
    Make sure it's connected to the PC properly.
    Make sure you installed the old pcsc packages.
    Check if it's working:
    Code:
    sudo pcsc_scan
    If it worked, but the file is 0 bytes, check the PCSC card reader anyway, reboot, and try again.
    If it worked, and the file is really a video (a high-definition MPEG-2 or MPEG-4 transport stream to be precise), play it with either mplayer or vlc (gstreamer, ie totem, is unlikely to work with this format)

    If it works, you are ready to watch and record as much Japanese TV as you like.

    Useful: You can output to stdout, pipe it through vlc/mplayer, and play stdin like this:
    Code:
    recpt1 --b25 --strip 14 10 - | mplayer -
    recpt1 --b25 --strip 14 10 - | vlc -
    To record or watch indefinetly, replace the timer with "-"
    Code:
    recpt1 --b25 --strip 14 - - | vlc -
    Take a look at
    Code:
    recpt1 --help
    recpt1ctl --help
    recpt1ctl is particularly useful for changing channels, BUT it's not that easy: different channels may be using different encodings.
    For example, in my area NHK broadcasts a particular type of MPEG-4 Transport Stream on two channels, but the local stations broadcast different MPEG-2 Transport Streams. So one can change channels between the NHK stations while watching the stream in either mplayer or vlc, but changing to any local station, from NHK or any other local station (and therefore suddenly changing the video encoding) will crash either player. Crashing on channel change is fixed in vlc-git!
    Last edited by quequotion; June 16th, 2014 at 05:48 PM. Reason: checksignal does not need "--channel" just "checksignal #"

  2. #2
    Join Date
    Nov 2008
    Location
    Oita, Japan
    Beans
    429
    Distro
    Ubuntu

    Re: Earthsoft PT2 (Japanese ISDB-T/S Capture Card)

    I wrote this script using cVLC's MPRIS dBus interface (to avoid on-screen controls). VLC surprised me by auto-magically integrating with the sound indicator. Apparently the sound indicator is listening for MPRIS.

    I set the different options to hotkeys so I can use my wireless keyboard as a remote control; better ideas are welcome. LIRC?

    [Super]+[Play/Pause] = digitv on
    [Super]+[up] = digitv chanup
    [Super]+[down] = digitv chandown

    Remote Control Script (in /usr/local/sbin/digitv):
    Code:
    #! /bin/bash
    # This script controls an Earthsoft PT-series capture card
    
    CHANNEL=`cat ~/.digitvrc`
    
    ONSTATE="`qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.CanQuit`" #If vlc can quit, then it is on.
    
    case "$1" in
    
        on) # Open or close PVR stream.
            if [ "$ONSTATE" == "true" ]; then
                qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Quit #If vlc is on, turn it off.
            else
                recpt1 --b25 --strip $CHANNEL - - | cvlc -I dbus --fullscreen - #Record stream to stdout, pipe to cvlc stdin
            fi
        ;;
    
    # This is a list of terrestrial broadcasting channels from my area.
    # This could be done better and, for longer channel lists, must be.
    
        chanup) # Raise channel
    
            case "$CHANNEL" in
    
                14)
                    CHANGE=15
                ;;
    
                15)
                    CHANGE=22
                ;;
    
                22)
                    CHANGE=32
                ;;
    
                32)
                    CHANGE=34
                ;;
    
                34)
                    CHANGE=14
                ;;
    
                *)
                    CHANGE=`cat ~/.digitvrc`
            esac
    
            echo $CHANGE > ~/.digitvrc #Save current channel
    
            if [ "$ONSTATE" == "true" ]; then
                qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Quit #If vlc is on, turn it off (just in case we are switching encodings)
                sleep 2
                recpt1 --b25 --strip $CHANNEL - - | cvlc -I dbus --fullscreen - #Record stream to stdout, pipe to cvlc stdin
            else
                exit 0;
            fi
        ;;
    
        chandown) # Lower channel
    
            case "$CHANNEL" in
    
                34)
                    CHANGE=32
                ;;
    
                32)
                    CHANGE=22
                ;;
    
                22)
                    CHANGE=15
                ;;
    
                15)
                    CHANGE=14
                ;;
    
                14)
                    CHANGE=34
                ;;
    
                *)
                    CHANGE=`cat ~/.digitvrc`
            esac
    
            echo $CHANGE > ~/.digitvrc
    
            if [ "$ONSTATE" == "true" ]; then
                qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Quit #If vlc is on, turn it off (just in case we are switching encodings)
                sleep 2
                recpt1 --b25 --strip $CHANGE - - | cvlc -I dbus --fullscreen - #Record stream to stdout, pipe to cvlc stdin
            else
                exit 0;
            fi
        ;;
    
        *) # Catch bad input.
            notify-send --icon=error --urgency=critical --expire-time=1000 "TV: Invalid input" "Tuner not initialized"
            exit 0;
        ;;
    
    esac
    
    exit 0;
    Don't forget to make it executable:
    Code:
    sudo chmod +x /usr/local/sbin/digitv
    Last edited by quequotion; September 8th, 2012 at 07:19 PM.

  3. #3
    Join Date
    Nov 2008
    Location
    Oita, Japan
    Beans
    429
    Distro
    Ubuntu

    Re: Earthsoft PT2 (Japanese ISDB-T/S Capture Card)

    I put together a rudimentary channel scanner:
    Code:
    #!/bin/bash
    
    for i in {0..62..1};  # 0 through 62, to check the Terrestrial Channels. You cold specify more if you have Satellite or Cable channels.
        do
            echo -e \\n$i >> ~/channels # channel number
            checksignal $i &>> ~/channels & # check frequency
            sleep 10 # this isn't enough time for a thorough scan, but picks up significantly strong signals.
            killall checksignal 
        done

  4. #4
    Join Date
    Nov 2008
    Location
    Oita, Japan
    Beans
    429
    Distro
    Ubuntu

    Re: Earthsoft PT2 (Japanese ISDB-T/S Capture Card)

    TV is working very well with this setup:

    Chipset: Z68
    CPU: Core I7 2770k, oc ~4.8GHz
    GPU: GeForce GT 220, oc 700MHz clock and 900MHz memclock
    SPU: SB Live! Audigy Value! 5.1, Analog 5.1 output.
    Proprietary drivers for nVidia: 304.43
    Kernel: 3.5.0-8-generic (#8-Ubuntu SMP Sat Aug 4 06:44:57 UTC 2012) AMD64
    cVLC: 2.0.4 Twoflower (revision 2.0.3+git20120908+r378)
    libva-driver-vdpau: 0.7.4.pre1-1
    libva1: 1.015-4

  5. #5
    Join Date
    Nov 2008
    Location
    Oita, Japan
    Beans
    429
    Distro
    Ubuntu

    Re: Earthsoft PT2 (Japanese ISDB-T/S Capture Card)

    Improvements to the controller script (in /usr/local/sbin/digitv):
    Code:
    #! /bin/bash
    # This script contols an Earthsoft PT-series ISDB-T/S capture card
    
    CHANNEL=`cat ~/.digitvrc` #Get last channel
    
    ONSTATE="`qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.CanQuit`" #Is the stream already on?
    
    case "$1" in
    
        on)  #Initiate OR terminate video stream.
            if [ "$ONSTATE" == "true" ]; then
                qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Quit
                notify-send --icon=video-display-symbolic --urgency=critical --expire-time=700 "TV: OFF"
            else
                notify-send --icon=video-display-symbolic --urgency=critical --expire-time=700 "TV: ON" "CH: $CHANNEL" &
                recpt1 --b25 --strip $CHANNEL - - | cvlc -I dbus --fullscreen - &
            fi
        ;;
    
    # This is a list of terrestrial broadcasting channels from my area. # This could be done better and, for longer channel lists, must be.
    
        chanup) # Raise channel
    
            case "$CHANNEL" in
    
                14)
                    CHANNEL=15
                ;;
    
                15)
                    CHANNEL=22
                ;;
    
                22)
                    CHANNEL=32
                ;;
    
                32)
                    CHANNEL=34
                ;;
    
                34)
                    CHANNEL=14
                ;;
    
                *)
                    notify-send --icon=error --urgency=critical --expire-time=1000 "TV: Invalid channel" "Dial reset"
                    CHANNEL=14
                ;;
            esac
    
            if [ "$ONSTATE" == "true" ]; then
                qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Quit 
                notify-send --icon=video-display-symbolic --urgency=critical --expire-time=700 "TV: CH+" "CH: $CHANNEL"
                echo $CHANNEL > ~/.digitvrc
                recpt1 --b25 --strip $CHANNEL - - | cvlc -I dbus --fullscreen - &
            fi
        ;;
    
        chandown) # Lower channel
    
            case "$CHANNEL" in
    
                34)
                    CHANNEL=32
                ;;
    
                32)
                    CHANNEL=22
                ;;
    
                22)
                    CHANNEL=15
                ;;
    
                15)
                    CHANNEL=14
                ;;
    
                14)
                    CHANNEL=34
                ;;
    
                *)
                    notify-send --icon=error --urgency=critical --expire-time=1000 "TV: Invalid channel" "Dial reset"
                    CHANNEL=14
                ;;
            esac
    
            if [ "$ONSTATE" == "true" ]; then
                qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Quit 
                notify-send --icon=video-display-symbolic --urgency=critical --expire-time=700 "TV: CH-" "CH: $CHANNEL"
                echo $CHANNEL > ~/.digitvrc
                recpt1 --b25 --strip $CHANNEL - - | cvlc -I dbus --fullscreen - &
            fi
        ;;
    
        *) # Catch bad input.
            notify-send --icon=error --urgency=critical --expire-time=1000 "TV: Invalid input"
        ;;
    
    esac
    
    exit 0;
    I've fixed a few logic errors in the chanup and chandown algorithms, pulled out the sleeps, and added a couple of notify-osd popups. This feels more interactive, changes channels faster, and handles a few oddities better--like when a channel has stopped broadcasting.

    I'd still like to streamline this a bit more and add a few features. In particular:

    1. Check if channels are using the same encoding before changing channels. If they are, then recpt1ctl could be used for a smoother, faster change. Alternatively, if vlc could somehow handle sudden encoding changes, if that is even possible, recpt1ctl could do all channel changes.

    2. A more precise method to find ONSTATE; as in checking if the card is currently streaming video.

    3. Consolidate the on switch and channel change stream activations. Basically the same thing is going on here, except that the initial activation doesn't need to save the channel and the channel change requires some delay or the stream will break.

    4. Actually say something if a channel is not broadcasting, rather than just leaving the screen blank.

    5. Add a stream & record function. VLC can record a playing video stream, but the MPRIS specification doesn't include a "record" function.

    6. Translate the script and this entire thread into Japanese. It's very likely the number of English-speaking people using these cards can be counted on one hand.
    Last edited by quequotion; September 19th, 2012 at 07:09 PM.

  6. #6
    Join Date
    Nov 2008
    Location
    Oita, Japan
    Beans
    429
    Distro
    Ubuntu

    Re: Earthsoft PT2 (Japanese ISDB-T/S Capture Card)

    Outstanding issues:

    1. Attempting to watch a program with bilingual audio in VLC, I ran into:
    Code:
    Multiple blocks per frame in ADTS not supported
    Patches for this are available and on their way into git. In the mean time take a look at this VLC forum thread for nkoriyama's patches and pre-built binaries.
    Bilingual audio works and can be selected from vlc's right-click menu under Audio-> Audio Channels-> Stereo (simultaneous bilingual), Left (Japanese), Right (native language).

    2. Sometimes while changing channels using the script above (digitv chanup / chandown), the arib25 library and pcsc card reader stop working together.
    I suspect that some channels use different encryption or occasionally change encryption and the pcsc card reader is still decrypting for the previous algorithm. This should not be happening, since I've already terminated the stream once and restarted it. The solution for now, when changing to an affected channel, is to restart again, (digitv on, digitv on). I'm going to try again with pcsc-lite 1.8.5 from quantal.
    -Good news / Bad news: Bad first, 1.8.5 doesn't solve this problem. The good news is that 1.8.5 seems safe to use, so perhaps Quantal will have functional pcsc card support. Or maybe not. libccid 1.4.7-1 (quantal) is broken.
    Last edited by quequotion; September 25th, 2012 at 10:53 AM. Reason: seems quantal's libccid doesn't support my card reader

  7. #7
    Join Date
    Nov 2008
    Location
    Oita, Japan
    Beans
    429
    Distro
    Ubuntu

    Re: Earthsoft PT2 (Japanese ISDB-T/S Capture Card)

    I've updated the control script again.

    Big changes:

    -using recpt1ctl to change channels: This is in fact the proper way, but changing to or from certain channels is crashing both vlc and mplayer. I suspect that they are using different encodings and suddenly switching them confuses the video player.

    -vlc configured to always have the dbus interface available: This puts vlc into the indicator-sound menu, under rhythmbox, permanently and means it isn't necessary to explicitly create dbus interfaces in the script.

    Code:
    #! /bin/bash
    # This script contols an Earthsoft PT-series ISDB-T/S capture card
    
    CHANNEL=`cat ~/.digitvrc`
    
    case "$1" in
    
        on) # Open or close PVR stream.
            if [ "`qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.CanQuit`" == "true" ]; then
                qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Quit &
                notify-send --icon=video-display-symbolic --urgency=critical --expire-time=700 "TV: OFF" &
            else
                notify-send --icon=video-display-symbolic --urgency=critical --expire-time=700 "TV: ON" "CH: $CHANNEL" &
                recpt1 --b25 --strip $CHANNEL - - | vlc --fullscreen - &
            fi
        ;;
    
        chanup) # Raise channel
    
            case "$CHANNEL" in
    
                14)
                    CHANNEL=15
                ;;
    
                15)
                    CHANNEL=22
                ;;
    
                22)
                    CHANNEL=32
                ;;
    
                32)
                    CHANNEL=34
                ;;
    
                34)
                    CHANNEL=14
                ;;
    
                *)
                    notify-send --icon=error --urgency=critical --expire-time=1000 "TV: Invalid channel" "Dial reset" &
                    CHANNEL=14
                ;;
    
            esac
    
            echo $CHANNEL > ~/.digitvrc &
            notify-send --icon=video-display-symbolic --urgency=critical --expire-time=700 "TV: CH+" "CH: $CHANNEL" &
            if [ "`pgrep recpt1`" -gt 0 ]; then
                recpt1ctl --pid "`pgrep recpt1`" --channel $CHANNEL &
            fi
    
            sleep 8 # VLC takes 8 seconds to crash, for me
    
            if [ "`qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.CanQuit 2>&1 >/dev/null`" == "Service 'org.mpris.MediaPlayer2.vlc' does not exist." ]; then
                # Removed section A
                recpt1 --b25 --strip $CHANNEL - - | vlc --fullscreen - &
            fi
        ;;
    
        chandown) # Lower channel
    
            case "$CHANNEL" in
    
                34)
                    CHANNEL=32
                ;;
    
                32)
                    CHANNEL=22
                ;;
    
                22)
                    CHANNEL=15
                ;;
    
                15)
                    CHANNEL=14
                ;;
    
                14)
                    CHANNEL=34
                ;;
    
                *)
                    notify-send --icon=error --urgency=critical --expire-time=1000 "TV: Invalid channel" "Dial reset"
                    CHANNEL=14
                ;;
    
            esac
    
            echo $CHANNEL > ~/.digitvrc &
            notify-send --icon=video-display-symbolic --urgency=critical --expire-time=700 "TV: CH-" "CH: $CHANNEL" &
            if [ "`pgrep recpt1`" -gt 0 ]; then
                recpt1ctl --pid "`pgrep recpt1`" --channel $CHANNEL &
            fi
    
            sleep 8 # VLC takes 8 seconds to crash, for me
    
            if [ "`qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.CanQuit 2>&1 >/dev/null`" == "Service 'org.mpris.MediaPlayer2.vlc' does not exist." ]; then
                # Removed Section B
                recpt1 --b25 --strip $CHANNEL - - | vlc --fullscreen - &
            fi
        ;;
    
        *) # Catch bad input.
            notify-send --icon=error --urgency=critical --expire-time=1000 "TV: Invalid input" &
        ;;
    
    esac
    
    exit 0;
    There were two new parts that I removed. These sections are nearly identical and do the same thing: check if a channel is broadcasting before changing to it. This is poorly implemented, takes as long as changing a channel twice, and sometimes gives false errors that a channel is unavailable. Without these sections, the expected behavior when a channel is not broadcasting is the channel will not change, but no message is output to express what has happened.

    Removed section A
    Code:
    #qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Quit
                 #if [ "`recpt1 --b25 --strip $CHANNEL 0 /dev/null 2>&1  >/dev/null | grep channel`" == "Cannot tune to the specified channel"  ]; then
                    #notify-send --icon=error --urgency=critical --expire-time=1000 "TV: CH+" "CH: $CHANNEL Unavailable" &
                #fi #this is so slow
                #sleep 1
    Removed section B
    Code:
    #qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Quit 
                 #if [ "`recpt1 --b25 --strip $CHANNEL 0 /dev/null 2>&1  >/dev/null | grep channel`" == "Cannot tune to the specified channel"  ]; then
                    #notify-send --icon=error --urgency=critical --expire-time=1000 "TV: CH-" "CH: $CHANNEL Unavailable" &
                    
                #fi #this is so slow
                #sleep 1
    Last edited by quequotion; October 26th, 2012 at 03:18 AM.

  8. #8
    Join Date
    May 2008
    Location
    東京
    Beans
    142
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Earthsoft PT2 (Japanese ISDB-T/S Capture Card)

    Hi quequotion,

    Just wanted to say thanks for your awesome writeup. I currently have an Ubuntu 12.04/XMBC htpc that we've been using, and I really want to add an ISDB-T tuner to it. I've heard that the PT2s have a DVB-like driver that mimics the US standard, but I don't know much more than that. Any recommendations on how to get started?

    -Ben

  9. #9
    Join Date
    Nov 2008
    Location
    Oita, Japan
    Beans
    429
    Distro
    Ubuntu

    Re: Earthsoft PT2 (Japanese ISDB-T/S Capture Card)

    Quote Originally Posted by benmoran View Post
    Hi quequotion,

    Just wanted to say thanks for your awesome writeup. I currently have an Ubuntu 12.04/XMBC htpc that we've been using, and I really want to add an ISDB-T tuner to it. I've heard that the PT2s have a DVB-like driver that mimics the US standard, but I don't know much more than that. Any recommendations on how to get started?

    -Ben
    Hello benmoran!

    If you can read Japanese, Google some guides by searching "アースソフトPT1 Ubuntu" (minus quotes). Unfortunately most of these guides are out of date and/or incomplete.

    There is a DVB driver included in the kernel (earth-pt1), but it's not been updated as recently as the honeyplanet driver (pt1-drv). How technologically similar either driver is to the US standard I don't really know. All the Japanese guides I can find recommend to blacklist the kernel driver and use the honeyplanet driver instead.

    If you're looking for tips on getting set up, this thread has most of what you need to know on the software side. The most difficult part is not the system setup, but acquiring the hardware. Not many shops are selling the PT-series cards, but they are available online. Unfortunately, they don't come with a B-CAS card, and the cards are not for individual sale, so you have to buy a separate device that includes one.

    This is actually a lot of trouble to go to just for watching TV, but that's only one of several uses for the PT-series cards. These cards can be used to record to disk and/or stream high-definition television through your PC without the need to re-encode the original transmission. This means your PC can be a DVR, a webcasting server, or both with zero quality loss.

  10. #10
    Join Date
    Nov 2008
    Location
    Oita, Japan
    Beans
    429
    Distro
    Ubuntu

    Re: Earthsoft PT2 (Japanese ISDB-T/S Capture Card)

    New and very much improved control script!
    Code:
    #! /bin/bash
    # This script contols an Earthsoft PT-series ISDB-T/S capture card.
    
    if [ ! -f ~/.digitvrc ]; then # True when no config file exists (first run).
        echo 14 > ~/.digitvrc # Create config file.
    fi
    
    CHANNEL=`cat ~/.digitvrc` # Set channel from config file (resume from last).
    
    case "$1" in
    
        on) # ON/OFF
            if [ -n "`pgrep recpt1`" ]; then # True when recpt1 is running.
                kill "`pgrep recpt1`" "`pgrep vlc`" & # Just in case, kill both.
                notify-send --icon=video-display-symbolic --urgency=critical --expire-time=700 "TV: OFF" &
            else
                notify-send --icon=video-display-symbolic --urgency=critical --expire-time=700 "TV: ON" "CH: $CHANNEL" &
                recpt1 --b25 --strip $CHANNEL - - | vlc --fullscreen - & # Watch TV in vlc.
            fi
        ;;
    
        chanup|chandown) # CH+ & CH-
    
            if [ -n "`pgrep recpt1`" ]; then # True when recpt1 is running.
    
                case "$1" in
    
                    chanup) # CH+
    
                        case "$CHANNEL" in # This part needs simplification. TODO: Channel names
    
                            14)
                                CHANNEL=15
                            ;;
    
                            15)
                                CHANNEL=22
                            ;;
    
                            22)
                                CHANNEL=32
                            ;;
    
                            32)
                                CHANNEL=34
                            ;;
    
                            34)
                                CHANNEL=14
                            ;;
    
                            *) # Catch bad input.
                                CHANNEL=14
                                notify-send --icon=error --urgency=critical --expire-time=1000 "TV: Invalid CH" "CH: $CHANNEL" &
                            ;;
                        esac
    
                        notify-send --icon=video-display-symbolic --urgency=critical --expire-time=700 "TV: CH+" "CH: $CHANNEL" &
    
                    ;;
    
                    chandown) # CH-
    
                        case "$CHANNEL" in # This part needs simplification. TODO: Channel names
    
                            34)
                                CHANNEL=32
                            ;;
    
                            32)
                                CHANNEL=22
                            ;;
    
                            22)
                                CHANNEL=15
                            ;;
    
                            15)
                                CHANNEL=14
                            ;;
    
                            14)
                                CHANNEL=34
                            ;;
    
                            *)
                                CHANNEL=14
                                notify-send --icon=error --urgency=critical --expire-time=1000 "TV: Invalid CH" "CH: $CHANNEL" &
                            ;;
                        esac
    
                        notify-send --icon=video-display-symbolic --urgency=critical --expire-time=700 "TV: CH-" "CH: $CHANNEL" &
    
                    ;;
                esac
    
                echo $CHANNEL > ~/.digitvrc & # Save channel to config file.
                recpt1ctl --pid "`pgrep recpt1`" --channel $CHANNEL & # Change channel.
                sleep 2 # Wait to see if channel change crashed VLC.
    
                if [ -z "`ps \"\`pgrep vlc\`\" 2>/dev/null | grep Sl`" ]; then # True when vlc's STAT is not Sl or vlc is not running (crashed)
                    kill "`pgrep recpt1`" "`pgrep vlc`" & # Just in case, kill both.
                    notify-send --icon=video-display-symbolic --urgency=critical --expire-time=1000 "TV: Crashed, Resume" "CH: $CHANNEL" &
                    sleep 2 # Wait for ??? (sometimes recpt1 cannot resume quickly).
                    recpt1 --b25 --strip $CHANNEL - - | vlc --fullscreen - & # Watch TV in vlc.
                fi
            fi
    
        ;;
    
        *) # Catch bad input.
            notify-send --icon=error --urgency=critical --expire-time=1000 "TV: Invalid input" &
        ;;
    
    esac
    
    exit 0;
    Functionality has not changed. This script provides just three commands:
    digitv on - an ON/OFF switch
    digitv chanup - a CH+ button
    digitv chandown - a CH- button

    These can be run from the terminal, or configured to some hotkeys or actual remote control buttons if your computer supports one. I set them to Super+Play, Super+Up, and Super+Down respectively.

    Big changes:
    -No more dbus interface as it proved insufficient and unnecessary for this purpose.

    Fixed bugs
    :
    -Automatically create config file on first run (since a channel must be specified to start watching) and subsequently recreate it if ever deleted.
    -Changing channels when not watching TV does nothing (like a real tv; the previous script allowed the channel buttons to act as ON switches as well).
    -Faster channel changing after crashes (certain channels may still crash vlc on change).
    -Put in lots more comments to make everything make sense.

    TODO:
    -Portability: Make it easier to use another video player (currently only vlc and mplayer have full support) by adding this to the config file.
    -Channels: Replace "case" lists with something more simple and more smooth, try to integrate channel scanning, and provide the names of channels.
    -Translation: Into Japanese, because I can still count on one hand the number of native English speakers discussing these cards on the internet.
    Last edited by quequotion; December 5th, 2012 at 09:59 AM. Reason: sleep 2 before resuming after crash.. don't know why it's necessary.

Page 1 of 4 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •