perfect! beep! is up and working fine. :) kudos .. my credit goes to you Colin for giving me directions... Thankyou once again :)<br><br>Best Regards,<br>Himanshu<br><br><br><div class="gmail_quote">On Thu, Jun 9, 2011 at 3:09 PM, Colin Guthrie <span dir="ltr"><<a href="mailto:gmane@colin.guthr.ie">gmane@colin.guthr.ie</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<br>
I think my first reply failed to send and couldn't find the text<br>
anywhere... Damn :(<br>
<br>
<br>
'Twas brillig, and Himanshu Chug at 09/06/11 07:18 did gyre and gimble:<br>
<div class="im">> I changed the sample role from proplist in play_beep( ) below:<br>
><br>
> static void play_beep(pa_core *core)<br>
> {<br>
> uint32_t idx;<br>
> pa_proplist *pl = pa_proplist_new ();<br>
> pa_proplist_sets(pl, PA_PROP_MEDIA_ROLE, "test");<br>
> pa_log ("DBG: %s: %d\n", __func__, __LINE__);<br>
> pa_scache_play_item(core, "beep", "alsa_output.hw_0_0",<br>
> PA_VOLUME_NORM, pl, &idx);<br>
> }<br>
<br>
</div>Ok some points.<br>
<br>
1) If you don't need the idx, just pass NULL. That's what other<br>
examples in the code tree do. Look at the other examples for inspiration<br>
here.<br>
<br>
2) You do not call pa_proplist_free() and thus this is leaky code.<br>
<br>
3) You pass a string when the function expects a pa_sink*. If you want<br>
to pass a name use pa_scache_play_item_by_name() instead. I'm very<br>
surprised the above even compiles. You will almost certainly have a<br>
pa_sink* when you call this function so I'd suggest using it. You may<br>
also want to chose a slightly less evil volume than PA_VOLUME_NORM, but<br>
this can obviously be tweaked later!<br>
<div class="im"><br>
> Here are the logs for segmentation fault:<br>
><br>
> D: module-augment-properties.c: Looking for .desktop file for<br>
> gst-launch-0.10<br>
> D: memblockq.c: memblockq requested: maxlength=33554432, tlength=0,<br>
> base=4, prebuf=0, minreq=1 maxrewind=0<br>
> D: memblockq.c: memblockq sanitized: maxlength=33554432,<br>
> tlength=33554432, base=4, prebuf=0, minreq=4 maxrewind=0<br>
> I: sink-input.c: Created input 1 "Playback Stream" on alsa_output.hw_0_0<br>
> with sample spec s16le 2ch 44100Hz and channel map front-left,front-right<br>
> I: sink-input.c: media.role = "event"<br>
</div>> I: sink-input.c: <a href="http://media.name" target="_blank">media.name</a> <<a href="http://media.name" target="_blank">http://media.name</a>> = "Playback Stream"<br>
> I: sink-input.c: <a href="http://application.name" target="_blank">application.name</a> <<a href="http://application.name" target="_blank">http://application.name</a>> =<br>
<div class="im">> "gst-launch-0.10"<br>
> I: sink-input.c: native-protocol.peer = "UNIX socket client"<br>
> I: sink-input.c: native-protocol.version = "16"<br>
> I: sink-input.c: <a href="http://application.process.id" target="_blank">application.process.id</a><br>
</div>> <<a href="http://application.process.id" target="_blank">http://application.process.id</a>> = "2465"<br>
<div class="im">> I: sink-input.c: application.process.user = "root"<br>
> I: sink-input.c: application.process.host = "(none)"<br>
> I: sink-input.c: application.process.binary = "gst-launch-0.10"<br>
> I: sink-input.c: application.language = "C"<br>
> I: sink-input.c: window.x11.display = ":0"<br>
> I: sink-input.c: application.process.machine_id = "(none)"<br>
> I: sink-input.c: <a href="http://module-stream-restore.id" target="_blank">module-stream-restore.id</a><br>
</div>> <<a href="http://module-stream-restore.id" target="_blank">http://module-stream-restore.id</a>> = "sink-input-by-media-role:event"<br>
<div class="im">> I: protocol-native.c: Requested tlength=200.00 ms, minreq=10.00 ms<br>
> D: protocol-native.c: Adjust latency mode enabled, configuring sink<br>
> latency to half of overall latency.<br>
> D: memblockq.c: memblockq requested: maxlength=4194304, tlength=19404,<br>
> base=4, prebuf=0, minreq=1764 maxrewind=0<br>
> D: memblockq.c: memblockq sanitized: maxlength=4194304, tlength=19404,<br>
> base=4, prebuf=0, minreq=1764 maxrewind=0<br>
> I: protocol-native.c: Final latency 200.00 ms = 90.00 ms + 2*10.00 ms +<br>
> 90.00 ms<br>
> D: alsa-sink.c: Latency set to 90.00ms<br>
> D: alsa-sink.c: hwbuf_unused=115068<br>
> D: alsa-sink.c: setting avail_min=31855<br>
> *D: core-subscribe.c: Dropped redundant event due to change event.<br>
> E: module-cork-music-on-phone.c: DBG: play_beep: 62<br>
> E: core-scache.c: DBG: pa_scache_play_item: 314<br>
</div>> Segmentation fault*<br>
<br>
You need to get a backtrace. Logging is more or less useless sadly.<br>
<br>
Run gdb -p `pidof pulseaudio`, then call the handle line as noted on the<br>
wiki: <a href="http://pulseaudio.org/wiki/Community" target="_blank">http://pulseaudio.org/wiki/Community</a>, then use "continue" and<br>
trigger the crash. You'll then get a nice backtrace.<br>
<div><div></div><div class="h5"><br>
Col<br>
<br>
<br>
<br>
--<br>
<br>
Colin Guthrie<br>
gmane(at)<a href="http://colin.guthr.ie" target="_blank">colin.guthr.ie</a><br>
<a href="http://colin.guthr.ie/" target="_blank">http://colin.guthr.ie/</a><br>
<br>
Day Job:<br>
Tribalogic Limited [<a href="http://www.tribalogic.net/" target="_blank">http://www.tribalogic.net/</a>]<br>
Open Source:<br>
Mageia Contributor [<a href="http://www.mageia.org/" target="_blank">http://www.mageia.org/</a>]<br>
PulseAudio Hacker [<a href="http://www.pulseaudio.org/" target="_blank">http://www.pulseaudio.org/</a>]<br>
Trac Hacker [<a href="http://trac.edgewall.org/" target="_blank">http://trac.edgewall.org/</a>]<br>
<br>
_______________________________________________<br>
pulseaudio-discuss mailing list<br>
<a href="mailto:pulseaudio-discuss@lists.freedesktop.org">pulseaudio-discuss@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss" target="_blank">http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss</a><br>
</div></div></blockquote></div><br>