Your Digital Media Has Never Looked So Good

 
Mr. Medion
Topic Author
Posts: 1
Joined: Tue Nov 17, 2009 3:10 am

HD1010+Expander EM100 - sample scripts added

Fri Jan 08, 2010 2:47 am

Hallo together

I have a BrightSign Player HD 1010 and a Expander Board EM 100. Now i want to use both USB, the Audio Outputs ( not the Optical Output) and the 25-Pin-GPIO Control. Whats with the DIP Switch? I have downloaded and installed the Beta Firmware 3.2.53 for the HD 1010. I conected the expander board with the HD 1010 over USB1, but it doesn't work. BTW: I couldn't find a manual on the BrightSign-Webpage!!


Thanks for your Help


Mr. Medion
 
RokuLyndon

Fri Jan 08, 2010 7:43 am

I'm attaching a draft of the hardware guide for the 25pin input. I've also added some sample scripts using the expander at the bottom of this reply.

Currently, the expander isn't supported in BrightAuthor, but works with playlists, csv files, and scripting of course.

What are the audio limitations on Monaco?
1. HDMI and onboard analog run at the same sample rate. That means that if you want to play a video clip with 48kHz AC3 out HDMI, then your MP3 files for onboard analog output should be 48kHZ too.

2. No AC-3 decode
3. No limit on where simultaneous streams are played to - different sample rates and formats can be sent to each expander output e.g. video MP2 at 48kHz to one, MP3 44.1kHz to the others.

4. Simultaneous playback of 1 video stream and up to 3 audio streams is the current limit, though it is dependent on a number of factors like video bitrate. The 3 audio streams here includes one for the video if there is one, which means that only 2 MP3s could be played at the same time as a video.


SetAudioOutput(roInt audioout)
In a playlist, this is the "audiooutput" keyword. In a csv file, this would be "videoplayeraudiooutput" or "audioplayeraudiooutput".
The audio outputs are similar, though not identical to HD2000.
0 - Analog. Output to onboard analog output or one of the 3 expander analog outputs.
1 - USB. Output to USB audio, this is largely untested as yet.
2 - Digital PCM. For playing decoded audio to either HDMI or expander SPDIF e.g. decoded MP3 files
3 - Digital raw. For playing undecoded audio to either HDMI or expander SPDIF e.g. AC-3
4 - Simultaneous onboard digital and onboard analog. I'm not aiming to do this for expander, only for onboard audio.


MapStereoOutput(roInt stereo_mapping)
This picks which analog stereo output is used from the 4 available:
0 - Onboard analog jack
1 - Expander left jack
2 - Expander centre jack
3 - Expander right jack


MapDigitalOutput(roInt hdmi_or_spdif)
This is new and isn't currently listed in csv files or playlists. But, this can be fixed easily.
This picks which digital output is used from the 2 available:
0 - HDMI
1 - Expander SPDIF


Power Adapter Use:
We recommend always using the included power adapter.


Dipswitches:
We have 8 DIP switches 1-8. Switches 6,7 and 8 control analog output mode, you can switch between Line Driver mode

(2Vrms, 600Ohm) and Headphone Mode (1.7Vrms, 16Ohm load)

The other DIP switches don’t do anything; however, their state can be read with BrightScript.

Image
HardwareGuide.pdf

Sample Expander Scripts
Please rename the script to "autorun.brs" before copying to your flash card.

 
daniel_f
Posts: 5
Joined: Tue Mar 30, 2010 2:59 am

Re: HD 1010 with Expander Board EM 100

Mon May 03, 2010 5:22 am

I am using the HD1010 with the expander board as well.

As described above - brightauthor 2 doesn´t support the em100 - is there a sample of how to use the 18 GPIO as Inputs?

Example 1:
Button 1 plays "clip01.ts"
Button 2 plays "clip02.ts" ....

Example 2:
Button 1 plays "playlist01"
Button 2 plays "playlist02"...

is there an easy way to modify the brightauthor .brs and .xml files ? or do i have to do the scripting manually ?

thanks in advance for your help
 
hozencool
Posts: 8
Joined: Tue Nov 09, 2010 6:33 pm

Re: HD1010+Expander EM100 - sample scripts added

Tue Nov 09, 2010 6:49 pm

Your "Select a video and two accompanying audio files to play at the same time; select via serial command" works great. anyway I can use gpio instead of serial I cant seem to get the syntax right. any help would be great. heres what ive got so far.

'****** CREATE MESSAGE PORTS ******
p = CreateObject("roMessagePort")
tmr = CreateObject("roMessagePort")
sp = CreateObject("roMessagePort")

'****** CREATE GPIO PORT ******
gpio = CreateObject("roGpioControlPort")
gpio.SetPort(p)
gpio.EnableInput(0)
gpio.EnableInput(1)
gpio.EnableInput(2)
gpio.EnableInput(3)
gpio.EnableInput(4)
gpio.EnableInput(5)
gpio.EnableOutput(6)
gpio.EnableOutput(7)

'****** CREATE TIMER ******
st = CreateObject("roSystemTime")
Timer = CreateObject("roTimer")
Timer.SetPort(p)

'****** CREATE SERIAL PORT ******
serial = CreateObject("roSerialPort",0,4800)
serial.SetLineEventPort(p)



'****** AVAILABLE AUDIO SETTINGS ******
' ANALOG OUTPUT VALUES:
' 0 - Analog audio
' 1 - USB Audio
' 2 - SPDIF audio, stereo PCM
' 3 - SPDIF audio, raw AC3
' 4 - Analog audio with SPDIF mirroring raw AC3

' AUDIO MODE VALUES:
' 0 - AC3 Surround
' 1 - AC3 mixed down to stereo
' 2 - No audio
' (Options 0 & 1 only apply to video files, 2 applies to all audio sources)

' MAPPING VALUES:
' 0 - Stereo audio is mapped to HD810 analog output
' 1 - Stereo audio is mapped to Expander Audio 1 (left) if Expander is present
' 2 - Stereo audio is mapped to Expander Audio 2 (middle) if Expander is present
' 3 - Stereo audio is mapped to Expander Audio 3 (right) if Expander is present

' VOLUME SETTING RANGE:
' 0 = lowest to 100 full volume

'****** VIDEO MPEG FILE SETTINGS ******
video = CreateObject("roVideoPlayer")
video.SetPort(p)
vm = CreateObject("roVideoMode")
vm.SetMode ("1920x1080x29.97p")
video.SetAudioOutput(3)
video.SetAudioMode(0)      
video.MapDigitalOutput(0)       
video.SetVolume(100)      


'****** AUDIO MP3 FILE SETTINGS ******
audio = CreateObject("roAudioPlayer")
audio.SetPort(p)
audio.SetAudioOutput(0)      
audio.SetAudioMode(2)      
audio.MapStereoOutput(2)   
audio.SetVolume(100)      

'****** IMAGE SETTINGS ******
image = CreateObject("roImagePlayer")
ok = image.SetDefaultMode(1)     'SET INITIAL IMAGE SCALING
ok = image.DisplayFile("black.png")

Print "System started."

event_loop:
   msg = wait(0, p)
        if type(msg)="roStreamLineEvent" then buttonpress
        goto event_loop

buttonpress:
   tm = msg
        If tm = "E" Then      'Start English
      ok = video.Stop()
           ok = image.StopDisplay()
           ok = audio.Stop()
      gpio.SetOutputState(6,1)   'English Feedback Light
      
      '*********** Put Video Filename in the quotes below *************
                ok = video.PlayFile("RIVER_ENG.ts")
      '****************************************************************

                If ok = 0 Then Print "Unable to read video file.": GoTo event_loop
                Print "Movie started from button panel."
      
      msg = wait(100, tmr)   'Delay in ms to sync MP3 file playback with video.
      ok = audio.PlayFile("ENG_AD.mp3")   'used as a place holder
      If ok = 0 Then
         Print "Unable to read audio description file."
      else
                   Print "Audio Description audio started."
      endif
      timeout = st.GetLocalDateTime()
                Print timeout

      '*********** Put program length in seconds in the parenthesis below ******
                timeout.AddSeconds(607)    'Number of seconds from start of movie until end
      '*************************************************************************
               
      Timer.SetDateTime(timeout)
                timer.Start()
                Print timeout
                GoTo clear_events
        EndIf
        If tm = "S" Then      'Start Spanish
      ok = video.Stop()
           ok = image.StopDisplay()
           ok = audio.Stop()
      gpio.SetOutputState(7,1)   'Spanish Feedback Light
      
            
      '*********** Put Video Filename in the quotes below *************
                ok = video.PlayFile("RIVER_SPA.ts")
      '****************************************************************

                If ok = 0 Then Print "Unable to read video file.": GoTo event_loop
                Print "Movie started from button panel."
      
      msg = wait(100, tmr)   'Delay in ms to sync MP3 file playback with video.
      ok = audio.PlayFile("SPA_AD.mp3")   'used as a placeholder
      If ok = 0 Then
         Print "Unable to read audio description file."
      else
                   Print "Audio Description audio started."
      endif
      '*********** Put program length in seconds in the parenthesis below ******
                timeout.AddSeconds(607)    'Number of seconds from start of movie until end
      '*************************************************************************
               
      Timer.SetDateTime(timeout)
                timer.Start()
                Print timeout
                GoTo clear_events
                GoTo clear_events
        EndIf
   GoTo event_loop
       
clear_events:
   msg = wait(0, p)
        if type(msg) = "roTimerEvent" then
                Print "lights up."
                GoTo Clear_events
        EndIf
        if type(msg) = "roVideoEvent" then
                If msg.GetInt() = 8 Then
                        Print "Movie has ended."
         Print "lights up."
         ok = image.DisplayFile("black.png")
         gpio.SetOutputState(6,0)   'turn off feedback english
         gpio.SetOutputState(7,0)   'turn off feedback spanish
                        GoTo event_loop
      EndIf
        EndIf
   if type(msg)="roStreamLineEvent" then
      tm = msg
      If tm = "R" Then
         print "Stop button pushed."
         Print "lights up."
         ok = video.Stop()
              ok = image.StopDisplay()
              ok = audio.Stop()
         Timer.Stop()
         gpio.SetOutputState(6,0)   'turn off feedback english
         gpio.SetOutputState(7,0)   'turn off feedback spanish
         ok = image.DisplayFile("black.png")
         GoTo event_loop
      EndIf
   EndIf
        GoTo clear_events
 
 
DpaulCOSI
Posts: 16
Joined: Tue Jun 29, 2010 12:50 pm

Re: HD 1010 with Expander Board EM 100

Tue Nov 16, 2010 7:20 am

daniel_f wrote:
I am using the HD1010 with the expander board as well.

As described above - brightauthor 2 doesn´t support the em100 - is there a sample of how to use the 18 GPIO as Inputs?

...

is there an easy way to modify the brightauthor .brs and .xml files ? or do i have to do the scripting manually ?

thanks in advance for your help


This post was a while back, but I had wondered the same thing (Could you modify the .nrs files and .xml files output by BrightAuthor to make use of the expander GPIO?). The answer is YES and here is how:

Use BrightAuthor to do the things its good at (basically make your project as much as it will let you). Its not going to let you assign a GPIO past 7, so either use a number it will let you for now (like 0, as a placeholder), or just go back later and change it, whatever works for you. When you get as far as it will let you, publish the files like you normally would.

We will look at the .brs file first...
You need to set up the expander GPIOs, there will be a line in your autorun.brs file that says this:
    BSP.gpioPort = CreateObject("roGpioControlPort")

It needs to say this:
    BSP.gpioPort = CreateObject("roControlPort", "Expander-GPIO")


Further down in that same file you will see:
    Sign.gpio0Config = BrightAuthor.meta.gpio0.GetText()
    if Sign.gpio0Config = "input" then
        gpioPort.EnableInput(0)
    else
        gpioPort.EnableOutput(0)
    endif

You need to create this bit of code for every GPIO you use, just replace "0" with the input/output number.

On to the .xml file...
Under <meta> you should see some lines like this:
    <gpio0>output</gpio0>
    <gpio1>output</gpio1>...

(Mine are outputs but it works both ways, just change "output" to "input")
Again, you need a line like this for every GPIO you want to use. Here is mine for all 18 GPIOs, again, as outputs:
 <gpio0>output</gpio0>
    <gpio1>output</gpio1>
    <gpio2>output</gpio2>
    <gpio3>output</gpio3>
    <gpio4>output</gpio4>
    <gpio5>output</gpio5>
    <gpio6>output</gpio6>
    <gpio7>output</gpio7>
    <gpio8>output</gpio8>
    <gpio9>output</gpio9>
    <gpio10>output</gpio10>
    <gpio11>output</gpio11>
    <gpio12>output</gpio12>
    <gpio13>output</gpio13>
    <gpio14>output</gpio14>
    <gpio15>output</gpio15>
    <gpio16>output</gpio16>
    <gpio17>output</gpio17>


Next, go through the .xml code and either change your dummy inputs/outputs that you created in Bright author, or write new lines with the higher number GPIOs that you need.

I have done this a bunch of times now, and as always spent some time in trial and error in the beginning. I thought this might help anyone with similar problems. Also, the pin out is wrong for the expander, GPIO 16 and 17 are switched. Let me know if you need me to clarify anything.

-Dylan

Who is online

Users browsing this forum: No registered users and 2 guests