MP3 audio (PCM) playing too fast over HDMI/SPDIF
#1
Question 
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 XBMC earlier on.

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!
Asus P5N7A-VM + E8400
Ubuntu 9.10 32-bit
XBMC 9.11
Reply
#2
j0bro Wrote: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 XBMC earlier on.

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
If you have problems please read this before posting

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

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#3
Thumbs Up 
Topfs2 Wrote: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 to get help about the advancedsettings.xml file. The fix mentioned by Topfs2 above is not listed though Wink
Asus P5N7A-VM + E8400
Ubuntu 9.10 32-bit
XBMC 9.11
Reply
#4
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?
Openelec Gotham, MCE remote(s), Intel i3 NUC, DVDs fed from unRAID cataloged by DVD Profiler. HD-DVD encoded with Handbrake to x.264. Yamaha receiver(s)
Reply
#5
BLKMGK Wrote: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.
Reply
#6
Noteworthy if your on latest svn you might have a bug dealing the userdata folder.

In anycase, post a Debug Log and I´ll gladly look through it.

Cheers,
Tobias.
If you have problems please read this before posting

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

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#7
BLKMGK Wrote: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:
If you have problems please read this before posting

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

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#8
Topfs2 Wrote: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 Smile
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:
Code:
<advancedsettings>
    <audio>
        <resample>48000</resample>
    </audio>
</advancedsettings>

Restarted XBMC, and all was well again!
Asus P5N7A-VM + E8400
Ubuntu 9.10 32-bit
XBMC 9.11
Reply
#9
Now, how to get stereo, 5.1, AND NAV soundsusing HDMI! Will try the 48K fix asap though - thanks!
Openelec Gotham, MCE remote(s), Intel i3 NUC, DVDs fed from unRAID cataloged by DVD Profiler. HD-DVD encoded with Handbrake to x.264. Yamaha receiver(s)
Reply
#10
Exclamation 
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?
Openelec Gotham, MCE remote(s), Intel i3 NUC, DVDs fed from unRAID cataloged by DVD Profiler. HD-DVD encoded with Handbrake to x.264. Yamaha receiver(s)
Reply
#11
Debug Log...
If you have problems please read this before posting

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

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#12
This asoundrc works for me:

Code:
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.
Reply
#13
Topfs2 Wrote:Debug Log...

will a Debug Log 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 Smile 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.
Openelec Gotham, MCE remote(s), Intel i3 NUC, DVDs fed from unRAID cataloged by DVD Profiler. HD-DVD encoded with Handbrake to x.264. Yamaha receiver(s)
Reply
#14
Question 
Okay, here's what I have right now:

console output
Code:
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
Code:
pcm.!default hdmi

aplay -l
Code:
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 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 Smile

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.
Openelec Gotham, MCE remote(s), Intel i3 NUC, DVDs fed from unRAID cataloged by DVD Profiler. HD-DVD encoded with Handbrake to x.264. Yamaha receiver(s)
Reply
#15
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 Debug Log is in order.

Cheers,
Tobias
If you have problems please read this before posting

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

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply

Logout Mark Read Team Forum Stats Members Help
MP3 audio (PCM) playing too fast over HDMI/SPDIF0