September 28, 2024, 09:08:40 AM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Need help with prop1 and vmusic2

Started by tugman, April 09, 2009, 04:59:03 PM

Previous topic - Next topic

JonnyMac

This program will play one of the files you listed -- it does not wait for a response from the VMUSIC.  I verified this program with one of the files on my player.

' =========================================================================
'
'   File......
'   Purpose...
'   Author....
'   E-mail....
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------


' -----[ Revision History ]------------------------------------------------


' -----[ I/O Definitions ]-------------------------------------------------

SYMBOL  RX              = 7                     ' SETUP = UP, no ULN
SYMBOL  TX              = 6                     ' SETUP = UP, no ULN


' -----[ Constants ]-------------------------------------------------------

SYMBOL  Baud            = OT2400


' -----[ Variables ]-------------------------------------------------------

SYMBOL  char            = B2


' -----[ Initialization ]--------------------------------------------------

Reset:
  PAUSE 3000                                    ' let VMUSIC power up


' -----[ Program Code ]----------------------------------------------------

Main:
  SEROUT TX, Baud, ("VPF ahoy.mp3", 13)
  PAUSE 10000
  GOTO Main


Jon McPhalen
EFX-TEK Hollywood Office

tugman

Jon, I tried this and it still doesn't play.

The vmusic flashes on start up and the jump drive flashes on start up.

Then the jump drive flashes briefly every 10 seconds but no sound

I tried a second vmusic that I have and it does the same thing.

I have the jumper on the vmusic  outside pins  on the side closest to the connector black ground wire that is correct insn't it?  I have never moved these that's the way it came and according to the directions I've read this is correct.  Some thing has to be wrong and it has to be something I keep overlooking.

The jumper on the insde, the one you have to move to flash it is on the front set of pins. I can't think of anything else to check.

JonnyMac

Did you say you had it working with some piece of code?  If yes, please show that to me.

For serial control the jumper should be oriented toward the outside (away from the wiring harness that connects tot he Prop-1).  I have updated the connection drawing (see the sticky thread) to explicitly show this.
Jon McPhalen
EFX-TEK Hollywood Office

tugman

Yes, that's the way I have it.  Here is the code that I can get to work...


' =========================================================================
'
'   File....... vm2_bs1_demo.bs1
'   Purpose.... Demonstrate VMusic2 driven by a BASIC Stamp 1 or Prop-1
'   Author..... Scary Terry
'   E-mail..... terry@scary-terry.com
'   Started.... 4/0/2008
'   Updated.... 4/9/2008
'
'   {$STAMP BS1}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
' Sends serial commands to the VMusic2 via the RXD input.  The following are the individual commands
' (note that 13 is a "carriage return):
' VPF file 13   Plays single file where "file" is MP3 name, MAXIMUM 8 CHARACTERS PLUS EXTENSION (8.3)
' VST 13        Stops play
' V3A 13        Plays all MP3 files
' VRA 13        Repeatedly plays all MP3 files
' VRR 13        Repeatedly plays random MP3 files
' VSF 13        Skip forward one track
' VSB 13        Skip back one track
' VP 13         Pause
' VSV byte 13   Sets playback volume, 0 loud, 250 off

'Also receives serial data from VMusic2 via the TXD output.  I've found about the only useful thing it
'sends is the word "Stopped" at the end of a playback file.

' -----[ Revision History ]------------------------------------------------

' -----[ I/O Definitions ]-------------------------------------------------

' -----[ Constants ]-------------------------------------------------------
SYMBOL Baud = T2400                          'The baud rate we'll be using is TRUE 2400

' -----[ Variables ]-------------------------------------------------------

' -----[ EEPROM Data ]-----------------------------------------------------


' -----[ Initialization ]--------------------------------------------------
PAUSE 4000                                   'allow VMusic2 to initialize
SEROUT 6,Baud, ("VST",13)                    'stop anything that's playing
' -----[ Program Code ]----------------------------------------------------

Main:

SEROUT 6,Baud,("VPF test.mp3",13)           'Play a file named "test.mp3"
PAUSE 10000
SEROUT 6,Baud,("VP",13)                     'Pause playback of "test.mp3"
PAUSE 2000
SEROUT 6,Baud,("VP",13)                     'Resume playback of "test.mp3"
PAUSE 5000
SEROUT 6,Baud, ("VSV 30",13)                'Reduce playback volume
PAUSE 3000
SEROUT 6,Baud, ("VSV 0",13)                 'Return playback volume to full
PAUSE 4000
SEROUT 6,Baud, ("VST",13)                   'Stop playback of "test.mp3"

SEROUT 6,Baud, ("V3A",13)                   'Command to play all mp3 files.  It will play whatever file it first finds
PAUSE 10000
SEROUT 6,Baud, ("VSF",13)                   'Skip forward one track.  It will play the next file
PAUSE 4000
SEROUT 6,Baud, ("VSB",13)                   'Backs up to the start of this track.
PAUSE 4000
SEROUT 6,Baud, ("VST",13)                   'Stop playback

SEROUT 6,Baud,("VPF test2.mp3",13)          'Play a file named "test2.mp3"
PAUSE 2000                                  'necessary for timing purposes
SERIN 7, T2400, (">")                       'Waits for "test2.mp3" to stop playing.  VMusic2 sends ">" character at end of file.
PAUSE 2000

GOTO Main
END
' -----[ Subroutines ]---

JonnyMac

The only difference I can see is the baud (I'm using Open, Terry is not) and the power-up delay.  Change the baud in my little demo to T2400 and the delay after reset to 4000.  If that works we'll eliminate one to see what's causing the problem.
Jon McPhalen
EFX-TEK Hollywood Office

tugman

I changed those parameters and no luck.

Tried Terry's code again just now and it still plays.

The only thing I can tell you about Terry's code is that it is 28 seconds before it starts playing after you power up.

I tried waiting on the code you wrote for the one play, waited 7 minutes and nothing.

I know it makes no sense?

JonnyMac

Okay, there is NO WAY you should have to wait 28 seconds before you hear something -- my unit plays after the normal delay (~3 seconds).  What I suggest you do is remove the firmware file from the drive as it's already "flashed" for 2400 baud.  If Terry's program starts right up for you then try mine again.
Jon McPhalen
EFX-TEK Hollywood Office

tugman

Are you talking about the ftdrb.ftd file that's on the jump drive?

JonnyMac

Yes, that only needs to be there to "re-flash" the player, after that it isn't needed.  I'm specualting that your device is reflashing itself on every power-up, hence the 28-second delay.

In the FWIW category... I was just over at a friend's house and he showed me this Prop-1/VMUSIC setup working perfectly (using the connections and code in this thread); so it can be done -- we just have to find the gremlins in your system.
Jon McPhalen
EFX-TEK Hollywood Office

tugman

I removed the file from the jump drive and it does the same thing, 28 seconds for Terry's and no sound from your code just a quick flash of the led on the jump drive and vmusic every 10 seconds.

JonnyMac

I think you have a bad player. 

If when running my program you're seeing the VMUSIC light flash every 10 seconds that means it is seeing the command, it's just not playing the file.  And with Terry's code it should start playing the first file after 5 seconds so, technically, it is NOT working with Terry's code because the VMUSIC is not working with the Prop-1 as intended.
Jon McPhalen
EFX-TEK Hollywood Office

tugman

I have 2 players and they both do the same thing.  Now I know that doesn't mean that they aren't both bad but that would be a stretch, could be though.

JonnyMac

At the risk of irritating you (again), I don't know what else to suggest.  Th code I've provided works me and for others; neither my code nor Terry's works properly on your system.  The common denominator is... your system.  I'm at a loss and other than you shipping one of your players to me to check, I don't know what else to do.
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

Just a thought... have you tried a different thumb drive?  Get one as small as possible and not one of the "smart" units that wants to act like an actual disc drive.  Maybe you have a smart thumb drive that is trying to talk to the VMUSIC as if it's a PC -- I had one of these once and it didn't work with the VMUSIC at all.
Jon McPhalen
EFX-TEK Hollywood Office

tugman

I have 2- 128MB thumb drives that I have tried but they are both the same.  I found an old 1 gig thumb drive and tried it.  It didn't play either but sure looked like it was trying.  Every 10 seconds the thumb drive would flash a lot, like it was playing but I still couldn't hear anything.   The other 2 just briefly flashed once every 10 seconds. I tried the 1 gig  drive with Terry's code and it still doesn't start for 28 seconds.  If you don't mind me sending one or both of these VM's for you to check that would be fine with me.  At least that way I would know for sure if the VM's are good or bad.  I'll gladly pay postage both ways.  If so let me know where to send it. Thanks