View Full Version : MP3 audio (PCM) playing too fast over HDMI/SPDIF
Hi all,
Since a few days I've been running XBMC compiled from SVN. Works ok using the same settings I've used for 8.10 stable. My htpc is connected only through HDMI (video+audio) for which I've successfully setup (http://xbmc.org/forum/showpost.php?p=259663&postcount=12) XBMC earlier on (http://xbmc.org/forum/showpost.php?p=259515&postcount=14).
The only thing that bothers me now, is that MP3's are played at 48 KHz instead of 44.1 KHz so they play faster and with a higher pitch at the ratio of 48:44.1. Did some dev refactor the audio player and intentionally left out the up/downsampling bit? I would like to know whether this is a regression in SVN or the time for me to construct an asound.conf to get things right again. I am at SVN revision 17131 right now.
Thanks for any help!
Hi all,
Since a few days I've been running XBMC compiled from SVN. Works ok using the same settings I've used for 8.10 stable. My htpc is connected only through HDMI (video+audio) for which I've successfully setup (http://xbmc.org/forum/showpost.php?p=259663&postcount=12) XBMC earlier on (http://xbmc.org/forum/showpost.php?p=259515&postcount=14).
The only thing that bothers me now, is that MP3's are played at 48 KHz instead of 44.1 KHz so they play faster and with a higher pitch at the ratio of 48:44.1. Did some dev refactor the audio player and intentionally left out the up/downsampling bit? I would like to know whether this is a regression in SVN or the time for me to construct an asound.conf to get things right again. I am at SVN revision 17131 right now.
Thanks for any help!
Yup, I took out the resampling bit because PAPlayer should be bitperfect if possible. No need to fear though as its more of disabled so its easy enough for you to add yourself. Create an advancedsettings.xml containing this:
<advancedsettings>
<audio>
<resample>44100</resample>
</audio>
</advancedsettings>
Then paplayer should behave exactly as it did on atlantis regarding this issue.
The longterm plan is that we will add a complete dspchain that works with both dvdplayer and paplayer that will make these stuff more transparent to the user, so at some point we will pickup that your audio only wants 48khz and we will add a filter that resamples to this.
Cheers,
Tobias
Yup, I took out the resampling bit because PAPlayer should be bitperfect if possible. No need to fear though as its more of disabled so its easy enough for you to add yourself. Create an advancedsettings.xml containing this:
<advancedsettings>
<audio>
<resample>44100</resample>
</audio>
</advancedsettings>
Then paplayer should behave exactly as it did on atlantis regarding this issue.
The longterm plan is that we will add a complete dspchain that works with both dvdplayer and paplayer that will make these stuff more transparent to the user, so at some point we will pickup that your audio only wants 48khz and we will add a filter that resamples to this.
Cheers,
Tobias
Hej da Tobias,
Thank you very much for your prompt reply! If anyone is dealing with the same issue, head over here (http://xbmc.org/wiki/index.php?title=AdvancedSettings.xml) to get help about the advancedsettings.xml file. The fix mentioned by Topfs2 above is not listed though ;)
Just got my second HDMI build up and running. Used a different method to get the audio routed to HDMI and now have both stereo and 5.1 audio - but stereo is chipmunk per this post and I lost navigation sounds. Will be trying this fix, thanks!
Edit: okay, added an advancedsettings.xml file into my home/username/.xbmc/userdata directory. Copied\pasted settings from above. Alvin and the Chipmunks still playing my song and my receiver indicates 48khz input. Did I place this file in the wrong spot?
Just got my second HDMI build up and running. Used a different method to get the audio routed to HDMI and now have both stereo and 5.1 audio - but stereo is chipmunk per this post and I lost navigation sounds. Will be trying this fix, thanks!
Edit: okay, added an advancedsettings.xml file into my home/username/.xbmc/userdata directory. Copied\pasted settings from above. Alvin and the Chipmunks still playing my song and my receiver indicates 48khz input. Did I place this file in the wrong spot?
I'm having the same issue, i've tried advancedsettings.xlm but still chipmunking over HDMI when playing MP3.
Noteworthy if your on latest svn you might have a bug dealing the userdata folder.
In anycase, post a debuglog and IŽll gladly look through it.
Cheers,
Tobias.
Just got my second HDMI build up and running. Used a different method to get the audio routed to HDMI and now have both stereo and 5.1 audio - but stereo is chipmunk per this post and I lost navigation sounds. Will be trying this fix, thanks!
Edit: okay, added an advancedsettings.xml file into my home/username/.xbmc/userdata directory. Copied\pasted settings from above. Alvin and the Chipmunks still playing my song and my receiver indicates 48khz input. Did I place this file in the wrong spot?
it sounds like you should have 48khz in the settings instead of 44.1 (my hdmi only supports 48 atleast) but a log will make this very clear if that is the case:
it sounds like you should have 48khz in the settings instead of 44.1 (my hdmi only supports 48 atleast) but a log will make this very clear if that is the case:
That's it :)
I was struggling getting this to work with your suggestion, but the chipmunks never went away! I have a digital amp that routes my hdmi signal to the tv. It displays the frequency of the PCM audio when it's playing, being 48 KHz (default for digital audio via SPDIF or HDMI).
To get it to work properly I created a new file ~/.xbmc/userdata/advancedsettings.xml containing the following:
<advancedsettings>
<audio>
<resample>48000</resample>
</audio>
</advancedsettings>
Restarted XBMC, and all was well again!
Now, how to get stereo, 5.1, AND NAV soundsusing HDMI! Will try the 48K fix asap though - thanks!
I have a simple .asoundrc file with PCM defaulted to HDMI, XBMC set to HDMI for passthrough and normal sound, everything works. But MP3 playback is too fast. If I mod that with an advancedsettings.xml file to 48khz it's WAAAY fast. If I set it to 4100 I get a coredump. Remove Advancesettings.xml and I just get slightly too fast playback.
SO close! Ideas?
peenhammer
2009-01-21, 18:34
This asoundrc works for me:
hdmi {
type hw
card 0
device 3
}
pcm.hdmiconv {
type plug
slave {
pcm "hw:0,3"
rate 48000
}
}
Then in xbmc audio settings both normal and passthrough set to hdmiconv.
debuglog...
will a debuglog do much here? I will admit I've not even looked at it thinking this was mostly an Ubuntu setup issue - well except for the chipmunks :) I *have* seen soemthing to the effect that no sound card exists in the console when exiting XBMC played from the console but I cannot recall which P5N7A box that was on - both of mine are configured slightly differently right now.
I will try the suggested asoundrc above tonight if possible and pull a debug too if I can. sure would be nice if there was just one darned accurate way to setup this hardware that we could all agree on. An awesome board for sure and capable of doing what we need but sheesh the sound setup is a PITA.
Okay, here's what I have right now:
console output
pam@pam-xbmc:~$ xbmc
there is no soundcard
there is no soundcard
there is no soundcard
there is no soundcard
there is no soundcard
there is no soundcard
there is no soundcard
there is no soundcard
there is no soundcard
there is no soundcard
there is no soundcard
there is no soundcard
there is no soundcard
there is no soundcard
there is no soundcard
there is no soundcard
there is no soundcard
CRITSEC[0x8d2bac4]: Trying to enter destroyed section.
CRITSEC[0x8d2bac4]: Trying to leave destroyed section.
method return sender=:1.26 -> dest=:1.87 reply_serial=2
.asoundrc
pcm.!default hdmi
aplay -l
pam@pam-xbmc:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC1200 Analog [ALC1200 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 1: ALC1200 Digital [ALC1200 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
Pastebin (http://pastebin.com/m58bf0e13) of the debug log, nothing in there I can see.
No advancedsettings.xml file but when I had one and tried to set rate at 4100 the system would dump, setting it to 4800 increased the speed of the stereo sounds - I also noted that the remote navigation was nutz and hyper responsive.
hdmi for audio output and passthrough device.
SVN shows as 17041 in the info channel with a compile date of the 17th. Resolution listed as 1280X720 - is a smallish TV and looks best at 720P but can apparently do 1080. Oh, this is Intrepid kernel 2.6.27-9 Generic #1 SMP. The system does NOT appear to display the weird multithreaded bug others have spotted, the C2D E7300 CPU is clocked to 3.1Ghz :)
I have nav sounds, I have 5.1 sound, I have slightly sped up mp3s. alsamixer shows 1.0.18 using Generic 10de NVIDIA MCP7A HDMI. This is an ASUS P5N7A board. The audio is set to hdmi in the BIOS as I recall, I can delve further there if it would be helpful. I know there was another area to setup sound for all users and not just a single user using .asoundrc but I am pretty sure that's not set now (I tried it out and commented it out after)..
Thoughts on getting stereo sound slowed down would be nice! Unlike others who have had issues with nav sounds I have them working fine on this. If nothing maybe this will help others trying to get the ASUS up and rolling.
P.S. This is not MY system but a second I setup, I will try comparing my other with this and perhaps duping the settings.
According to log its quite clear that your HDMI device wants 48khz. So you definatly should have an advancedsettings.xml converting it into that. if that doesnt work then a new debuglog is in order.
Cheers,
Tobias
Okay, will try that this evening!
According to log its quite clear that your HDMI device wants 48khz. So you definatly should have an advancedsettings.xml converting it into that. if that doesnt work then a new debuglog is in order.
Cheers,
Tobias
Nope, plays at about 4x speed - I cannot even make out words at this speed...
http://pastebin.com/m7ce1fe41 for my debug log. Hope there's some help in there - doesn't crash just SCREAMS, the clock ticks VERY fast as well :no:
peenhammer
2009-01-25, 00:09
Are you sure you tried my asoundrc and settings?
I have the p5n7a board and that combo should resample mp3 playback to 48000khz.
Are you sure you tried my asoundrc and settings?
I have the p5n7a board and that combo should resample mp3 playback to 48000khz.
No I used the advanced settings.xml file as instructed
<advancedsettings>
<audio>
<resample>4800</resample>
</audio>
</advancedsettings>
I can try yet another .asoundrc file but unless you have working navigation sounds, working stereo MP3 audio, and working surround sound it will be a step backwards. Also, when attempting to play an FLV trailer I got a pop-up stating no sound device was available <sigh>
This really shouldn't be so hard....
one more zero for 48khz ;)
CALSADirectSound::CALSADirectSound - requested samplerate (4800) not supported by hardware, using 48000 instead
<advancedsettings>
<audio>
<resample>4800</resample>
</audio>
</advancedsettings>
should be
<advancedsettings>
<audio>
<resample>48000</resample>
</audio>
</advancedsettings>
fasteddy
2009-01-25, 16:18
Well, I switched to analog sound (over hdmi) and that solved my mp3 playback issues. Of course, if you're looking to use DTS then this won't help you. Anyway, check out this thread (http://xbmc.org/forum/showthread.php?t=43834&highlight=navigation+sounds+hdmi) if you're interested.
one more zero for 48khz ;)
CALSADirectSound::CALSADirectSound - requested samplerate (4800) not supported by hardware, using 48000 instead
<advancedsettings>
<audio>
<resample>4800</resample>
</audio>
</advancedsettings>
should be
<advancedsettings>
<audio>
<resample>48000</resample>
</audio>
</advancedsettings>
Oh geez and that's from the log too isn't it? No way it's a typo here I'll have to look at this tomorrow night. Argh! I hope this works, thanks for the patience!
Just wanted to touch base back on this - thanks to topfs2 this box now has working NAV sounds, working 5.1 (apparently, is hooked to a TV), and working MP3 stereo sound! At the correct speed too :D
I did see an error trying to play a .FLV trailer file - a pop-up at the bottom to the effect that no sound device was available. I will try to duplicate that when time permits and post a log but for now I seem to have very well working H
DMI audio on this box. I will duplicate this on my home system for verification when time permits (time, I need more of it) to ensure it works there too and is easily repeatable.
Thanks for the assist folks!
P.S. Pulseaudio is still on this box and not giving me issues near as I can tell - I'm just not using it. <shrug>
on the latest SVN I am able to fix music with the advancedsettings resample at 48000.
Hulu streams played back using the Hulu plugin are still playing too fast. Anyone know how to resolve the playback of flash streams?
I'm also seeing similar too fast audio with Apple Movie Trailers II streams
Apple Move Trailers using the AMT II plug-in play great on the box I've been working with :( Not tried an FLI or flash based video yet as the Google plug-in isn't working for me and I've not yet found a YouTube one.
on the latest SVN I am able to fix music with the advancedsettings resample at 48000.
Hulu streams played back using the Hulu plugin are still playing too fast. Anyone know how to resolve the playback of flash streams?
As always, provide a debuglog...
The advancedsettings tag for resample only affects paplayer atm so that be why your experiencing weird speeds, but all would be verified with a log.
Cheers,
Tobias
michfive
2009-06-22, 13:14
for me this
<advancedsettings>
<audio>
<resample>48000</resample>
</audio>
</advancedsettings>
work fine with audio player , but no effect on video player , i use optical audio output and with optical output sound card could accept only 48000 , even rate 48000 on asoundrc do nothing
so sound on video work fine only if sound track is at 48000 :(
res0nat0r
2009-07-22, 06:59
this looks to be matching up to what topfs2 is saying above.
i am using hdmi and had issues with my mp3 playback being too quick until i added the advancedsettings resample config above. my mp3s play back fine now, but my apple trailers are still a bit too fast.
i can see via the video options that the audio is 44.1, but my receiver wants 48, it looks like the <resample> option only works for paplayer as my debug log shows:
3:53:02 T:2764475280 M:1578577920 DEBUG: CDVDPlayerVideo - CDVDMsg::GENERAL_SYNCHRONIZE
23:53:02 T:2799680400 M:1578577920 WARNING: CDVDPlayer::CheckContinuity - wrapback of stream:2, prev:83416.750083, curr:41708.375042, diff:-41708.375042
23:53:02 T:2764475280 M:1578577920 DEBUG: CDVDPlayerVideo - CDVDMsg::GENERAL_RESYNC(0.000000, 1)
23:53:02 T:2756082576 M:1578577920 DEBUG: CDVDPlayerAudio - CDVDMsg::GENERAL_DELAY(23219.954649)
23:53:02 T:2873355152 M:1578577920 DEBUG: Thread 2873355152 terminating (autodelete)
23:53:02 T:2756082576 M:1578577920 DEBUG: CDVDPlayerAudio - CDVDMsg::GENERAL_RESYNC(23219.954649, 0)
23:53:02 T:2756082576 M:1578577920 NOTICE: Creating audio device with codec id: 86018, channels: 2, sample rate: 44100, no pass-through
23:53:02 T:2756082576 M:1578577920 DEBUG: PulseAudio: Opening Channels: 2 - SampleRate: 44100 - SampleBit: 16 - Resample false - Codec AAC - IsMusic false
- IsPassthrough false - audioHost: default - audioDevice: hdmi
23:53:02 T:2764475280 M:1577349120 NOTICE: screenWidth:1920 widWidth:1280
23:53:02 T:2756082576 M:1577463808 DEBUG: PulseAudio: Context failed
23:53:02 T:2756082576 M:1577463808 ERROR: PulseAudio: Waited for the Context but it failed
23:53:02 T:2756082576 M:1566093312 DEBUG: CALSADirectSound::CALSADirectSound - Channels: 2 - SampleRate: 44100 - SampleBit: 16 - Resample false - Codec AAC
- IsMusic false - IsPassthrough false - audioDevice: hdmi
23:53:02 T:2756082576 M:1552470016 DEBUG: Initialize - using alsa device hdmi
23:53:02 T:2756082576 M:1552265216 DEBUG: CALSADirectSound::Initialize - packet size:2048, packet count:16, buffer size:8192
23:53:02 T:2756082576 M:1552265216 WARNING: CALSADirectSound::CALSADirectSound - requested samplerate (44100) not supported by hardware, using 48000 instead
23:53:02 T:2756082576 M:1552265216 DEBUG: CDVDPlayerAudio:: Discontinuty - was:270978.055000, should be:25170.629192, error:-245807.425808
23:53:02 T:2764475280 M:1552060416 NOTICE: VDPAU Decoder capabilities:
but it doesnt look like it is getting resampled, probably due to what is mentioned above
this looks to be matching up to what topfs2 is saying above.
i am using hdmi and had issues with my mp3 playback being too quick until i added the advancedsettings resample config above. my mp3s play back fine now, but my apple trailers are still a bit too fast.
i can see via the video options that the audio is 44.1, but my receiver wants 48, it looks like the <resample> option only works for paplayer as my debug log shows:
but it doesnt look like it is getting resampled, probably due to what is mentioned above
You could change the output device in settings from default to plug:hdmi, this should work on most systems.
Cheers,
Tobias
Did this thread just die out, or did everyone get resolved? I followed instructions at Lifehacker.com (http://lifehacker.com/5391308/build-a-silent-standalone-xbmc-media-center-on-the-cheap) to use XBMC Live with an Acer AspireRevo and I'm discovering that either they got lucky, or they didn't document the whole procedure. I'm just starting my trek into this morass of audio settings trying to get audio to play at the right speed through HDMI. I'm to the point where HDMI output works fine for DVD iso's and mp3, but flv, avi, wmv, etc. are all playing way too fast on my Acer AspireRevo with XBMC Live.
I've used the advancedsettings.xml resample coding for 48khz mentioned elsewhere here, and followed Lifehacker's instructions to make a .asoundrc file containing
pcm.!default {
type plug
slave {
pcm "hdmi"
}
}
Previous posts here indicate that audio related to video formats needs additional tweaking to work. Where do I go from here? If a debug log helps, where do I find it?
im in the same boat, finally picked up a revo based on the life hacker article and while video is great, i cant seem to get mp3 to play at the right speed ... i try both speed mentioned by adding a advancedsettings.xml file but no luck ... i have both audio set to hdmi and also try plughw:0,3 as well without much luck ...
im in the same boat, finally picked up a revo based on the life hacker article and while video is great, i cant seem to get mp3 to play at the right speed ... i try both speed mentioned by adding a advancedsettings.xml file but no luck ... i have both audio set to hdmi and also try plughw:0,3 as well without much luck ...
debuglog...