Author Topic: Video snaps playing sound twice?  (Read 4594 times)

akafox

  • Hero Member
  • *****
  • Posts: 985
    • View Profile
Video snaps playing sound twice?
« on: January 30, 2017, 02:54:25 PM »
Now I am not sure what is going on here at all. And there is no output to give sorry. Thus why I am so stumped.

It seems to me that my snaps are playing twice. Now the video seems to be fine and not jerky or stutters. However the sound is weird.
Now the sound is fine. And as I scroll I have no problems. However if I let sit on the second pass the sound seems to "echo". On a third pass is sounds like it's coming from a public speaker set up..like you'd find in in a football field. On the fourth pass it so bad I can't even make it out. The longer it sits the worse it gets. If I change games or come back from the screensaver the sound is fine. It is only when it sits for a few minutes on the same video snap. And not just one snap..it effects all of on them.

Anybody else encounter this?
People want life easy..then complain about it

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: Video snaps playing sound twice?
« Reply #1 on: January 30, 2017, 03:03:16 PM »
Does the issue happen with all default layouts?

akafox

  • Hero Member
  • *****
  • Posts: 985
    • View Profile
Re: Video snaps playing sound twice?
« Reply #2 on: January 30, 2017, 04:55:25 PM »
I'm using the uni_cade layout however yes it does it on the default layouts as far as I can tell. I have Aslo noticed that it doesn't happen all the time. Just more often than not. I can't pin it down to anything..that's the problem.

People want life easy..then complain about it

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1271
    • View Profile
Re: Video snaps playing sound twice?
« Reply #3 on: January 30, 2017, 05:17:51 PM »
There was a bug in the original uni_cade layout where the video did actually play twice depending on your settings. If you search the forum I posted the fix some time ago.

If you want my modified layout.nut for uni_cade here it is.

layout.nut
Code: [Select]
// 2/17/16
// Attract-Mode Front-End - "uni_cade" layout
//
class UserConfig {
   </ label="SpinWheel", help="The artwork to spin", options="wheel,marquee", order=1 /> orbit_art="wheel";
   </ label="Transition Time", help="Time in milliseconds for wheel spin.", order=2 /> transition_ms="25"; 
   </ label="Enable System Logos", help="Enable System Logos", options="Yes,No", order=3 /> enable_logos="Yes";
   </ label="Enable VertArt", help="Choose vertical art or wheel art.", options="Yes,No", order=4 /> enable_VertArt="No";
   </ label="Enable Flyer", help="Enable flyer for background.", options="Yes,No", order=5 /> enable_flyer="Yes";
   </ label="Enable Art", help="Enable art that overlays on snap", options="none,marquee,wheel", order=6 /> enable_art="none";
   </ label="Enable Stars", help="Enable animated stars for background.", options="Yes,No", order=7 /> enable_stars="Yes";
   </ label="Random Text Colors", help=" enable colors.", options="Yes,No", order=8 /> enable_colors="Yes";
   </ label="Static Effect", help="Static effect when null snap", options="yes,no", order=9 /> enable_static="yes";
   </ label="Enable Flyer opacity", help="Flyer opacity for background.", options="100%,50%,25%", order=10 /> enable_opacity="100%";
}

local my_config = fe.get_config();
local flx = fe.layout.width;
local fly = fe.layout.height;
local flw = fe.layout.width;
local flh = fe.layout.height;
fe.layout.font="grobold";
const SNAPBG_ALPHA = 200;

if ( my_config["enable_stars"] == "Yes")
{
fe.do_nut("star.nut");
}

//flyer for BG
if ( my_config["enable_flyer"] == "Yes")   
{
local flyer = fe.add_artwork( "flyer", 0, 0, flw, flh);
flyer.preserve_aspect_ratio = false;
  if ( my_config["enable_opacity"] == "100%")   
   {
   flyer.alpha=255;
   }
 if ( my_config["enable_opacity"] == "50%")   
   {
   flyer.alpha=127.5;
   }
 if ( my_config["enable_opacity"] == "25%")   
   {
   flyer.alpha=63.75;
   }
}

//Play static when snap is null
local snapbg=null;
if ( my_config["enable_static"] == "yes" )
{
snapbg = fe.add_image("static.mp4", flx*0.11, fly*0.27, flw*0.412, flh*0.55 );
    snapbg.trigger = Transition.EndNavigation;
snapbg.set_rgb( 155, 155, 155 );
snapbg.alpha = SNAPBG_ALPHA;
}
else
{
local temp = fe.add_text(
"", 224, 59, 352, 264 );
temp.bg_alpha = SNAPBG_ALPHA;
}

//Surface
local surface = fe.add_surface( 640, 480 );
local snap = surface.add_artwork("snap", 0, 0, 640, 480);
snap.trigger = Transition.EndNavigation;
snap.preserve_aspect_ratio = false;

//position and pinch the surface
surface.set_pos(flx*0.11, fly*0.27, flw*0.412, flh*0.55);

//snap overlay bg
local snap_overlay = fe.add_image("overlay.png", flx*0.0, fly*0.0, flw, flh);
snap_overlay.preserve_aspect_ratio = false;

//System Logos
if ( my_config["enable_logos"] == "Yes") 
{
function strip_emu( ioffset )
{
                       // remove begining and trailing whitespace from the emulator name
                        local m = strip(fe.game_info(Info.Emulator));
return m;
}
fe.add_image( "[!strip_emu]", flx/9, fly*0.01, flw*0.5, flh*0.2 );
}

//Art overlay
if ( my_config["enable_art"] == "none") 
{
local art = fe.add_artwork("none", 0, 0);                   
art.trigger = Transition.EndNavigation;
}

if ( my_config["enable_art"] == "marquee") 
{
local art = fe.add_artwork("marquee", flx*0.385, fly*0.67, flw*0.13, flh*0.15);                   
art.trigger = Transition.EndNavigation;
art.alpha = 90;
}

if ( my_config["enable_art"] == "wheel") 
{
local art = fe.add_artwork("wheel", flx*0.385, fly*0.67, flw*0.13, flh*0.15);                   
art.trigger = Transition.EndNavigation;
art.alpha = 90;
}

//Year & Manufacturer info
local textm = fe.add_text("[Year] [Manufacturer]", flx*0.12, fly*0.84, flw*0.46, flh*0.03);
textm.set_rgb( 255, 255, 255 );
//textm.style = Style.Bold;
textm.align = Align.Left;

//Title info
local textt = fe.add_text( "[Title]", flx*0.16, fly*0.89, flw*0.5, flh*0.04  );
textt.set_rgb( 225, 255, 255 );
//textt.style = Style.Bold;
textt.align = Align.Left;
textt.rotation = 0;

//Category info
local textc = fe.add_text( "[Players]  [Category]", flx*0.2, fly*0.95, flw*0.4, flh*0.03  );
textc.set_rgb( 255, 255, 255 );
//textc.style = Style.Italic;
textc.align = Align.Left;

local filter = fe.add_text( "[ListFilterName]:[ListEntry]-[ListSize]", flx*0.168, fly*0.230, flw*0.3, flh*0.03 );
filter.set_rgb( 255, 255, 255 );
//filter.align = Align.Left;

//VertArt
if ( my_config["enable_VertArt"] == "Yes")
{
fe.load_module( "conveyor" );
local wheel_x = [ flx*0.71, flx*0.71, flx*0.71, flx*0.71, flx*0.71, flx*0.71, flx*0.66, flx*0.71, flx*0.71, flx*0.71, flx*0.71, flx*0.71, ];
local wheel_y = [ -fly*0.22, -fly*0.105, fly*0.0, fly*0.105, fly*0.215, fly*0.325, fly*0.436, fly*0.61, fly*0.72 fly*0.83, fly*0.935, fly*0.99, ];
local wheel_w = [ flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.28, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, ];
local wheel_a = [  80,  80,  80,  80,  80,  80, 255,  80,  80,  80,  80,  80, ];
local wheel_h = [  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11, flh*0.168,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11, ];
local wheel_r = [  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ];
local num_arts = 12;

class WheelEntry extends ConveyorSlot
{
constructor()
{
base.constructor( ::fe.add_artwork( my_config["orbit_art"] ) );
}

function on_progress( progress, var )
{
local p = progress / 0.1;
local slot = p.tointeger();
p -= slot;

slot++;

if ( slot < 0 ) slot=0;
if ( slot >=10 ) slot=10;

m_obj.x = wheel_x[slot] + p * ( wheel_x[slot+1] - wheel_x[slot] );
m_obj.y = wheel_y[slot] + p * ( wheel_y[slot+1] - wheel_y[slot] );
m_obj.width = wheel_w[slot] + p * ( wheel_w[slot+1] - wheel_w[slot] );
m_obj.height = wheel_h[slot] + p * ( wheel_h[slot+1] - wheel_h[slot] );
m_obj.rotation = wheel_r[slot] + p * ( wheel_r[slot+1] - wheel_r[slot] );
m_obj.alpha = wheel_a[slot] + p * ( wheel_a[slot+1] - wheel_a[slot] );
}
};

local wheel_entries = [];
for ( local i=0; i<num_arts/2; i++ )
wheel_entries.push( WheelEntry() );

local remaining = num_arts - wheel_entries.len();

// we do it this way so that the last wheelentry created is the middle one showing the current
// selection (putting it at the top of the draw order)
for ( local i=0; i<remaining; i++ )
wheel_entries.insert( num_arts/2, WheelEntry() );

local conveyor = Conveyor();
conveyor.set_slots( wheel_entries );
conveyor.transition_ms = 50;
try { conveyor.transition_ms = my_config["transition_ms"].tointeger(); } catch ( e ) { }
}
 else
{
fe.load_module( "conveyor" );
local wheel_x = [ flx*0.80, flx*0.795, flx*0.756, flx*0.725, flx*0.70, flx*0.68, flx*0.63, flx*0.68, flx*0.70, flx*0.725, flx*0.756, flx*0.76, ];
local wheel_y = [ -fly*0.22, -fly*0.105, fly*0.0, fly*0.105, fly*0.215, fly*0.325, fly*0.436, fly*0.61, fly*0.72 fly*0.83, fly*0.935, fly*0.99, ];
local wheel_w = [ flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.28, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, ];
local wheel_a = [  80,  80,  80,  80,  80,  80, 255,  80,  80,  80,  80,  80, ];
local wheel_h = [  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11, flh*0.168,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11, ];
//local wheel_r = [  31,  26,  21,  16,  11,   6,   0, -11, -16, -21, -26, -31, ];
local wheel_r = [  30,  25,  20,  15,  10,   5,   0, -10, -15, -20, -25, -30, ];
local num_arts = 10;

class WheelEntry extends ConveyorSlot
{
constructor()
{
base.constructor( ::fe.add_artwork( my_config["orbit_art"] ) );
}

function on_progress( progress, var )
{
local p = progress / 0.1;
local slot = p.tointeger();
p -= slot;

slot++;

if ( slot < 0 ) slot=0;
if ( slot >=10 ) slot=10;

m_obj.x = wheel_x[slot] + p * ( wheel_x[slot+1] - wheel_x[slot] );
m_obj.y = wheel_y[slot] + p * ( wheel_y[slot+1] - wheel_y[slot] );
m_obj.width = wheel_w[slot] + p * ( wheel_w[slot+1] - wheel_w[slot] );
m_obj.height = wheel_h[slot] + p * ( wheel_h[slot+1] - wheel_h[slot] );
m_obj.rotation = wheel_r[slot] + p * ( wheel_r[slot+1] - wheel_r[slot] );
m_obj.alpha = wheel_a[slot] + p * ( wheel_a[slot+1] - wheel_a[slot] );
}
};

local wheel_entries = [];
for ( local i=0; i<num_arts/2; i++ )
wheel_entries.push( WheelEntry() );

local remaining = num_arts - wheel_entries.len();

// we do it this way so that the last wheelentry created is the middle one showing the current
// selection (putting it at the top of the draw order)
for ( local i=0; i<remaining; i++ )
wheel_entries.insert( num_arts/2, WheelEntry() );

local conveyor = Conveyor();
conveyor.set_slots( wheel_entries );
conveyor.transition_ms = 50;
try { conveyor.transition_ms = my_config["transition_ms"].tointeger(); } catch ( e ) { }
}


// random number for the RGB levels

if ( my_config["enable_colors"] == "Yes" )
{
function brightrand() {
 return 255-(rand()/255);
}

local red = brightrand();
local green = brightrand();
local blue = brightrand();

// Color Transitions
fe.add_transition_callback( "color_transitions" );
function color_transitions( ttype, var, ttime ) {
 switch ( ttype )
 {
  case Transition.StartLayout:
  case Transition.ToNewSelection:
  red = brightrand();
  green = brightrand();
  blue = brightrand();
  filter.set_rgb(red,green,blue);
  textm.set_rgb (red,green,blue);
  textc.set_rgb (red,green,blue);
  textt.set_rgb (red,green,blue);
  snap_overlay.set_rgb (red,green,blue);
  break;
 }
 return false;
}
}
 

There aren't any enhancements, just bug fixes for the multi videos and also corrections to use emulators that have spaces in the names.
« Last Edit: January 30, 2017, 05:21:12 PM by progets »

akafox

  • Hero Member
  • *****
  • Posts: 985
    • View Profile
Re: Video snaps playing sound twice?
« Reply #4 on: January 30, 2017, 08:43:59 PM »
Well that explains why it works on my PC fine and not the pi..I got the one for my pc from the thread..the bug must be in the "pi version" I missed your fix somehow.

thanks progets
People want life easy..then complain about it