Changelog for Snowmix

Updated for version 0.5.2

Introduction

This document tracks changes to the functionality of Snowmix and its accompanying scripts and files.

Changelog for older versions are availble here:

Changelog for Snowmix 0.5.2

Top
               

New Commands/Functionality - audio


  • The command "audio sink tcp" can be used to connect an audio sink to either a remote or local Snowmix audio feed or a TCP listener. The syntax for the command is:

    audio sink tcp [<sink id> [<ip address> <port> [<prepend string>]]]

  • Adding the new command "audio sink fadefactor" to control how much the RMS value for a sink is reduced by at frame rate. The default value is 0.95. The syntax is:

    audio sink fadefactor [<audio sink id> <factor>]

  • Adding new command 'audio feed close' to force closing a control connection connected to the audio feed, if any. It is an error to close an audio feed that has no control connection connected to it. Closing an audio feed will flush its buffers and change the state of the audio feed to disconnected if it was in a state of pending, running or stalled. An external process connected to the audio feed, may choose to connect again asap. The command offers a way from Snowmix to tell an external connecting process to possibly restart and reconnect. The syntax is:

    audio feed close <audio feed id>

  • Until this version, the RMS value(s) for an audio sink would be updated with the RMS value for an audio buffer it received, if the RMS value of the buffer was greater than the RMS value for the audio sink, otherwise it would not. Then at framerate, the RMS value for the audio sink would be reduced with 5% (multiplied with with 0.95). This created a form for slow fading down for the RMS value shown graphically in snowaudio.tcl. From version 0.5.2, the same applies, but the RMS value(s) of the sink is at frame rate only reduced if the last buffer buffer had an RMS value less than the current. The comparison of this is done on a per channel basis, so if say left channel last buffer had and RMS value that was greater, than the sinks RMS for that channel, it will not reduce the RMS value at next frame. At the same time the right channel may have had and RMS value for the buffer less than the sinks RMS value for the right channel annd as such not the buffer value was not used for updating the sinks right channel RMS value, but the right channels RMS value will then be reduced.


New Commands/Functionality - bgworker

Top

  • Adding a new framework named BgWorker. The framework can be used to create additional threads named BgWorkers, that will wait for commands and perform the task in the background and then wait for new commands. By default one BgWorker is created. More BgWorkers can be created upon need.

  • Adding new command *bg info* to list informaton regarding BgWorkers. The syntax is:

    bg info The output of the command will look similar to this:

    STAT: bg workers info STAT: verbose level : 0 STAT: workers : 1 STAT: worker seqno : 1 STAT: message count : 0 STAT: fill outframe : 2 (Orc memset - from fill value ) STAT: fill value : 0xff000000 STAT:

  • Adding new command *bg help* to list help available for the BgWorker class. The syntax is:

    bg help [fill] Adding the keyword fill to the help command will make Snowmix list the settings available for the *bg fill* command. The output of the *bg help* command will look similar to this:

    STAT: Commands: STAT: bg add STAT: bg del STAT: bg fill [ ( | value [ ]) ] STAT: bg help [fill] STAT: bg info STAT: bg verbose [] STAT:

  • Adding new command *bg verbose* to set the verbose level for the BgWorker class. The syntax is:

    bg verbose [<level>]

  • Adding new command *bg add* to add additional BgWorkers. Each time the command is issued, an additional BgWorker thread is created. The syntax is:

    bg add

  • Adding new command *bg delete* to delete a BgWorker thread. Issuing the command a BgWorker thread will be terminated until there is only one BgWorker thread left. The syntax is:

    bg delete

  • Adding new command *bg fill* to set how new empty frames are filled before being used as the system mixer frames of Snowmix. From this version, preparing a frame for mixing is taken care of by a BgWorker in a thread independent from Snowmix main mixing thread. The syntax is:

    bg fill [ (<mode> | value [ <fill value in hexadecimal> ]) ] By default the fill mode is 2 (memset using Orc acceleration). The default value for the memset is 0xff000000. The command *help fill* will list the possible settings similar to this:

    STAT: bg fill mode for new output frames: STAT: 0 : no fill STAT: 1 : using memcpy of feed 0 STAT: 2 : using Orc accelerated memset and fill value STAT: 3 : using Orc accelerated memcpy of feed 0 STAT:

New Commands/Functionality - command

Top

  • Command 'command addatline' can now take negative number counting from the last line. So a line number of -1 means the second last line, -2 means the third last line etc. The syntax is now:

    command addatline <command name> [-]<line number> <command>

New Commands/Functionality - feed

Top

  • Adding new command "feed onchange state" that will enable automatic execution of a snowmix command when indicated video feeds change state. The syntax is:

    feed onchange state [-1 | (<feed no> [<snowmix command>])] Used without arguments, the argument -1 or the argument being a valid feed number, the command will list the snowmix command set for

    no args : general command set for all feed stae changes -1 : commands set for all feed changes for specific feeds feed no : command set for all feed changes for the specific feed On feed changes, if a command has been set for the specific feed or for all feeds, the command will, if it exists, be appended the feed number and previous and current state and parsed to be executed. This cannot be used to call a Snowmix command macro, but it can be used to execute the "messagec" command or call a function/procedure in tcl or python interpreter. Example:

    feed onchange state 1 messagec 0 feed will upon feed state change from DISCONNECTED to RUNNING produce this on the console:

    MSG: feed 1 DISCONNECTED RUNNING Below is an example for using it with tcl:

    feed onchange state 1 tcl eval FeedChangedState On state change for feed 1 from DISCONNECTED to RUNNING, the following command will be executed:

    tcl eval FeedChangedState 1 DISCONNECTED RUNNING If the procedure/function FeedChangeState has been defined correctly, this can be used to Snowmix to do whatever is desired when a feed state is changed.

  • Adding new commands "feed chroma" for making green screen with Snowmix. The syntax of the new commands are:

    feed chroma angle [<feed no> [<angle>]] feed chroma color [<feed no> [[<red> <green> <blue>] [<alpha>]]] feed chroma info [<feed no>] feed chroma key [<feed no> [(color | sapshot)]] feed chroma level [<feed no> [(black | noise | white) [<level>]]] feed chroma snapshot [<feed no> [take]] feed chroma state [<feed no> [(enable|true|on|1) | (disable|false|off|0)] feed chroma table [<feed no> [(bt601 | bt709 | custom | list)]] feed chroma threads [<feed no> [<no threads>]]

  • Adding new command "feed flip" to flip feed vertically and/or horizontally. The syntax is:

    feed flip [<feed id> [(no | false | 0 | vertically | horizontally | both)]] The abbreviation "ver" and "hor" can be used for vertically respectively horizontally. If a feed is flipped vertically and a shape macro using the feed is placed, the feed is flipped vertically. If vertical flipping is also specified for the feed in the shape macro, the result is no flipping as 2 times vertical flipping cancels out flipping vertically.

  • Adding new command "feed status" to print feed status to control connection. The syntax is:

    feed status The command may be shorten to "feed sta".

  • The command "feed list verbose" will now also print the control socket fd for the feed, the shm name and the shm fd.

  • Changing command *feed shift* and *feed cutout* to *feed coor* and *feed clip* respectivly to align with similar commands for vfeeds, images, shapes etc. The syntax stays the same with slightly different wording. The commands *feed shift* and *feed cutout* will stay in the 0.5.x versions, but they will be announced as EndOfLife. So don't write new scripts using the old commands. Use *feed coor* and *feed clip*. The syntaxes are:

    feed coor <feed id> <x> <y> feed clip <feed id> <x> <y> <width> <height>

  • Adding new command "feed keeplast" to keep or maintain the last frame received for a feed that disconnected. The syntax is:

    feed keeplast [<feed id> [<timeout in frames>]]

  • You can now set a loaded image as the idle image of a feed. This mean that you can now load a PNG image and use it as the idle image for a feed. As a side effect, you can draw/compose an image in the main mixer frame, copy it to a loaded image id and if desired, use it later as idle image for a feed. The syntax is:

    feed idle <feed no> <timeout in frames> [(<raw image file name> | <loaded image id>)] If the loaded image does not exist, or the loaded image geometry does not match the geometry of the feed, Snowmix will default to try loading a raw image from a file name <loaded image id> using search path.

  • Snowmix will now cache an 'feed idle' frame image (raw RGBA/BGRA) file and reuse the then loaded data, if another 'feed idle' command uses an already loaded frame. Before, each feed would load its own file into its own memory area possibly leading to loading and storing in memory identical files. This is an enhancement.

  • Adding new command 'feed format'. The command is used to set the pixel format of the feed. Default format is system format defined at compile time (RGBA or BGRA). A feed format can be one of either I420, Y42B, RGBA or BGRA. I420 is YUV planar 4:2:0. YUV is the color model with one luminans value and two chroma values. Y42B is YUV planar 4:2:2. Y444 is planar 4:4:4. RGBA and BGRA are 32 bit with the 8 bits value in the byte order R,G,B,A and B,G,R,A respectively independently of "Little Endian" and "Big Endian". Note that Snowmix defines RGBA as stream order as one byte of red, followed by one byte of green followed by one byte of blue followed by one byte of alpha. Note that some systems and software defines RGBA as a 32 bit integer. On such systems, if the hardware is little endian, what they define as RGBA, is stored in memory in the order A,B,G,R, which is what Snowmix defines as ABGR. The syntax for the command is:

    feed format [<feed id> [(I420 | Y42B | Y444 | RGBA | BGRA)]] Conversion from YUV to RGBA/BGRA will happen in an indepedent thread. As a side effect, the converted frame may in some cases be one frame period delayed. However frame conversion is done asynchronously indepedently from the steady frame period of the mixer frame, so in the most cases, the delay may not be relevant.

  • The command "feed list verbose" will now also print a line with the format of the feed. Possible formats are RGBA, BGRA, I420 and Y42B.

  • The command "feed info" will now print the format for the feed. Before version 0.5.2, the command could print something similar to this:

    STAT: feed id : state islive oneshot geometry cutstart cutsize offset fifo good missed dropped <name> STAT: feed 0 : STALLED recorded continuously 1280x720 0,0 1280x720 0,0 0:0 0 0 0 <Internal> STAT: feed 1 : PENDING live continuously 1280x720 0,0 1280x720 0,0 0:10 0 85 0 <Feed #1> It will now print something similar to this:

    STAT: feed id : state islive oneshot format geometry cutstart cutsize offset fifo good missed dropped <name> STAT: feed 0 : STALLED recorded continuously RGBA 1280x720 0,0 1280x720 0,0 0:0 0 0 0 <Internal> STAT: feed 1 : PENDING live continuously RGBA 1280x720 0,0 1280x720 0,0 0:10 0 85 0 <Feed #1> The tcl command "snowmix feed info geometry ..." will also print the format name for the feed. The default format is either RGBA or BGRA depending on compiler options set at compile time.

New Commands/Functionality - glshape

Top

  • Adding new command "glshape cullface". The command is equivalent to OpenGL glCullface(). The syntax is:

    glshape cullface <glshape id> <cullmode> The new command "glshape help cullmode" can be used to list valid arguments for cullmode.

  • Adding new command "glshape drawarray" to from within a shape draw/render primitives from a defined array. The syntax is:

    glashape drawarray <glshape id> <array_mode> <first> <count> The new command "glshape help array_mode" will list available options for the <array_mode> argument. The equivalent OpenGL function is glDrawArrays(). Se more on glDrawArrays() here https://registry.khronos.org/OpenGL-Refpages/gl4/html/glDrawArrays.xhtml

  • Adding new command "glshape client" to enable or disable client state in a shape. The syntax for the command is:

    glshape client <glshape id> (enable | disable>) <client_state> The new command "glshape help client_state" will list available arguments for the <client_state> in the "glshape client" command. The equivalent OpenGL function is glEnableClientState(). Se more on glEnableClientState() here https://registry.khronos.org/OpenGL-Refpages/gl2.1/xhtml/glEnableClientState.xml

  • Adding new optional parameter to command "glshape list". The syntax is now:

    glshape list [<glshape id> [comments]] If the the option "comments" is present, the listing will include comments for individual shape entries if such a comments where added while created. And example of this could be:

    gl add 1 my shape gl noop 1 # This is my comment to the command noop gl list 1 STAT: shape 1 ops 1 name my shape STAT: - 1 noop STAT: gl list 1 comm STAT: shape 1 ops 1 name my shape STAT: - 1 noop # This is my comment to the command noop STAT: Here the part "# This is my comment to the command noop" is the comment. Comment part is recognized as the text following '#' in a glshape command. A few glshape commands may not accept comments. Please report when found. Commands including defining a name does not recognize the '#' as a mark of a comment but rather sees it as part of the name. And example would be

    glshape add 1 This is my name # yes it is Here the name will be "This is my name # yes it is".

  • Adding new command "glshape array modify" to modify one or more entry values in a created array. This is significantly faster than deleting the array and creating it again with changed values. The syntax is somewhat similar to the glshape modify command. The syntax is:

    glshape array modify <array id> <no>[,<no...] <value> [<value> ...] Note that entry numbers (no) are separated by commas and values are separated by spaces. The command can be shorten to "gl arr mod".

  • Adding the new command "glshape modify" to on the fly change individual values for an an entry in a glshape macro. The syntax is:

    glshape modify <glshape id> <entry id> <no>[,<no>...] <value> [<values>...] The parameter is the entry line number in the glshape macro that is to have one or more of its values changed. You do not change the entry type with this command, but rather the values of the entry. If glshape macro 15 has an entry with four values a, b, c and d in line 7 and you wish to change b and d, the command would be:

    glshape modify 15 7 2,4 9.001 11.05

  • The new command 'glshape help modify' will list the glshape macro entries that can be changed using 'glshape modify'. The list will depend on the hardware and version of OpenGL library linked with Snowmix at compile time. Below is an example of how it can look:

    glshape help modify MSG: List of glshape elements where its parameters can be changed with the modify command: MSG: : arcxz , arcyz , arcxy , clearcolor , color3 MSG: : color4 , gluperspective , frustum , normal , ortho MSG: : rotate , scale , scissor , texcoord2 , texcoord3 MSG: : texcoord4 , translate , viewport , vertex2 , vertex3 MSG: : vertex4 MSG:

New Commands/Functionality - image

Top

  • Adding new command image index to split up a loaded image into NxM smaller indexed images and stores them all under the image being indexed. This is useful if the loaded image is stitched together of smaller images where the geometry of the smaller images are all identical.

    Assume a loaded image with the geometry 800x300 is stiched together by 24 images in 3 rows each with the geometry 100x100 and arrange so the second smaller image is within the larger right next to the first one and the 9th image is below the first smaller image etc in the following arrangement:

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 When the image is indexed with the command image index <image id> 8 3 the loaded image change geometry to new_width = width/cols and new_height = height/row and have rows*cols smaller images indexed. This is useful for image animation. The syntax is:

    image index <image id> <cols> <rows>

  • Adding new command "image index incr" to advance an indexed image's index pointer. This is useful for image animation. The syntax is:

    image index incr [<incr value>]

  • Adding new command "image index load" to load identical sized images into one loaded image as indexed images. This is useful for image animation. The syntax is:

    image index (load | loadasync) [<image id> [<file name>]] The command is expected to be used twice or more for the same <image_id> unless it is a stitched image supposed to be index later.

  • Adding new command "image index set" to query or set the index pointer of an indexed image. This is useful for image animation. The syntax is:

    image index set [<image id> [<index>]]

  • Adding new command 'image premultiply' to multiply the pixel colour values of an image with their alpha value. This fixes issue with transparent images and green-screening. WIthout it, pixel values could clamp and create wrong overlay result. The syntax is:

    image premultiply (on | off | <image id> [<alpha>] If premultiply is turned on, an image RGB pixels values are premultiplied with their alpha value upon loading. Using the image ID as argument, an image is premultiplied upon executing the command. Using both the image ID and the value as argument, the value is set as the image alpha value. After that the command can be executed again with only the image ID to premultiply with the set value.

  • Adding new command 'image pixel' to query or set a pixel value for a loaded image. The syntax is:

    image pixel <id no> <x> <y> [<red> <green> <blue> [<alpha>]]

  • Adding new command 'image loadasync' to load a PNG image asynchronously. The command will use the class BgWorker to load a PNG image in the background meaning loading the image will not delay video mixing. If the chosen image id is valid, the command will return immediately. As such, upon return, it has not yet been checked if the image can be loaded succesfully. It will be written to the Snowmix console (stderr) if the loading fails. The command *image load* can later be used to list loaded images.

  • Changing command 'image write' so it is executed by a bgWorker asynchronously. Further more, if the file name is ending with '.png' case insensitive, then the file written, will be a PNG file. Otherwise a raw BGRA/RGBA file is written. Note that while the writing of a raw BGRA/RGBA file is taking place, Snowmix is continuingi mixing. The image written is a copy of the loaded image, so the image can be deleted immediately after the command without problems.

New Commands/Functionality - monitor

Top

  • Changing monitor framework and adding new commands for creating and controlling monitors. Monitors can be sourced by feeds, images and the system mixer frame. Prior to this version of Snowmix, only one monitor existed and it was sourced by the system mixer frame only. The syntax of the new commands is:

    monitor [info] monitor (on | off | full | border) [<monitor id>] monitor add [<monitor id> [<monitor name>]] monitor aspect [<monitor id> (yes | on | true | 1 | no | off | false | 0)] monitor bgworker [(yes | on | true | 1 | no | off | false | 0)] monitor center [<monitor id> (yes | on | true | 1 | no | off | false | 0)] monitor coor [<monitor id> <xoff> <yoff>] monitor display [<monitor id> <display id>] monitor geometry [<monitor id> <width> <height>] monitor scale [<monitor id> (yes | on | true | 1 | no | off | false | 0)] monitor source [<monitor id> (frame | feed | image) <source id>] monitor verbose [<verbose level>] monitor help
  • Adding display number option to command *monitor*. The display number controls which display the monitor window will appear in, if the monitor is activated. The command *monitor* can be shortened to *mon*. The systax is:

    monitor [<display number>] The full syntax of the command is now:

    monitor [(on | off | full) | (<width> <height>) | <display no>]
  • Expanding 'monitor' command to support fullscreen provided you have SDL2 support as opposed to SDL1.2 support. SDL1.2 is being phased out and will in future versions not be supported. The new expanded syntax is:

    monitor [(on | off | full | border) | (<width> <height>)] The command 'monitor on' will open a window the size of the system geometry and display the main mixer frame. The window will not have any frame decoration.
    The command "monitor full" will switch to fullscreen mode selecting a window resolution that can hold the main mixer window and display the main mixer frame centered.
    The command *monitor off* will turn of the monitor window, also the fullscreen window. However if the monitor is in fullscreen mode, turning off fullscreen may not be possible if the command was given in main console control as the fullscreen absorbs the keystrokes. In that case, pressing the ESC-key will turn of monitor. Normally the monitor mode will use less CPU intense one to one blitting, when displaying the main mixer frame in the monitor window. If however the command 'monitor <width> <height>' was executed before the 'monitor on' or 'monitor full' command width width and height being non zero, Snowmix will use scaled blitting in an effort to scale to the given size. This effect can be reversed using the command *monitor 0 0*. For the command *monitor* the shorter abreveated version 'mon' can be used.
    Fullscreen on Raspberry Pi is special and described elsewhere. Special Raspberry Pi support is planned for version 0.6.0.

New Commands/Functionality - python

Top

  • Adding support for embedded python scripting. When creating commands containing a python script, the names MUST be ending in '.py'. This ensures that normal procedure for parsing input where multiple consequtive spaces are replaced by a single space is suspended. Example:

    command create MyPythonScript.py a = 2 b = 2 c = a + b print(c) command end python exec MyPythonScript.py Using '.py' as ending for command name also suspend the normal Snowmix setup parsing taking place whenever you create a new Snowmix macro (checking for if-then-else, labels, goto etc). This is equivalent to what happens for command macros containing tcl scripts identified by the '.tcl' ending. All python commands *python something* can be shortened to *pyt something*. Note the lack of indentation when creating MyPythonScript.py. You have to follow the rules of indentation for Python. This can make it harder to read Snowmix ini files with python scripts.

  • Adding new command *python exec* enabling executing a python script previously saved in a command macro wit the extension *.py*. The script is executed in the embedded Python interpreter. This is equivalent to the *tcl exec* command. The syntax is:

    python exec <name of command macro containing python script>
  • Adding new command *python eval* enabling executing a python statement or statements in the embedded Python interpreter. This is equivalent to the *tcl eval* command. It is legal to execute mutiple python statements separated by semicolon. Example:

    python eval a = 1 ; b = 2 ; c = a + b ; print(c) The syntax is:

    python eval <python statments or statements>
  • The embedded python interpreter can access Snowmix internals pretty much the same way Snowmix internals are accessed in tcl. In Python the intenals are accessed using the method snowmix.info. Results are returned as a Python List. To get the geometry of all feeds, the following command can be executed:

    python eval a = snowmix.info("feed geometry all") ; print(a) The variable "a" would be printed to the Snowmix Console control connection because stdout and stderr are directed to the Console. The output could look like this:

    [[0, [0, 0], 'BGRA', [1024, 576], [0, 0], [1024, 576], [1, 1], [1, 1], 0.0, 'fast'], [1, [704, 0], 'BGRA', [704, 576], [32, 48], [320, 192], [12, 11], [1, 2], 1.0, 'fast'], [2, [704, 192], 'BGRA', [704, 576], [0, 24], [320, 192], [12, 11], [5, 12], 1.0, 'fast'], [3, [704, 384], 'BGRA', [704, 576], [32, 48], [320, 192], [12, 11], [1, 2], 1.0, 'fast'], [4, [0, 0], 'BGRA', [1024, 576], [160, 0], [704, 576], [1, 1], [1, 1], 1.0, 'fast']] If you execute the command "python eval print(a[0])" you could get something like this:

    [0, [0, 0], 'BGRA', [1024, 576], [0, 0], [1024, 576], [1, 1], [1, 1], 0.0, 'fast'] To get the geometry of the first feed you would execute something like "python eval print(a[0][3])" which can produce this:

    [1024, 576] So you can execute "python eval width = a[0][3][0]". The syntax for the snowmix.info method can be listed using the command "python help". The syntax is:

    snowmix.info("audio (feed | sink) (info | status | extended | syntax) (format | ids | maxid | nextavail | <id_list>)") snowmix.info("audio mixer (info | status | extended | source info | source status | source extended | syntax) (format | ids | maxid | nextavail | <id_list>)") snowmix.info("command ( names | list | at | syntax ) [ format | <name> ]") snowmix.info("feed (geometry | status | extended | state | pixel <x> <y> | syntax) (format | ids | maxid | nextavail | <id_list>)") snowmix.info("image (load | place | move | extended | pixel <x> <y> | syntax) (format | ids | maxid | nextavail | <id_list>)") snowmix.info("output ((info | status) [ format ]) | syntax") snowmix.info("text (string | font | place | move | backgr | linpat | syntax) (format | ids | maxid | nextavail | <id_list>)") snowmix.info("(vfeed | virtual feed) (place | move | extended | syntax) (format | ids | maxid | nextavail | <id_list>)") snowmix.info("shape (info | list | place | move | alpha) ( format | ids | maxid | nextavail | <id_list> )") snowmix.info("system (info | status | maxplaces | overlay | syntax) [ format ]") Obviously the string within the '"' has to be adjusted to express the information you want. You don't litteraly write snowmix.info("audio (feed|sink) ...") but rather write:

    python eval a = snowmix.info("audio feed info all")
  • Adding new command *python reset* which is similar to *tcl reset* command except it deletes the embedded python interpreter and initialize a new one.

  • Adding new command *python help* which is similar to the *tcl help* command listing the help info for the embedded Python interpreter.

  • Adding 2 new methods to execute Snowmix commands in the embedded Python interpreter. The syntax for the two commands are:

    snowmix.parse("some snowmix command") snowmix.parses("some snowmix command") The 'parses' variant is identical to the 'parse' variant with the exception it will not write anything to the control connection it is being executed via.

  • Adding a new method to write a message from within the embedded Python interpreter to the Snowmix control connection executing the command. Example:

    python eval snowmix.message("hello world") This produce the same result as the Snowmix command *message hello world*, but the execution takes place from within the embedded interpreter. This is equivalent to the command *tcl eval message hello world*.

New Commands/Functionality - shape

Top

  • Adding a way to flip a feed used in a shape macro. The syntax for the shape feed command is:

    shape feed <shape id> <feed id> <x> <y> [<scale x> <scale y> [<xx> <yy>]] The sign of the optional <xx> and <yy> arguments controls flipping the feed used in the macro. Setting <xx> to -1.0 flips the feed vertically. Setting the <yy> to -1.0 flips the feed horizontally. Seeting the arguments to 1.0 and 1.0 disables flipping. Using values other than -1.0 and 1.0 scales the feed. The <xx> and the <yy> are equivalent to the variables in the Cairo Matrix using the same names.See:

    The change affects the way a shape list the shape feed element. Before the change the shape list command would list the shape feed element like this:

    STAT: shape 1 ops 2 name Video Feed Shape STAT: - 1 feed 1 at 0.0000,0.0000 scale 1.0000,1.0000 STAT: - 2 paint 1.0000 This will now be listed as below:

    STAT: shape 1 ops 2 name Video Feed Shape STAT: - 1 feed 1 at 0.0000,0.0000 scale 1.0000,1.0000 xx,yy 1.0000,-1.000 STAT: - 2 paint 1.0000 The example above flips the feed over a horizontal axis because the yy value is negative. As another consequence of the change, the command shape modify can now change the xx and the yy of the shape feed entry on the fly in a shape macro. The xx and yy parameter is the 6th and the 7th parameter in the shape feed. Below is shown listing a shape and changing the yy value:

    shape list 1 STAT: shape 1 ops 2 name Video Feed Shape STAT: - 1 feed 2 at 100.0000,200.0000 scale 1.0000,1.0000 xx,yy 1.0000,1.0000 STAT: - 2 paint 1.0000 STAT: shape modify 1 1 6,7 -1.0 -0.5 shape list 1 STAT: shape 1 ops 2 name Video Feed Shape STAT: - 1 feed 2 at 100.0000,200.0000 scale 1.0000,1.0000 xx,yy -1.0000,-0.5000 STAT: - 2 paint 1.0000 STAT: The result is that the feed will be flipped for both horizontal and vertical axis. Further more because the absolut value of yy is different from 1.0, a scaling will happen (here to half size in the Y axis direction).

  • The syntax for the commands shape pattern radial, shape pattern linear and shape pattern stoprgb syntax has been changed making arguments optional. The syntax is now:

    shape pattern radial [<pattern id> [<cx0> <cy0> <radius0> <cx1> <cy1> <radius1>]] shape pattern linear [<pattern id> [<x1> <y1> <x2> <y2>]] shape pattern stoprgb [<pattern id> [<offset> <red> <green> <blue> [<alpha>]]] Used without arguments, the commands list details for all patterns. Used with the one argument <pattern id>, the commands list details for the specific pattern if it exists. This is an enhancement and it should not break scripts unless a script depend on the commands would fail when used without arguments.

  • Adding new command shape offset to add a given offset to absolute coordinates. This affects shape macro command such as moveto, lineto, arc_cw, feed and image. The offset is by default 0,0 and changing offset will be inherited recursively down, but not up. If offset in shape N and the shape calls shape M which sets offset to a non zero value, offset is still 0,0 in shape N when execution of shape M ends and the macro execution of shape N continues. The syntax is:

    shape offset <shape id> <dx> <dy>
  • Adding the two new commands shape alphasave and shape alpharestore to save and restore alpha values within a shape. Restoring alpha values beyond the list of saved alpha values are ignored. The list of possibly saved alpha values are not recursively available and any alpha value saved in a shape included in another shape is not available for restoring. The syntaxes are:

    shape alphasave <shape id> shape alpharestore <shape id>
  • The command shape list <shape id> will now print the shape name for shapes in shapes (ie. inshape). See example below where the shape 2 (Unit Rectangle) is included (inshape) in shape 14.

    shape list 14 STAT: shape 14 ops 2 name My Own Shape STAT: - 1 inshape 2 (Unit Rectangle) STAT: - 2 clip STAT: - 2 newpath STAT:
  • Adding the new command shape modify to on the fly change individual values for an an entry in a shape macro. The syntax is:

    shape modify <shape id> <entry id> <no>[,<no>...] <value> [<values>...] The parameter <entry id> is the entry line number in the shape macro that is to have one or more of its values changed. You do not change the entry type with this command, but rather the values of the entry. If shape macro 15 has an entry with four values a, b, c and d in line 7 and you wish to change b and d, the command would be:

    shape modify 15 7 2,4 9.001 11.05
  • Adding the command shape help modify to list the shape macro entries that can be modified using the command shape modify. The following shape entries can be changed using the shape modify command:

    alphaadd, alphamul, arc_cw, arc_ccw, arcrel_cw, arcrel_ccw curverel, curveto, image, inshape, feed, lineto, linerel, line width mask pattern, moveto, moverel, offset, rectangle, recursion, rotation, scale, source pattern, source rgb, sourcergba, shape, translate, transform

New Commands/Functionality - system

Top

  • The syntax for the command system control port for setting the TCP listener port, has been expanded to also be able to list the current value. The syntax is now:

    system control port [ <port number> ] The keyword system control can be abbreviated to "sys ctr as shown below:

    sys ctr port [ <port number> ]

  • Adding new command system ctr id to list the unique ID of a controller connection. The systax is:

    system ctr id

  • Adding new command command messagec to send messages to a specific control connection identified by its unique ID. The syntax is:

    messagec <ctr id> <message>

  • Adding new command system ctr onclose to enable auto execution of a snowmix command on close of a controller connection. The syntax is:

    system ctr onclose [<snowmix command>]

  • Adding new commands to dynamically expand the place holders (maxplaces) for text, image, vfeed, shape, glshape, audio feed, audio mixer and audio sink. Currently, the number of place holders can only be expanded, not shrinked. The syntax are:

    text maxplaces (string | font | place) [<max value>] image maxplaces (load | place) [<max value>] vfeed maxplaces place [<max value>] shape maxplaces (shape | pattern | place) [<max value>] glshape maxplaces (shape | texture | vector | array | vbo | place) [<max value>] audio feed maxplaces feed [<max value>] audio mixer maxplaces mixer [<max value>] audio sink maxplaces sink [<max value>] These commands do not have the limitation the original command maxplaces had. The original maxplaces command would need to be executed before the involved module is loaded (is referenced).

    WARNING. Do not add more place holders for each type than you need. Adding more than you need may in some cases increase the time it takes to mix each frame. So be conservative and keep the numbers low. The syntax has been added to the help command for each sub module.

  • Snowmix will upon startup now open a fd to /dev/null. If the fd is less than 3, indicating that stdin, stdout or stderr has been closed, Snowmix will exit. If Snowmix is started in a Docker container, Docker may have closed stdin and stdout upon startup. This can be prevented using the following method to start Snowmix:

    (sleep 3 ; nc localhost 9999 >/dev/null) | snowmix ini/my_ini_file 2>&1 | cat >snowmix.log Depending on the version of nc or netcat the command may need the option '-d' as shown below:

    (sleep 3 ; nc -d localhost 9999 >/dev/null) | snowmix ini/my_ini_file 2>&1 | cat >snowmix.log

  • Adding new command for a keyboard handler. Using this functionality, keyboard events can be forwarded to any Snowmix command. However for most cases it will only make sense to forward the event to a tcl or python function. The syntax is:

    system keyhandler [<snowmix command>] Note that the keyhandler will only catch keyboard events if the monitor function is set to run and the window or fullscreen actually receives the event.

    Setup Example 1:

    system keyhandler tcl eval MyKeyboardHandler monitor on Setup Example 2:

    system keyhandler python eval MyKeyboardHandler monitor on In the first example the following commands are executed in case of keyboard press and keyboard release:

    tcl eval MyKeyboardHandler <mon id> 1 KEY_CODE tcl eval MyKeyboardHandler <mon id> 0 KEY_CODE For the second example the following commands are executed in case of keyboard press and keyboard release:

    python eval MyKeyboardHandler (<mon id>,1,KEY_CODE) python eval MyKeyboardHandler (<mon id>,0,KEY_CODE) The "<mon id>" is the id of the monitor (window) the event was received in. The monitor id will usually be 0 unless more monitors than the default has been defined. In all cases, KEY_CODE is substituted by an integer value depending on key. The middle value "1" or "0" indicates keypress and key relase respectively.

    If the following configuration is done:

    system keyhandler MyMacro then the following command is executed, which has limited use because the KEY_CODE and UP/DOWN (keypress/keyrelease) info is lost:

    MyMacro This use should be avoided.

  • Adding mouse handler. Using this functionality, mouse events can be forwarded to any Snowmix command. However for most cases it will only make sense to forward the event to a tcl or python function. The syntax is:

    system mousehandler [<snowmix command>] Note that the mousehandler will only catch mouse events if the monitor function is set to run and the window or fullscreen actually receives the event. This functionality is similar to the command system keyhandler described above.

    Please see there for details on what to set as a mouse handler function. If the command for the mouse handler is tcl eval MyHandler (or python eval Myhandler) the Myhandler function will, when a button is pressed or released, be called with the arguments:

    Myhandler 1 <mon id> <which> <button> <state> <x> <y> <timestamp> Myhandler 2 <mon id> <which> <timestamp> <state> <x> <y> <dx> <dy> Myhandler 3 <mon id> <which> <timestamp> <state> <x> <y> <dx> <dy> The first argument "1" set it as a mouse button press or release event. "2" is mouse motion and "3" is wheel event.

  • Adding new command system mousemotion to control mouse motion and mouse wheel events. The command can be used to enable forwarding mouse motion and mouse wheel events to the mouse handler, also when no mouse button is pressed. By default the mouse motion is set to 'auto'. When in auto mode, mouse motion and wheel events are only forwarded when a mouse button is pressed. When mouse motion is set to off, mouse motion and mouse wheel events are dropped. When motion mode is set to on, mouse motion and wheel events are always forwarded to mousehandler. When the command is used without arguments, the mousemotion mode is listed. The syntax is:

    system mousemotion [(auto | on | off)]

  • Adding new command system frame write to write the system mixer frame to a PNG file. The writing takes place in the background by BgWorker. The syntax is:

    system frame write <mixer frame id> <filename> Currently the 'mixer frame id' is '0'. The written file will be a PNG file using 32 bit RGBA. It is recommended that the filename uses the extension 'png', but this is not enforced.

  • Adding new command system stacking to turn off and on stacking. This is only relevant to use on slow performing platforms such as a Raspberry Pi. When system stacking is disabled, stacking is ignored and the main mixer frame does not automatically gets overwritten with a black bottom background at the beginning of each frame. Spilovers from previous frame can happen unless the main mixer frame is overlayed by an image or a feed the same size as the system geometry. The syntax is:

    system stacking [(0 | 1)] Disabling stacking can save cpu cycles avoiding a possible unnecessary memcpy of feed 0 (feed 0 is by default all black).

  • All system ... commands can now use the shorter abreveated version sys ....

  • Adding command system mixer to enable video mixing, even when no GStreamer shmsrc is connected to the Snowmix video output. When no shmsrc is connected by default, Snowmix will not mix video and not overlay feeds and execute the command macro set with the command overlay finish. The syntax is:

    system mixer [ (always | ondemand) ] The default value is ondemand. If used without arguments, the command will list the current setting. The command system info will now also list this status adding a line similar to this:

    STAT: System mixer : ondemand (output not connected) If in 'always' mode, it will list that.

  • When setting system width and height, the product of the width and height must now be smaller than UINT_MAX>>2 (1073741823). It is checked.

New Commands/Functionality - tcl

Top

  • Adding new embedded tcl command to query glshape similar to the embedded tcl command for query shapes. The syntax is:

    snowmix info glshape (info | list | place | move | alpha | texture | vector | array | vbo | vbodata) ( format | ids | maxid | nextavail | <id_list> ) Availability requires at least one of OSMesa, GlX or Egl being enabled when Snowmix was built. If the embedded Python interpreter is enabled when built, the command is available as method as:

    snowmix.info("glshape .....");
  • Adding listing shape patterns to the embedded tcl command snowmix info. The parameters added are 'pattern' and 'pdata'. The syntax is:

    snowmix info shape (info | list | place | move | alpha | pattern | pdata) ( format | ids | maxid | nextavail | <id_list> ) The pattern options provides method for returning info on shape pattern (linear, radial stoprgb). As always examples of '' are:

    23 7 14 3 14..25 27..end all
  • Adding listing name to the tcl command snowmix info audio feed info, snowmix info audio mixer info and snowmix info audio sink info The changed format string can be queried as always using the tcl command snowmix info audio feed info format now returning for feed, mixer and sink respectively:

    id rate channels signed bytespersample inidelay name id rate channels signed bytespersample name id rate channels signed bytespersample delay name The embedded Python interpreter can do the same with the method snowmix.info.

Changes - Other

Top

  • configure.ac now checks for long list of OpenGL calls and if present their functions are enabled in Snowmix. Otherwise they are omitted. This is needed for various versions of OpenGL and EGL.

  • Snowmix iis by default using BGRA as its internal color format. BGRA for Snowmix means that a byte with a value for blue is stored at the first memory location, green byte at the next etc. This is indepedent of whether the hardware platform is little endian or big endian. Snowmix can be changed from default BGRA to RGBA using the configure like this on standard Linux:

    prefix=/usr/local ./configure --prefix=$prefix --libdir=$prefix/lib --enable-snowmixrgba Mac OS X would use /opt/local as prefix.

    Note that the ./bootstrap command does not set BGRA/RGBA for you. So if you wish to change to RGBA instead of BGRA, you need to run the configure command after running bootstrap possibly adding more switches for other options. You can see all configure switches using the command:

    ./configure --help The command system info will now list the internal color format. If you are writing a script that for a video feed input will connect to Snowmix using shmsrc, you can use use the command system info to query which format Snowmix is using.

    IMPORTANT: On some hardware systems BGRA is faster than RGBA and vice versa when using OpenGL. It depends on the OpenGL Library. On my now ancient and retired older Lenovo ThinkPad T61 with Intel Corporation Mobile GM965/GL960, BGRA is much faster than RGBA when copying back from GPU to CPU memory.

  • The script input2feed will now query Snowmix for the format of a feed and set its parameters accordingly converting the stream to the appropriate format.

Bugfix - audio

Top

  • The command audio sink start <sink id> as well as the similar stop command will, when verbose set to 1 or greater and if the command succeeded, now print a one line message saying so to the control connection on which the command was issued on. This is a bugfix. When succeeding a line printed can look like this:

    MSG: audio sink 10 started This bug fix helps external scripting.

  • The command audio mixer source without additional arguments lists information for audio mixers and their sources. Here the "av. samp. 0 = 0 ms" field would list wrong value in milliseconds if the source channel number is not the same as the number of channels for the mixer. This is a bugfix.

  • Setting mindelay and maxdelay for audio mixer source using the commands audio mixer source mindelay and audio mixer source maxdelay could possibly lead to misalignment of audio bytes depending on sample rate and ms of delay. This is a bugfix.

  • Dropping samples for audio feed with the command audio feed drop, for audio sink with command audio sink drop and for audio mixers with the commands audio mixer drop and audio mixer source drop could possibly lead to misalignment of audio bytes depending on sample rate and ms to drop. This is a bugfix.

  • When deleting audio feed or audio sink, the feed or sink id printed deleted when in verbose mode was wrong. This is a minor bugfix.

  • The RMS fade-down calculations for CAudioMixer in Update() was not coded correctly which could lead to overwriting wrong memory areas which potentially could lead to all kinds of memory related problems. This is a bugfix.

Bugfix - command

Top

  • Deleting a defined command macro and then create another command macro with the same name, would often, when using the command macro, crash Snowmix. This is a bugfix.

  • Running the command include through the command command at would crash Snowmix. This is a bugfix.


Bugfix - feed

Top

  • The command feed image, could in some cases write a string pointed to by NULL. This is a bugfix.

  • Feeds iset to scale (scaling different from 1) and feeds with pixel aspect ratio PAR set 1:1, would not be overlayed correctly using the stack command. This mostly affected feeds with a geometry smaller than the system geometry. This is a bugfix.

  • The command feed fast overlay could not be placed anywhere else than at ithe coordinate 0,0 no matter what the row and col parameter was set to. This is a bugfix.

  • The internal sequence number of feed was not reset to zero upon disconnect (or 1 if the feed has an idle image). This could cause glshape texture using a feed as source to use last received frame for the feed as source indefinitely and not the idle frame of the feed, at least until a new connection was made to the feed. This is a bugfix.

  • Snowmix 0.5.1.1 and earlier would for feeds with pixel count less than mixer frame when loading a feed idle bgra/rgba image try to read more data than buffer size allocated could hold. For ealier versions of c++ compilers, this would be okay if the actual rgba/bgra file size would match the defined feed size, but if the file size was bigger, then a buffer overflow would occur with unpredictable result. With newer c++ compilers, the compiled code would detect a possible buffer overflow and abort Snowmix. The code part with wrong buffer size no longer exist in 0.5.2. This is a bugfix.


Bugfix - glshape

Top

  • The command glshape add <vbo id> did not delete the vbo, only the vbo name although it did free the memory of the vbo possibly leading to snowmix dumping core. This is a bugfix.

  • Command glshape help was not listing the command glshape list. The syntax:

    glshape list [<shape id>] has now been added to the output of the command. This is a minor bugfix.

  • The command glshape help listed the syntax for the command "glshape entry" wrong. The correct syntax is:

    glshape entry <glshape id> <entry line> (active|inactivate|<no frames active>) The command glshape entry can be used to activate or inactivate an entry in a glshape macro. If an entry is set active for a number of frames, then the entry will stay active for the number of times used and then marked inactive. This is a minor bugfix.

  • Loading or changing idle image for a feed would not be detected by glshape using the feed as a texture if the feed was in any state different from RUNNING. This is a bugfix.

  • The command glshape modify ... would not modify a clearcolor entry. This is a bugfix.

  • The syntaxes for the commands "glshape modify", "glshape vbo config", glshape vbo data and glshape vbo indices was listed wrong in the help section. The correct syntaxes are:

    glshape modify <glshape id> <entry id> <no>[,<no>...] <value> [<values>...] glshabe vbo config [<vbo id> (static|dynamic|stream) <form> (c3 | c4 | n3 | t1 | t2 | t3 | t4 | v2 | v3 | v4) ...] glshabe vbo data [<vbo id> <data 0> <data 1> ...] glshabe vbo indices [<vbo id> <index 0> <index 1> ...] This is a bugfix.


Bugfix - image

Top

  • The anchor for an image (nw, n, ne, e, se, s, sw, w and c) was switching the location for anchor set to east (e) and to west (w) while the anchors including these (nw, sw, ne and se) was correct. This is a bugfix.

  • The image created using the command image source would either, if the image was deleted, when using the command again on the same image id or using the command image load on the same id, leak memory (WxHx4 bytes). If using the command "image source" at frame rate, Snowmix would be rendered unusable within seconds or minutes. This a bugfix.

  • The command image name could in some cases try to print a string with a point to NULL. This is a bugfix.

  • Deleting a loaded image would not report error if the loaded image did not exist. This i a minor bugfix.


Bugfix - shape

Top

  • The anchor for a placed shape (nw, n, ne, e, se, s, sw, w and c) was switching the location for anchor set to east (e) and to west (w) while the anchors including these (nw, sw, ne and se) was correct. This is a bugfix.

  • The shape help was listing the syntax incorrectly for command shape feed. The correct syntax is:

    shape feed <shape id> <feed id> <x> <y> [<scale x> <scale y> [<xx> <yy>]] This is a minor bugfix. The scale option is used in the following way:

    scale_x < 0.0 : relative scale - scale from whatever shape is scaled to. scale_x = 0.0 : no scale - follow whatever the placed shape is scale to scale_x > 0.0 : absolute scale - scale absolute taking into account scale of shape

  • Command shape help listed an incomplete syntax for the command "shape list". The syntax is:

    shape list [<shape id>] This is a minor bugfix.

  • Using a linear pattern in a shape that was used by a placed shape where the resulting alpha value would be less than 1, when executing the pattern macro, would, because the linear pattern vector was left uninitialized, result in a flat colour using one of the entered stop values. This is a bugfix.

    Note that when using patterns where the alpha values are less than 1, recalculation of stop values are made on the fly adding load. Using a resulting shape alpha lower than 1, not the alpha value in the pattern (if specified), should only happen when really necessary to keep load down.

  • The help sections for shapes did not list the following entries:

    shape alphaadd <shape id> <value> shape alphamul <shape id> <value> This is a bugfix.


Bugfix - system

Top

  • The command system control port for setting the TCP listener port was not listed in the output from the help command. This is a bugfix.

  • Adding optional argument to list additional help topics. The syntax for the help command is now:

    help [topics] With the argument topics present, a list of help available such as text help etc. ending with an empty 'MSG:' line. The corresponding entries for the 'help' command without arguments have been removed.

  • Using absolute path (file name staring with a '/') would in many cases fail. Example include /home/stream/myscript would fail. This is a bug fix.


Bugfix - text

Top

  • The anchor for a placed text (nw, n, ne, e, se, s, sw, w and c) was switching the location for anchor set to east (e) and to west (w) while the anchors including these (nw, sw, ne and se) was correct. This is a bugfix.

  • The command text help did not print an empty "MSG:" line as last line and the line 'MSG: text font ...' had a smaller typo. This is a minor bug fix.


Bugfix - tcl

Top

  • The command tcl help was not listing the following:

    tcl eval snowmix parses <snowmix command> The embedded tcl command can be used to execute a Snowmix command within the embedded tcl interpreter while surpressing any output to the control connection. The 's' stands for silent. This is a minor bugfix.

  • The syntax for the command glshape vbo add was not listed with its syntax when executing glshape help. This is a minor bugfix. The correct syntax is:

    glshape vbo add [<vbo id> [<name>]]

  • The built-in tcl command snowmix info system maxplaces returned the number of strings for the number of fonts. This is a bugfix.

  • Smaller bug in SceneSetState in slib/scenes.slib. Bug is described here: https://sourceforge.net/p/snowmix/discussion/Snowmix_Support_Forum/thread/88af32bc/?limit=25#c348 The procedure would in some cases add an extra quotation mark to the internal list of active and not active scenes. This is a bugfix.

    However these lines still removes Scene 2 from the list. This is an unresolved bug.

    tcl eval SceneSetState 2 1 1 tcl eval SceneSetState 3 1 1 tcl eval SceneSetState 2 1

  • When issuing the command tcl help, then modules that was not loaded would not have the string "MSG:" prepended when listing that. This is a bugfix. Note that the prepended "MSG:" may later be changed to "STAT:".

  • The embedded tcl command snowmix info shape alpha would report incorrect value(s) for nextavail and ids. This is a bugfix.

  • The tcl command snowmix info command list could in some cases try to print a string wit hthe address NULL. This is a bugfix.


Bugfix - vfeed

Top

  • The anchor for a virtual feed a.k.a vfeed (nw, n, ne, e, se, s, sw, w and c) was switching the location for anchor set to east (e) and to west (w) while the anchors including these (nw, sw, ne and se) was correct. This is a bugfix.

  • The command vfeed info was not listed in the list the command vfeed help will list. The command list information about currently create virtual feeds (video or image based). This is a minor bugfix.