OBJ File Causes Noise.
Chad1
Posts: 26
Hi all,
I'm working on a project that uses a Propeller, a microSD card, a cheap 0.25W speaker (with LM386 audio amplifier), and the WAV-Player_DACEngine.spin object file (attached). Everything works fine, but there's an annoying issue I'd like to work around. For simplicity, let's say my program waits for the user to press a button which triggers an audio clip to play. Otherwise nothing happens.
My Issue:
When my program runs, even before the button is pushed to trigger audio, the speaker emits some noise. The noise disappears when I comment out the WAV-Player_DACEngine.spin file in the OBJ declaration section. Obviously this means all audio capabilities are killed, but the point is the noise is related to the inclusion of the WAV-Player_DACEngine.spin file in the program.
My Goal:
Avoid the object file being used continuously from power-up to power-down. It needs to be leveraged only when audio is required, not while waiting for a button press. This will also help optimize the power consumption of my project.
My Question:
When waiting for a button press, I'd like the speaker system off/unused. Can someone help me implement this solution, or suggest ideas on how to implement one (in Spin)? I'm a relative novice, so my first ideas may be unrealistic or inefficient. My first thought is to not declare the WAV-Player_DACEngine.spin object file in the main program, rather in a separate file which is accessed by the main program on my command.
Thanks!
I'm working on a project that uses a Propeller, a microSD card, a cheap 0.25W speaker (with LM386 audio amplifier), and the WAV-Player_DACEngine.spin object file (attached). Everything works fine, but there's an annoying issue I'd like to work around. For simplicity, let's say my program waits for the user to press a button which triggers an audio clip to play. Otherwise nothing happens.
My Issue:
When my program runs, even before the button is pushed to trigger audio, the speaker emits some noise. The noise disappears when I comment out the WAV-Player_DACEngine.spin file in the OBJ declaration section. Obviously this means all audio capabilities are killed, but the point is the noise is related to the inclusion of the WAV-Player_DACEngine.spin file in the program.
My Goal:
Avoid the object file being used continuously from power-up to power-down. It needs to be leveraged only when audio is required, not while waiting for a button press. This will also help optimize the power consumption of my project.
My Question:
When waiting for a button press, I'd like the speaker system off/unused. Can someone help me implement this solution, or suggest ideas on how to implement one (in Spin)? I'm a relative novice, so my first ideas may be unrealistic or inefficient. My first thought is to not declare the WAV-Player_DACEngine.spin object file in the main program, rather in a separate file which is accessed by the main program on my command.
Thanks!
Comments
1) It's recommended to build better audio filter.
2) Try to stop DAC engine. PWM output allways make noise.
3) Try to stop FAT engine. Interference from SD card goes to audio lines.
I use my own WAV driver (object and demo that runs on PAB is attached). There is a parameter for Chip's STEREO_DACS cog that lets you control how much extra noise to add. I have found this needs to be tuned per application. This will all go away with the next generation Propeller which has DACs built in.
The LM386 is not a great amp and can do all kinds of wild things if not handled delicately. For example, the one on my old PDB will pick up a local radio station at times -- it's wacky. For a commercial product that EFX-TEK is developing for a client we are using the TDA7052A which has better power and a volume control input that we use as a mute pin. The circuit set-up defaults to un-muted (if you don't have a spare pin for mute); to mute the amp, take the MUTE line high. We're very happy with the result; when the mute pin is high the speaker is dead quiet.
Is there noise when the object is left but not started? Just having the object listed in the OBJ section shouldn't be causing noise. I'd think you'd have to start the object for it to affect the sound output.
Yes, the noise occurs when the file is included and never used. I agree it seems like that shouldn't happen, so that's why I'm a bit stumped on how to proceed.
If you post your code, someone might be able to figure out the issue.
The noise is rather quiet in volume and is just one continuous high pitch with some soft fuzz behind it. It's not a big deal, but it's annoying to know I'm burning power unnecessarily. Sorry for the false alarm. I appreciate the thoughts and advice!