Daemons and audio output

Hi all,

I'm writing a Linux C++ program to drive son external devices.
All seems to work correctly working as daemon, but no audio output I found as expected.
Instead, the same code, executed as main process, produces audio output too.

Any idea about differences for audio output when it is produced from a main process or a daemon?
In my case the audio output is a call to speechdispatcher: i see in my log file that speechdispatcher is correctly called and it raise the event of end speech, so all seems works fine apart no audio output.
There are no HW problems: same code inside a main process works fine.

Thanks a lot and Regards,
Roberto
How about spawning a new process to produce audio output and communicate with it from the daemon ?

I think a Linux daemon is the equivalent of a Windows service, if it is so then the daemon (service) cis running even if no user is logged in.
Uhm...
I'm logged (as root) when I start my daemons and I remaining logged to monitor the log produced (I use the same shell inside I've launched daemon).

My detailed problem is:
a) I'm building a Visually Impaired Guide Enhanced Robot
b) I've a lot of asynchronous signals I receive from external devices
c) I need an asynchronous engine to manage that signals and drives output commands

So... As preliminary step I have a GPS module attached to my notebook and I successful receive GPS attach event and coordinates. Then I call geonames.org Web Service to compute a reverse geocoding and obtain the current address (and all is correctly logged).
When I build the text to be spoken and I pass it to speechdispatcher through a timer event, speechdispatcher really speak my text (I receive the end speak event), but I no hear any sound (and this only if program is running as daemon, as normal process all works fine).

So, if I understand what you mean, you're telling me, to no call speechdispatcher directly but move the code I use to make speechdispatecher working inside a different process called by daemon.
I think I'll be able to do so. But I don't understand the difference between calling directly speechdispatcher or using another process. It's only a SW layer that I interpose between my daemon and speechdispatcher. Do you think it could solve my problem since the calling context is changed?

Thanks a lot,
Roberto

P.S.
I put here my complete source code:
https://docs.google.com/file/d/0B4-TVcT4J-SDaXJYMTB0RUZSRm8/edit
Last edited on
Doh!
Seems it was a speech-dispatcher process wrong method to initialize...
speech-dispatcher needs to be not a stay resident process, but a called process (eventually initialized if not yet running).
I discover it, un-installing, then re-installing espeak, pulseaudio, speech-dispatcher and using default configuration for each module.

It works! :-D
Last edited on
Topic archived. No new replies allowed.