VMU and beep

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
User avatar
Newbie
Insane DCEmu
Insane DCEmu
Posts: 171
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sat Jul 27, 2013 1:16 pm
Has thanked: 0
Been thanked: 0

VMU and beep

Post by Newbie »

I have tried to use the function vmu_beep_raw to make VMU singing some beeps ...
But as explained in KOS, the parameter to use is a integer which is not documented.
I try some integer values but nothing happens.

Is someone succeeded ?

Thanks for your help.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: VMU and beep

Post by BlueCrab »

User avatar
Newbie
Insane DCEmu
Insane DCEmu
Posts: 171
Joined: Sat Jul 27, 2013 1:16 pm
Has thanked: 0
Been thanked: 0

Re: VMU and beep

Post by Newbie »

Ok i have tested the bin included in the archive.

It makes sound for value 0x000065F0, but there is a warning :
Warning: I'm not sure the effect this will have on the
VMU's internal clock. I recommend re-syncing the clock
after testing.
As i want to beep at any VMU access is that dangerous for user hardware ?

Also there is in the source code this :

Code: Select all

if(genwait_wait(&dev->frame, "vmu_beep_raw", 500, NULL) < 0) 
i found in Kos this :

/** \brief Sleep on an object.

This function sleeps on the specified object. You are not allowed to call
this function inside an interrupt.

\param obj The object to sleep on
\param mesg A message to show in the status
\param timeout If not woken before this many milliseconds have
passed, wake up anyway
\param callback If non-NULL, call this function with obj as its
argument if the wait times out (but before the
calling thread has been woken back up)
\retval 0 On successfully being woken up (not by timeout)
\retval -1 On error or being woken by timeout

\par Error Conditions:
\em EAGAIN - on timeout
*/
Is the message important to keep in genwait_wait function i mean the "vmu_beep_raw" ?
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: VMU and beep

Post by BlueCrab »

The vmu_beep_raw() function in that code is pretty much exactly the same as the function included in KOS. I was only pointing to that topic for what little general information has been given on the subject.

You shouldn't have to worry about the clock at all. You won't reset it by using the vmu_beep_raw() function. I think that comment was only there because nobody had tested it with a VMU with working batteries in it to see if it changed anything. I can assure you, it doesn't.

One last note, you shouldn't mess around with the way the function is written in general. The wait is there to ensure that you don't try to send multiple commands to the device per frame, which would very likely screw at least one of them up (i.e, you try to send a command to write data to the memory card, then you try to send a beep command -- if both are sent in the same frame, the first one will never happen in all likelihood -- the waits are there to protect against that).

For what you want to do, just send a vmu_beep_raw() before you try to write to the card, then send another with a value of 0 to stop the beeping when you're done. That said, you might want to be careful in doing that, since it can be quite annoying to the user to hear that awful beeping sound. :wink:
User avatar
Newbie
Insane DCEmu
Insane DCEmu
Posts: 171
Joined: Sat Jul 27, 2013 1:16 pm
Has thanked: 0
Been thanked: 0

Re: VMU and beep

Post by Newbie »

Ok, it sounds better with value 0x000065f0.
User avatar
Quzar
Dream Coder
Dream Coder
Posts: 7497
Joined: Wed Jul 31, 2002 12:14 am
Location: Miami, FL
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: VMU and beep

Post by Quzar »

The reason that the vmu_beep_raw has a comment about the clock is that the tone generator is actually part of the clock device in the VMU, so I reasoned some of the functions might serve to change clock params. Since the clock isn't well defined in KOS I wanted to make sure to note that some combo might have to do with time instead of beeps.
"When you post fewer lines of text than your signature, consider not posting at all." - A Wise Man
Post Reply