• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: VWR-11759
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Tofu Linden
Reporter: Iskar Ariantho
Votes: 6
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
1. Second Life Viewer - VWR

SVN-108641 Linux stopped playing streams

Created: 27/Jan/09 02:47 PM   Updated: 22/Jul/09 02:24 PM
Return to search "1.21 Issues"
Component/s: Sound
Affects Version/s: Source code, 1.22 Release Candidate, 1.22
Fix Version/s: 1.23 Release Candidate, 1.23

Time Tracking:
Not Specified

File Attachments: 1. Text File foo2.patch (5 kB)
2. File gstreamer-fix.diff (2 kB)

Environment:
Second Life 1.22.0 (108641) Jan 27 2009 14:18:07 (Developer)
You are at 248001.0, 313151.1, 950.0 in Delphinium Island located at sim4589.agni.lindenlab.com (63.210.158.239:13000)
CPU: Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz
Memory: 2026 MB
OS Version: Linux 2.6.18-92.1.22.el5 #1 SMP Tue Dec 16 12:03:43 EST 2008 i686
Graphics Card Vendor: NVIDIA Corporation
Graphics Card: GeForce Go 7700/PCI/SSE2
OpenGL Version: 2.1.2 NVIDIA 180.22

libcurl Version: libcurl/7.16.4 OpenSSL/0.9.7c zlib/1.2.3 c-ares/1.4.0
J2C Decoder Version: OpenJPEG: 1.3.0, Runtime: 1.3.0
Audio Driver Version: OpenAL, version 1.1 / OpenAL Community / OpenAL Soft: ALSA Software on default
LLMozLib Version: [LLMediaImplLLMozLib] - 2.01.21336 (Mozilla GRE version 1.8.1.18_0000000000)
Packets Lost: 75/116476 (0.1%)
Issue Links:
Duplicate
 
Relates

Last Triaged: 04/Feb/09 10:15 AM
Linden Lab Issue ID: DEV-27056
Patch attached: Patch attached
Linden Lab Internal Branch: maint-viewer-14


 Description  « Hide
Voice works perfectly, normal sounds in SL are also to be heard and enjoyed, streams stopped dead in their tracks.

Yes, i have the needed modules to play mp3s under gstreamer, infact i now listen to streams by pasting the url into totem, a gstreamer player.

Logging doesnt show a thing. even made DEBUGMSG a STDERRMSG, which now shows me it constructs the stream, and after that its just
updateMeiua:430: updating media...
updateMedia:436: dead media...
ad infinium..



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Iskar Ariantho added a comment - 03/Feb/09 05:16 AM - edited
Same things now happens with the branch/viewer-1.22, svn 109348 version. (obviously, as it seem to have gotten merged from the other branch, picking up the same issue.)

Alexa Linden added a comment - 03/Feb/09 09:39 AM
Can you please provide us with reproducible steps and an example stream URL?

Iskar Ariantho added a comment - 04/Feb/09 12:33 AM - edited
Its easy. go to ANY land with a stream active and press play. You will be greeted with silence. Example stream: http://scfire-dtc-aa01.stream.aol.com:80/stream/1003

BTW, i have traced the issue down to a failing call to gst_init_check(NULL,NULL,NULL) at llmediaimplgstreamer.cpp:196. No idea why it fails tho. As said, totem and even gst_launch have no issues.

I'm running on a pretty stock Centos 5.2 system, with gstreamer 0.10.9 (with an added gstreamer-ffmpeg-0.10.2 to be able to play mp3 streams)

Note. i was able to bypass the entire gstreamer issue by setting LL_BAD_OPENAL_DRIVER, making it fall back to the working fmod. This however does not constitute as a proper fix in my opinion. There still is an issue in the gstreamer setup sequence somewhere...


Iskar Ariantho added a comment - 04/Feb/09 12:49 AM
Oh, while browsing idly on the internet, i found out its possible to set GST_DEBUG to have gstreamer be a bit more verbose over its internal workings.... This is the snipped from the screen that might be of interest:

=====================
grab_gst_syms:81: Found DSO: libgstreamer-0.10.so.0
grab_gst_syms:40: Failed to grab symbol: gst_segtrap_set_enabled
grab_gst_syms:41: Failed to grab symbol: gst_message_parse_buffering
grab_gst_syms:42: Failed to grab symbol: gst_message_parse_info
grab_gst_syms:94: Found DSO: libgstaudio-0.10.so.0
grab_gst_syms:108: Found DSO: libgstvideo-0.10.so.0
startup:191: gst_segtrap_set_enabled() is not available; Automated crash-reporter may cease to function until next restart.
INFO (0xae593658 - 0:00:00.000165000) GST_INIT(10765) gst.c(510):init_pre: Initializing GStreamer Core Library version 0.10.9
INFO (0xae593658 - 0:00:00.000240000) GST_INIT(10765) gst.c(511):init_pre: Using library installed in /usr/lib
INFO (0xae593658 - 0:00:00.000329000) GST_INIT(10765) gstquery.c(101):_gst_query_initialize: init queries
INFO (0xae593658 - 0:00:00.001543000) GST_INIT(10765) gstmessage.c(72):_gst_message_initialize: init messages
INFO (0xae593658 - 0:00:00.002851000) GST_PLUGIN_LOADING(10765) gstplugin.c(182):_gst_plugin_register_static: loaded static plugin "staticelements"
INFO (0xae593658 - 0:00:00.096187000) GST_REGISTRY(10794) gstregistryxml.c(572):gst_registry_xml_read_cache: loaded /root/.gstreamer-0.10/registry.i686.xml in 0.083507 seconds
ERROR (0xae593658 - 0:00:00.108149000) GST_INIT(10765) gst.c(689):ensure_current_registry_forking: error during waitpid: No child processes
startup:198: GST init failed for unspecified reason.
=====================

It seems forking is somehow prohibited? Maybe gst_registry_fork_set_enabled() might help here, but by the looks of it, that isnt supported in my older 10.9 version of gstreamer. Yuck.


Iskar Ariantho added a comment - 04/Feb/09 01:51 AM - edited
Ok, got it nailed. The attached patch fixes the issue. It turned out there is a race condition where gst_init_check forks and waitpids on the result, but the in llcommon/llapp.cpp installed signal handler picks off the result first.

Fixed the issue by looking for a recent gst function gst_registry_fork_set_enabled() to disable forking, or if that function isnt available, muck with the SIGCHLD signal handler during the gst_init_check call.

(Please note, the codepath when gst_registry_fork_set_enabled is available is NOT tested due to lack of a gstreamer > 0.10.10. The other part i can vouch for )

frowns ok, just noticed the patch still contained a commented out return for when grab_symbols fails. I need that line, because otherwise the OPTIONAL missing symbols will still halt loading gstreamer. Think there is a seperate codeing issue in the LL_GST_SYM macro...


Tofu Linden added a comment - 04/Feb/09 07:31 AM
That's some interesting debugging, thanks. So how about if the viewer just stops catching SIGCHLDs? I'm pretty sure it doesn't need to (the fact that it does is a holdover from the shared code with servers).

Tofu Linden added a comment - 04/Feb/09 07:49 AM
So, this 'foo.patch' would be good to test!

Iskar Ariantho added a comment - 04/Feb/09 09:33 AM
Tested it, and it does NOT work. (bleah, a total recompile just to suppress the setting of SIGCHLD, whatever happened to a simple // )

Actually, i am not sure why it doesnt work, judging from the sourcecode i would say it should give the same end result, but since it doesn't, i can only assume some library (curl?, libmoz?) cant leave the signals alone...

I also looked at some other places the viewer forks, like the llvoiceclient.cpp where it forks SLVoice and llwindow/llwindowsdl.cpp (exec_cmd) for starting external browsers... However neither function cares about the waitpid result, so, even if waitpid fails due to the SIGCHILD race, it works out ok in the end.

Seeing the viewer doesnt use gst_update_registry(), there is no further forking in gstreamer, hence i would say my patch is the least intrusive to fix this issue.

Oh, as an aside, 'err' in your patch is still NULL after returning from gst_init_check, resulting in an ever so slighty crash when dereferencing it. Was the first thing i did myself, before discovering GST_DEBUG


Tofu Linden added a comment - 04/Feb/09 09:45 AM
Huh, so much for the GStreamer docs - again.

Tofu Linden added a comment - 04/Feb/09 10:00 AM
If there's a chance that other libs are dicking with SIGCHLD, which there is, then I want to leave the LL_IGNORE_SIGCHLD stuff intact. I'm concocting a mix of our patches. I hope you can try it.

Tofu Linden added a comment - 04/Feb/09 10:14 AM
There, how's foo2.patch for you?

Iskar Ariantho added a comment - 04/Feb/09 10:34 AM
if you want to enclose the signal stuff in LL_LINUX, i think you should place the struct sigaction tmpact, oldact and the restore of the old sighandler also under LL_LINUX

New version is compiling....


Tofu Linden added a comment - 04/Feb/09 11:31 AM
Good point, I started the LL_LINUX bracketing and got distracted by one of those 200 other things going on.

Iskar Ariantho added a comment - 04/Feb/09 12:52 PM
Yup, the latest patch works ok for me. Be amazed, be happy

I added a little debug info, and it seems upon arrival in llmediaimplgstreamer the SIGCHLD handler is set to SIG_IGN. So yup, somebody is messing with it. Hope to see the patch soon in 1.22!


Tofu Linden added a comment - 04/Feb/09 12:56 PM
Hooray, thanks for the debugging, patch and testing.
I'll get this on maint-viewer and the RC release team may or may not cherrypick it to 1.22; if not 1.22, 1.23.

Tayra Dagostino added a comment - 06/Feb/09 11:36 AM
from OpenAL wiki:

"On Linux OpenAL will by default use the OSS kernel sound device."

all soundcard too much new and wothout retro-compatibility suffer problem with openal, workaround is create a file in user home

~/.openalrc

with only 1 line:

(define devices '(alsa esd native))

in this way openAL try first ALSA device, so ESD, and last native (old Open Sound System)

in this way OpenAL work with audio stream

1.22.9 NB still broken


Tayra Dagostino added a comment - 07/Feb/09 05:14 AM
1.22.9 now work on linux for audio stream, both mp3, ogg, fixed or variable rate

OpenAL 1.4.272
Gstreamer: 0.10.19


catherine pfeffer added a comment - 08/Feb/09 07:46 AM - edited
Itt might be unrelated, but see VWR-11947 :

Now (starting with 1.22.8), the viewer crashes when I start playing streamed sounds.

Update: it seems to be unrelated problems, because the patch attached here is apparently of no help for VWR-11947.


Techwolf Lupindo added a comment - 09/Feb/09 01:09 PM - edited
@Tayra Dagostino, please note the the openal support in 1.22.8 requires openalsoft. The openal wiki refers to the old and outdated openal from creative labs. I use .alsoftrc with the following
 
[general]
format=AL_FORMAT_51CHN16

[alsa]
device=plug:dmixs51
# mmap=off

Note that device is only for alsa, under [general] from the docs,

 
drivers =  # Sets the backend driver list order, comma-seperated. Unknown
           # backends and duplicated names are ignored, and unlisted backends
           # won't be considered for use. An empty list means the default.
           # Default is:
           # alsa,oss,solaris,dsound,winmm,wave

Also note that openalsoft is now 1.6.372 http://kcat.strangesoft.net/openal.html


Christina01a Twine added a comment - 26/Mar/09 01:11 AM
Hello,
this is my first time to post a comment here.
I'm facing the same problem ... I don't have music inworld with this latest viewer.
Although I'd like to use above patch, I don't know how to use it.
This question must sounds a beginner's, but could anyone tell me how to use it?
Thanks.

Calazur Zarco added a comment - 10/Apr/09 12:54 PM - edited
My problem was ONLY "music" not working (means that all sound but music was working in this new version).

I solved it uncommenting this in "secondlife" script loader:

#export LL_BAD_OPENAL_DRIVER=x
export LL_BAD_OPENAL_DRIVER=x

I dont use openal, I use alsa on all my Debian and Ubuntu systems, even ESD and OSS goes throught ALSA for me.

Its all self-explained inside the file and in readme-linux.txt, with some other options to try if that dont work for you.

EDITED: I forgot to mention that I didnt use any patch, I have the raw new update viwer only asked by the older client to upgrade.

Thanks for this post, starting here I could find the files and all.

Good luck


Tayra Dagostino added a comment - 10/Apr/09 01:02 PM
upgrading to lenny solve problem, using directly openal

mojito sorbet added a comment - 21/May/09 04:57 AM
Using 1.22.11 on Ubuntu 9.04, streaming was not working. Commenting out the LL_BAD_OPENAL_DRIVER so it used FMOD fixed it. But you can not have any other programs running that use audio, such as RhythmBox.

However, RC 1.23.2 broke it again and the workaround does not fix it any more.


Dessie Linden added a comment - 15/Jun/09 04:52 PM
Fixed in 1.23.4, released on 06/15/2009.

catherine pfeffer added a comment - 22/Jul/09 07:50 AM
I don't know if this is the right place for reporting this, but :

On Linux 64 bit and SL client 1.23.4 (123908).

  • with openal : ambient noises ok, no streams
  • with fmod : no sound at all

be it with gstreamer enabled or disabled, and individual fmod backends activated or not.

I know this is a different problem, which origin is 64 bit linux libraries not called by 32 bits SL client. However it would be nice to have that resolved too (ideally by having a real 64 bits SL client).

Also, my feeling was it would be nice to tell other 64 bits users about this problem if they search the jira for hints.