View Full Version : Video playing to fast in xbmc
moffeloffen
2008-02-20, 23:03
Hi again.
Video inside xbmc for linux is playing way to fast with no sound, this happend after i followed this guide: https://wiki.ubuntu.com/Gutsy_Intel_HD_Audio_Controller to fix bad quality sound.
In ubuntu video is playing at normal speed, and sound is great.
I can see my problem is the same as in this:
http://xbmc.org/forum/showthread.php?t=31286
But how too fix it?
moffeloffen
2008-02-21, 00:56
I have tried to reinnstall xbmc, same error.
FearlessSpiff
2008-02-21, 18:51
I also posted in the other thread, because i have the same problem. funny is, that if i leave audio on analog everything is fine, then when playing a movie and switching to digital with the OSD, i have no sound and movie playing at double the speed.
I hope this gets fixed soon, because it's almost the only thing bothering me. else xbmc is already one of the best media centers i have ever used on a x86 machine! :-)
Sounds like you have the wrong sound device set.
For me Default works, but it's hard to say what will work for you guys. If it's not default I'd say try it. Otherwise post the results of these commands.
aplay -L
aplay -l
FearlessSpiff
2008-02-22, 17:35
I tried almost everything: default, iec958, some default settings I found somewhere in the forums i can't remember: iec958:AES0=0x0....?!? but nothing worked. But I can get everything is playing ok in mplayer by using the "-ac hwac3" or "-ac hwdts" switch.
Here's my output:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: CMI8738MC8 [C-Media PCI CMI8738-MC8], device 0: CMI8738-MC8 [C-Media PCI DAC/ADC]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: CMI8738MC8 [C-Media PCI CMI8738-MC8], device 1: CMI8738-MC8 [C-Media PCI 2nd DAC]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: CMI8738MC8 [C-Media PCI CMI8738-MC8], device 2: CMI8738-MC8 [C-Media PCI IEC958]
Subdevices: 1/1
Subdevice #0: subdevice #0
and
aplay -L
default:CARD=CMI8738MC8
C-Media PCI CMI8738-MC8, C-Media PCI DAC/ADC
Default Audio Device
front:CARD=CMI8738MC8,DEV=0
C-Media PCI CMI8738-MC8, C-Media PCI DAC/ADC
Front speakers
iec958:CARD=CMI8738MC8,DEV=0
C-Media PCI CMI8738-MC8, C-Media PCI DAC/ADC
IEC958 (S/PDIF) Digital Audio Output
null
Discard all samples (playback) or generate zero samples (capture)
commited an alternate approach, please test.
I've been having this problem too, i'll give it a try today once svn is working
fwiw:
$ aplay -L
front:CARD=M2496,DEV=0
M Audio Audiophile 24/96, ICE1712 multi
Front speakers
surround40:CARD=M2496,DEV=0
M Audio Audiophile 24/96, ICE1712 multi
4.0 Surround output to Front and Rear speakers
surround41:CARD=M2496,DEV=0
M Audio Audiophile 24/96, ICE1712 multi
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=M2496,DEV=0
M Audio Audiophile 24/96, ICE1712 multi
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=M2496,DEV=0
M Audio Audiophile 24/96, ICE1712 multi
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
iec958:CARD=M2496,DEV=0
M Audio Audiophile 24/96, ICE1712 multi
IEC958 (S/PDIF) Digital Audio Output
null
Discard all samples (playback) or generate zero samples (capture)
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: M2496 [M Audio Audiophile 24/96], device 0: ICE1712 multi [ICE1712 multi]
Subdevices: 1/1
Subdevice #0: subdevice #0
Same problem for me, build 11777
12:05:11 T:4102888336 M: 42835968 DEBUG: FactoryCodec - Audio: passthrough - Opening
12:05:11 T:4102888336 M: 42835968 DEBUG: SECTION:LoadDLL(Q:\system\players\dvdplayer\libdts-i486-linux.so)
12:05:11 T:4102888336 M: 42835968 DEBUG: Loading: /home/htpc/XBMC/BUILD/system/players/dvdplayer/libdts-i486-linu
x.so
12:05:11 T:4102888336 M: 42835968 DEBUG: FactoryCodec - Audio: passthrough - Opened
12:05:11 T:4102888336 M: 42835968 NOTICE: Creating audio thread
12:05:11 T:4000316304 M: 42835968 DEBUG: Running thread 4000316304
12:05:11 T:4000316304 M: 42835968 DEBUG: thread start, auto delete: 0
12:05:11 T:4000316304 M: 42835968 NOTICE: running thread: CDVDPlayerAudio::Process()
12:05:11 T:4102888336 M: 42835968 DEBUG: Playback has started
12:05:11 T:4000316304 M: 42835968 DEBUG: CDVDAudioCodecPassthrough: Synced to AC3 frame
12:05:11 T:4000316304 M: 42835968 NOTICE: Creating audio device with codec id: 86020, channels: 2, sample rate: 48
000, pass-through
12:05:11 T:4000316304 M: 42835968 DEBUG: CALSADirectSound::CALSADirectSound - opening alsa device
12:05:11 T:4142450528 M: 42835968 DEBUG: ------------------- GUI_MSG_WINDOW_INIT
12:05:11 T:4142450528 M: 42835968 DEBUG:
12:05:11 T:4142450528 M: 42835968 DEBUG: -------------------
12:05:11 T:4142450528 M: 42835968 DEBUG: Load progress_back.png: 0.7ms (bundled)
12:05:11 T:4142450528 M: 42835968 DEBUG: Load progress_mid.png: 0.7ms (bundled)
12:05:11 T:4142450528 M: 42835968 DEBUG: Load progress_right.png: 0.0ms (bundled)
12:05:11 T:4142450528 M: 42835968 DEBUG: Load progress_left.png: 0.0ms (bundled)
12:05:11 T:4142450528 M: 42835968 DEBUG: Load seekslider.png: 0.0ms (bundled)
12:05:11 T:4142450528 M: 42835968 DEBUG: Alloc resources: 1.68ms (0.00 ms skin load, 0.09 ms preload)
12:05:11 T:4142450528 M: 42835968 DEBUG: ------------------- GUI_MSG_WINDOW_INIT
12:05:11 T:4142450528 M: 42835968 DEBUG:
12:05:11 T:4142450528 M: 42835968 DEBUG: -------------------
12:05:11 T:4142450528 M: 42835968 INFO: Loading skin file: VideoOverlay.xml
12:05:11 T:4142450528 M: 42835968 DEBUG: Load VideoOverlay.xml: 1.36ms (0.40 ms xml load)
12:05:11 T:4142450528 M: 42835968 DEBUG: Alloc resources: 1.43ms (1.43 ms skin load, 0.00 ms preload)
12:05:11 T:4142450528 M: 42835968 DEBUG: Load blue_rectangle_video.png: 0.3ms (bundled)
12:05:11 T:4142450528 M: 42835968 DEBUG: Load video-pause.png: 0.7ms (bundled)
12:05:11 T:4142450528 M: 42835968 DEBUG: Load voulume-panel-bg.png: 0.1ms (bundled)
12:05:11 T:4142450528 M: 42835968 DEBUG: CGUIInfoManager::SetCurrentMovie(/opt/Movies/Movies/American Gangster (2
007)/s-americangangster.mkv)
12:05:11 T:4142450528 M: 42835968 DEBUG: CVideoDatabase::GetMovieInfo(/opt/Movies/Movies/American Gangster (2007)
/s-americangangster.mkv), query = select idMovie from movie where idFile=7
12:05:11 T:4142450528 M: 42835968 DEBUG: CVideoDatabase::GetEpisodeInfo(/opt/Movies/Movies/American Gangster (200
7)/s-americangangster.mkv), query = select idEpisode from episode where idFile=7
12:05:11 T:4142450528 M: 42835968 DEBUG: CVideoDatabase::GetMusicVideoInfo(/opt/Movies/Movies/American Gangster (
2007)/s-americangangster.mkv), query = select idMVideo from musicvideo where idFile=7
12:05:11 T:4000316304 M: 42835968 DEBUG: CALSADirectSound - using alsa device iec958:AES0=6
12:05:11 T:4000316304 M: 42684416 ERROR: CALSADirectSound - pcm_open_lconf, alsa error: Device or resource busy
12:05:11 T:4000316304 M: 42684416 ERROR: CALSADirectSound::AddPackets - sanity failed. no valid play handle!
12:05:11 T:4000316304 M: 42684416 DEBUG: CDVDPlayerAudio:: Resync - clock:0.000000, delay:-32000.000000
12:05:11 T:4142450528 M: 42684416 DEBUG: Error: Requested setting (system.ledenableonpaused) was not found. It m
ust be case-sensitive
12:05:11 T:4000316304 M: 42684416 ERROR: CALSADirectSound::AddPackets - sanity failed. no valid play handle!
12:05:11 T:4000316304 M: 42684416 DEBUG: CDVDPlayerAudio:: Discontinuty - was:32157.603000, should be:64000.00000
0, error:31842.397000
Coca Cola Zero
2008-02-24, 06:06
I was running into the fast video/no sound in recent builds including newest svn, but the following changes fix it for me:
edit xbmc/cores/dvdplayer/ALSADirectSound.cpp
comment out lines 82 & 83, so it looks like this:
//if (device.Find("AES0=6") < 0)
// device += ":AES0=6";
recompile (go back to XBMC dir, type make), run XBMC, set sound devices in settings both to 'default'.
There is no guarantee that following my steps will fix your issue because there are tons of things that can go wrong with audio in Linux and "video too fast, no sound" seems to simply be the common side-effect one sees in XBMC when the audio is set up wrong and the player is using an invalid audio device setting.
I don't know enough about Linux audio to know what adding :AES0=6 to any passthru device name is supposed to do, but my system (Ubuntu 7.10, X-Mystique/CMI8738 soundcard) certainly doesn't like it.
FWIW you can still use the build script with these mods. build.sh NOUPDATE and it will do all the work for you. I do this for some mods I'm forced to make right now, works fine. In fact if that file isn't updated it may not even get overwritten.
I was running into the fast video/no sound in recent builds including newest svn, but the following changes fix it for me:
edit xbmc/cores/dvdplayer/ALSADirectSound.cpp
comment out lines 82 & 83, so it looks like this:
//if (device.Find("AES0=6") < 0)
// device += ":AES0=6";
recompile (go back to XBMC dir, type make), run XBMC, set sound devices in settings both to 'default'.
There is no guarantee that following my steps will fix your issue because there are tons of things that can go wrong with audio in Linux and "video too fast, no sound" seems to simply be the common side-effect one sees in XBMC when the audio is set up wrong and the player is using an invalid audio device setting.
I don't know enough about Linux audio to know what adding :AES0=6 to any passthru device name is supposed to do, but my system (Ubuntu 7.10, X-Mystique/CMI8738 soundcard) certainly doesn't like it.
Excellent! Commenting out those lines and changing my setting to default fixed it!:grin:
i had forgot to commit the fix. please svn update and try again. i have a feeling that those options are only applicable when device is set to the iec958 alsa device.
I removed my changes and updated. It's doing the same thing as before. Want any debug info?
gateway69
2008-02-25, 23:33
anyone found a fix or why this all of the sudden started to happen?
I was having this problem under 7.10, but my sound card was not recognized at all. I installed linux-backports-modules and my sound card worked and my video played normal speed.
i've now changed it to only apply those parameters to iec958 if that is the device string. so if you use some custom device string it won't apply them. thou then you have to make sure it's a proper device string :/
Coca Cola Zero
2008-02-26, 05:18
It would be nice to have an option to tell XBMC not to mess with the audio device string you enter, either in the UI or as an env variable.
FWIW, when I was troubleshooting my setup, I tried mplayer and some other of the big Linux media players and they all worked fine with my setup. I dunno if they just have good code for picking a reasonable default or if they pull the information out of the gnome sound applet settings or what, but it might be worth looking at them to see what they do and ape it in XBMC.
Random aside: Hey, look, it's Gateway! Get JackRippr, DrDel, oldman and a few others in here and we can have a #Amiga! reunion.
new code works with my digital output set at default
Check out my posts on http://xbmc.org/forum/showthread.php?t=30876&page=3 and see if that helps. Specifically you may want to add the following lines before running XboxMediaCenter.
I get the same behavior (no audio and fast playback without the following lines)
export SDL_AUDIODRIVER=ALSA
export XBMC_AUDIODEV=spdif
export XBMC_HOME=/home/ajay/XBMC/BUILD
./XboxMediaCenter -fs -q
FearlessSpiff
2008-02-26, 13:08
Check out my posts on http://xbmc.org/forum/showthread.php?t=30876&page=3 and see if that helps. Specifically you may want to add the following lines before running XboxMediaCenter.
I get the same behavior (no audio and fast playback without the following lines)
export SDL_AUDIODRIVER=ALSA
export XBMC_AUDIODEV=spdif
export XBMC_HOME=/home/ajay/XBMC/BUILD
./XboxMediaCenter -fs -q
Great! Thanks! That's the only way I get it working! The only thing I'm missing now is the menu navigation sounds, but as long as I can listen to music and have movies with passthrough, I can live with that!
Finally, XBMC for Linux is my default MediaCenter. Great! :laugh:
marrabld
2008-04-15, 15:18
I did the same but now I have lost the navigations sounds and still no music or video sound. :(
marrabld
2008-04-15, 15:20
Sorry, should have included this from my debug.log
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM ALSA
althekiller
2008-04-15, 15:21
This happening in XBMC exclusively or no sound in Ubuntu in general? Can't really expect help here until your hardware is setup properly in Ubuntu.
marrabld
2008-04-15, 15:25
I should have thought about my post a bit more. I have the HDA-Intel card that a lot of ubuntu users are having trouble with: https://wiki.ubuntu.com/Gutsy_Intel_HD_Audio_Controller
However I got it working by following the help in that link. All sound in ubuntu 7.10 works fine now :)
However in XBMC, I had sound from the menu beeps, but no sound from music or video files. I followed all the steps in this thread so far and after the last one, I lost all sound and still have the fast video play back too.
marrabld
2008-04-15, 15:54
OK, I got the menu clicks back;
changing
export SDL_AUDIODRIVER=ALSA
to
export SDL_AUDIODRIVER=alsa
still not sound from the music of video though