Updated for Snowmix 0.4.4.
Q1) I get Unable to open init file: "videomixer.ini": No such file or directory
Q2) Why do Snowmix core dumps.
Q3) Why does my audio sound slower or faster than expected?
Q4) Why is my text, shape, virtual feed or image not displayed?
Q5) Why do I get AddAudioToFeed buffer size for XXXX MISMATCH ?
Q6) I send audio data to Snowmix but the audio feed is in state PENDING.
A1) Snowmix is a tool that require an ini file for its configurations. There are examples in the ini directory. Start with the file ini/basic_feeds
cd src ./snowmix ../ini/basic_feeds
A2) Snowmix requires a certain amount of shared memory. If Snowmix has ended in a crash or by a kill signal (ctrl-C as an example), allocated shared memory may have stayed allocated. On a Linux OS, you can see the amount of available shared memory using the command *df.
df -k /run/shm Filesystem 1K-blocks Used Available Use% Mounted on none 1004440 160 1004280 1% /run/shm
If all your available shared memory is used on a Linux OS, you may free shared memory allocated by Snowmix, but no longer in use by issuing the following command with caution:
A3) There is a mismatch in the sample rate between what you input and what you output. Make sure that all audio feeds, audio mixers and audio sinks that are connected are using the same sample rate and make sure that you are feeding audio with that rate andmake sure you consumer process, that reads audio from audio sinks are using the same sample rate. That said, it is perfectly allowed to run multiple audio chains in a Snowmix process each with its own specific sample rate as long as you don't connect these audio chains inside Snowmix. GStreamer has a module named audioresample that will allow you to change the sample rate of an audio pipeline in GStreamer before inputting it to Snowmix or after reading audio samples from Snowmix.
A4) Assuming you have defined a text, shape, image (loaded) or virtual feed and placed it using one of the following commands
text place <place id> ... shape place <place id> ... image place <place id> ... virtual feed place <place id> ...
and assuming you have not set the alpha value of the placed item to 0, then there is a short and a long answer to your question. The short answer is that you need to tell Snowmix to overlay the placed item. You can do this by adding some commands to either your ini file or your control connection:
command create PreShow text overlay 1 # The following are just examples and can be omitted except the loop # text overlay 2 7 5 # text overlay 3..5 2 # text overlay all # text overlay 3 2 1 4..end # image overlay 2 # shape overlay 34 # virtual feed overlay 1 3 2 5 4 loop command end overlay pre PreShow
The long answer is that Snowmix will for each frame produced run through 7 modes. These modes are:
1) All feeds with a frame ready in shared memory sent with shmsink are serviced and the frames are included into Snowmix and old used frames are signalled back to shmsinks ready to be reused.
2) All control connections with command input are serviced, commands are read and executed.
3) The command list indicated by the command name given using the command overlay pre is executed to its fullest, from where it reached producing the previous frame. This means that all commands in it are executed until Snowmix detects either a next or a loop in the command. If the command contains sub commands, these are also executed to the fullest from where they reached the last time they were executed until a next or a loop is reached. When execution of a subcommand of a command reaches a next or a loop, snowmix will leave the subcommand and continue executing the command until it reaches a next or a loop.
4) Audio feeds, mixers and sinks are serviced for input, mixing and output.
If a shmsrc is connected to Snowmix, then the next 3 modes are also included.
5) The system frame, feed 0, is used as the bottom layer in the main mixer frame. Then all other feeds set with the stack command if any are layered on top.
6) The command list indicated by the command name given using the command overlay finish is executed.
7) The finished main mixer frame is first displayed on screen if the command monitor on was issued earlier and finally the frame is sent out to a shmsrc.
Now if you want a placed text, images, virtual feeds and shapes to be included into the main mixer frame, you need to issue overlay commands when Snowmix is is mode 6. The only way to do that is to include it somehow in the command list given by the command name set for overlay finish. To do that you need to do something like this:
command create Show text overlay 1 # image overlay 1 3 # virtual feed overlay 3 4 1 # shape overlay 2 3 7..end loop command
The Show command must nearly always have the loop command in the end. Otherwise the commands in it are executed until the end the first time it is executed. Additional calls to this command will detect the execution pointer of the command to be at the end of the command and subsequently do nothing.
Now you must tell Snowmix to execute the command Show when it is in mode 6. Here is how you do this:
overlay finish Show
Now if you want to display placed text 2 instead of 1, you can execute the following via a control connection:
command deleteline Show 1 command addatline Show 1 text overlay 2
More commands to manipulate a defined command macros can be found here https://sourceforge.net/p/snowmix/wiki/Reference%20Command/
A6) You get an audio mismatch because you in your input pipelines sends audio samples and GStreamer verbose messages into Snowmix as audio samples.
( echo 'audio feed ctr isaudio 1' gst-launch-0.10 -v ....... fdsink fd=1 ) | nc 127.0.0.1 9999
You must either use
( echo 'audio feed ctr isaudio 1' gst-launch-0.10 -q ....... fdsink fd=1 ) | nc 127.0.0.1 9999
with the '-q' flag for quiet or use redirection as shown below
( echo 'audio feed ctr isaudio 1' gst-launch-0.10 -v ....... fdsink fd=3 3>&1 1>&2 ) | nc 127.0.0.1 9999
Here you output samples to fd 3, then redirect fd 3 to where fd 1 stdout is pointing and then redirecting fd 1 to fd 2 stderr while fd 3 is still redirected to where fd was pointing. This way you can still see messages from GStreamer in the console.
A6) An audio feed can be in the state pending for 3 reasons. These are
For the first cause, it may be the case that your process to input audio data is somehow stalled or otherwise prevented in sending samples. The reason for that can be so many so no simple solution or test exists.
For the second cause your control connection over which you send the audio data is not configured to be an audio connection. To convert a control connection to an audio connection you need to send the text string 'audio feed ctr isaudio 1' followed by a newline. Please read the section Feeding audio to Snowmix in the page https://sourceforge.net/p/snowmix/wiki/Audio/
For the third cause, the audio feed wil remain pending, if no mixer or sink is actively using the audio feed. Please read the section Starting audio mixers in the page https://sourceforge.net/p/snowmix/wiki/Audio/
Quite likely you are missing an audio sink that has been started and that is actively consuming samples from either an audio mixer or an audio feed.