Segfault in libasound
#1
On Gentoo using alsa-lib 1.0.15 (also tested with 1.0.14) using svn rev 10952

no system asound.conf and no user .asoundrc

Quote:CPlayerCoreFactor::GetPlayers(/home/hans/media/vids/test.avi)
DVDPlayer: Opening: /home/hans/media/vids/test.avi
CDVDPlayer::CloseFile()
CDVDMessageQueue:Tongueut MSGQ_NOT_INITIALIZED
DVDPlayer: waiting for threads to exit
DVDPlayer: finished waiting
CDVDMessageQueue:Tongueut MSGQ_NOT_INITIALIZED
Running thread 2947992464
thread start, auto delete: 0
Creating InputStream
Creating Demuxer
SECTION:LoadDLL(Q:\system\players\dvdplayer\avutil-51-i486-linux.so)
Loading: /home/hans/dev/xbmc/branches/linuxport/XBMC/BUILD/system/players/dvdplayer/avutil-51-i486-linux.so
SECTION:LoadDLL(Q:\system\players\dvdplayer\avcodec-51-i486-linux.so)
Loading: /home/hans/dev/xbmc/branches/linuxport/XBMC/BUILD/system/players/dvdplayer/avcodec-51-i486-linux.so
DllAvCodec loaded
SECTION:LoadDLL(Q:\system\players\dvdplayer\avformat-51-i486-linux.so)
Loading: /home/hans/dev/xbmc/branches/linuxport/XBMC/BUILD/system/players/dvdplayer/avformat-51-i486-linux.so
ffmpeg: Input #0, avi, from '/home/hans/media/vids/test.avi':
ffmpeg: Duration: 01:13:52.4, start: 0.000000, bitrate: 1325 kb/s
ffmpeg: Stream #0.0: Video: mpeg4, yuv420p, 640x272 [PAR 1:1 DAR 40:17], 23.98 tb®
ffmpeg: Stream #0.1: Audio: ac3, 48000 Hz, 5:1, 448 kb/s
CDVDFactorySubtitle::GetSubtitles, searching subtitles
CacheSubtitles: START
CacheSubtitles: Checking for common subirs...
CacheSubtitles: Done (time: 2 ms)
CacheSubtitles: Searching for subtitles...
CacheSubtitles: Done (time: 0 ms)
CacheSubtitles: END (total time: 3 ms)
CDVDFactorySubtitle::GetSubtitles, searching subtitles done
Opening audio stream: 1
Finding audio codec for: 86020
FactoryCodec - Audio: passthrough - Opening
FactoryCodec - Audio: passthrough - Failed
FactoryCodec - Audio: liba52 - Opening
SECTION:LoadDLL(Q:\system\players\dvdplayer\liba52-i486-linux.so)
Loading: /home/hans/dev/xbmc/branches/linuxport/XBMC/BUILD/system/players/dvdplayer/liba52-i486-linux.so
FactoryCodec - Audio: liba52 - Opened
Creating audio thread
Running thread 2956385168
thread start, auto delete: 0
running thread: CDVDPlayerAudio:Tonguerocess()
Opening video stream: 0
Creating video codec with codec id: 13
FactoryCodec - Video: FFmpeg - Opening
DllAvCodec loaded
SECTION:LoadDLL(Q:\system\players\dvdplayer\swscale-51-i486-linux.so)
Loading: /home/hans/dev/xbmc/branches/linuxport/XBMC/BUILD/system/players/dvdplayer/swscale-51-i486-linux.so
FactoryCodec - Video: FFmpeg - Opened
Creating video thread
Running thread 2964777872
thread start, auto delete: 0
Constructing surface
GLX Info: Using destination window
GLX Info: Creating shared context
Playback has started
Creating audio device with codec id: 86020, channels: 6, sample rate: 48000, no pass-through
CALSADirectSound::CALSADirectSound - opening alsa device
ffmpeg: [NULL] frame skip 8
ffmpeg: [NULL] frame skip 8
GL: OpenGL version 2.1 detected
GL: NPOT textures are supported natively
DllAvCodec loaded
GL: Selecting YUV 2 RGB Progressive Shader
GL: Shader compilation log:

GL: Shader compilation log:

------------------- GUI_MSG_WINDOW_INIT -------------------
Loading skin file: VideoOverlay.xml
running thread: video_thread
ffmpeg: [mpeg4] frame skip 8
ffmpeg: [mpeg4] frame skip 8
fps: 23.976000, pwidth: 640, pheight: 272, dwidth: 640, dheight: 272
OutputPicture- change configuration. 640x272. framerate: 23.98
Display resolution AUTO : PAL 4:3 (6)
GL: OpenGL version 2.1 detected
GL: NPOT textures are supported natively
Segmentation fault (core dumped)

Code:
#0  0xb7e7b307 in snd_config_get_type () from /usr/lib/libasound.so.2
(gdb) bt
#0  0xb7e7b307 in snd_config_get_type () from /usr/lib/libasound.so.2
#1  0x087b51bb in CALSADirectSound (this=0xb22bebc8, pCallback=0x0, iChannels=6, uiSamplesPerSec=48000, uiBitsPerSample=16, bResample=false,
    strAudioCodec=0x88dbcb7 "", bIsMusic=false, bPassthrough=false) at ALSADirectSound.cpp:85
#2  0x087b81c3 in CDVDAudio::Create (this=0xb224c888, audioframe=@0xb01fd12c, codec=CODEC_ID_AC3) at DVDAudio.cpp:76
#3  0x087c7b54 in CDVDPlayerAudio::Process (this=0xb224c788) at DVDPlayerAudio.cpp:393
#4  0x087534b7 in CThread::staticThread (data=0xb224c788) at Thread.cpp:168
#5  0x086ba2e5 in InternalThreadFunc (data=0x8c26e40) at XThreadUtils.cpp:61
#6  0xb7a9552b in ?? () from /usr/lib/libSDL-1.2.so.0
#7  0x08c26e40 in ?? ()
#8  0x086ba276 in _beginthreadex (security=0x8b80050, stack_size=3077484532, start_address=0xb01fd408, arglist=0xb76dc64b, initflag=146276432,
    thrdaddr=0xb01feb90) at XThreadUtils.cpp:126
#9  0xb7ad0c3d in ?? () from /usr/lib/libSDL-1.2.so.0
#10 0x08b80050 in ?? ()
#11 0xb76eaff4 in ?? () from /lib/libpthread.so.0
#12 0xb01fd408 in ?? ()
#13 0xb76dc64b in ?? () from /lib/libpthread.so.0
#14 0x08b80050 in ?? ()
#15 0xb01feb90 in ?? ()
#16 0xb01feb90 in ?? ()
#17 0xb01feb90 in ?? ()
#18 0xb01fd3d0 in ?? ()
#19 0x00000000 in ?? ()
Reply
#2
Did you copy the new asound.conf file in our svn userdata dir to your running userdata dir its what we use for downmix now instead of the global ones
Reply
#3
not userdata jezz, system...

in either case the log looks like it's getting the device wrong.

CALSADirectSound::CALSADirectSound - opening alsa device

should list the device it's opening.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#4
The asound.conf from svn (XBMC/system) is also present in BUILD/system so that shouldnt be a problem.

My sound used to work (at least not segfault) so something in recent svn changes broke it. Any ideas?
Reply
#5
In addition to elupus, the segfault occurs before the point where it logs the device used. Actually, it crashes while determining which device to use Smile (line 85 of ALSADirectSound.cpp)

BTW: My audio output is analog and device is set to "default" in xbmc settings->system->audio hardware.
Reply
#6
aah, looks like the global snd_config is null, that way it would fail. should probably make sure it isn't null before trying to copy it.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#7
Thanks for your fix, it works like a charm now. Even got downmixing going thanks to the new asound.conf! Smile
Reply
#8
How did you actually fix this? I'm having this same problem with my secondary system that uses analog output. (one with digital sound works fine)

I didn't quite get it from elupus's comment to set snd_config to non-null..
Reply
#9
i fixed it in source, get me a gdb backtrace and i might be able to help you.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Segfault in libasound0