essb/tasnet

A small utility to interact with the Tascam MD4K blu-ray player over TCP.

v0.4 2024-06-26 19:43 UTC

This package is auto-updated.

Last update: 2024-10-26 20:32:34 UTC


README

Control Tascam MP4K Bluray players over TCP network

A PHP library for communicating with the Tascam MP4K BluRay/DVD players. These players are workhorse units loved by theatres and A/V consultants.

This project is "just a bit more than enough to get the job done" . If I have time I will clean it up into a proper (and full implementation) library with a cli interface and IPC like server for instant and continuous queries.

Install

Composer

The easiest way to install Tasnet is by using composer:

composer global require essb/tasnet

Alternatively you can clone wherever is handy, and bestow execution privileges:

git clone https://git.sbcloud.cc/sb/tasnet.git

cd tasnet && chmod +x tasnet.php

If your PHP version is less than 8, you can strip function return types and the program will still work just fine.

Configuration

On first run it will ask for your projector's IP, and generate a data.json. You can then edit in your favourite text editor vim anytime you like!

Tasnet will attempt to discover the MAC address of the projector for you, but if you know it you can enter it manualy.

Make executable

Optionally you can make Tasnet executable, and rename it:

mv tasnet.php tasnet && chmod +x tasnet

Then you may call it just like an application:

./tasnet send play

Example:

{
    "ip": "192.168.1.10",
    "mac": "0D:E1:00:A0:7B",
    "broadcast": "192.168.1.255"
}

MacOS

Prior to v0.4, if on macOS you probably need to change the arp command flag from -a to -n.

tasnet.php Line 236:

   /**
     * Scooch the MAC out of the IP
     * @param string $ip the target IP
     */
    private function getRemoteMacAddr(string $ip): string
    {
        return strtoupper(exec("arp -n " . $ip . " | awk '{print $4 }'"));
    }

Configure

Setting the IP will allow communication with the device. For best results set a static IP on your unit.

php tasnet.php set ip 127.0.0.2

These parametres will be inferred and probably don't need to be manually added.

php tasnet.php set mac 00:03:ED:0F:BB

php tasnet.php set broadcast 10.10.10.255

Usage

Send a power on

php tasnet.php send on

Send Play

php tasnet.php send play

List of available commands

php tasnet.php send [command]

  • on/off
  • open/close
  • play/pause/stop
  • show_menu/hide_menu
  • next_track/prev_track
  • time_disc_elapsed
  • time_disc_remain
  • time_track_elapsed
  • time_track_remain
  • autoplay on/off/repeat

Power on feature

The on command is different from the other commands in that it uses a standard Wake-on-LAN message to turn on over UDP.

TODO

  • Implement the rest of the available commands
  • TCP implementation is pretty inefficent, and the connection should be made static.