Posts

Showing posts from March, 2026

Plan 9: Network Printer (HP Deskjet Ink Advantage 3545)

Image
Internet Printing Protocol Printing with  Internet Printing Protocol (IPP)  involves sending a Unirast   Format (URF) image with appropriate protocol headers to port 631. It is the basis for standards like  Windows Mopria Alliance , Apple   AirPrint , and IPP Everywhere .  It is also called  Driverless Printing   since this doesn't involve installing any printer specific driver. On Plan 9, printing involves three steps: Convert the document to PDF using lp Convert the PDF to URF using  gs  (use urfgray, urfrgb or urfcmyk device) Send the request to the printer using hget IPP header ( req.bin in the below script) contains page output options like paper size, margins etc. This is generated   using ippenc.c .        #!/bin/rc HOST=$1 FILE=$2 TFILE=/tmp/a.pdf URL=( http://$HOST:631/ipp/print/ ) if (! ~ $#* 2)    echo 'Usage: $0 <printer-ip> <file>'     lp -d stdout $FILE > $TFILE...

Plan 9: Audio-Video Pipeline

Image
Video pipeline in action Two important points about videos: A video is a series of images. RGB format is used for display. YUV format is used for storage and transmission.  Recording   ──────────────────────────────────────────────────────── [Video Source] → [Frame Processing] → [Video Encode] ┐                                                                                                      ├→ [Mux] → [Container Stream] [Audio Source] → [Audio Processing] → [Audio Encode] ┘ Playback   ──────────────────────────────────────────────────────── [Container Stream] → [Demux] → [Video Decode] → [Video Sink]                                   ...