New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AudioTrack: Workarounds #10809
AudioTrack: Workarounds #10809
Conversation
jenkins build this please |
how does a requested sample rate of 22050 get past the check at line 247 when the min supported sink sample rate is 32000 ? AESinkAUDIOTRACK - 32000 supported |
That's a very good question - let's find that out. |
Build pending here: http://jenkins.kodi.tv/job/Android-ARM/9720/ Here is a testfile: https://dl.dropboxusercontent.com/u/55728161/audio.mp3 Thanks for the feedback |
The problem was with the way the samplerates were chosen. The iterator comparison was wrongly used. I changed the metric for matching samplerates. In order to resample more correctly if needed. Let's wait until that aac 1.0 user from the forum has tested it. My samples are opened as stereo, so that needs to be found out. |
For the record: The bug is here: https://github.com/xbmc/xbmc/blob/master/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp#L248 If you query with 22050 hz the element the upper selects is 32000. That very moment the iterator points to begin() as 32000 is the first element in the set, therefore --s will not (!) point to begin() but to somewhere undefined. And this value we assign -> butz :-) |
jenkins build and merge |
jenkins build and merge after being interrupted by non jenkins merge. |
Jenkins build this please |
// prefer best match or alternatively something that divides nicely and | ||
// is not too far away | ||
uint32_t d = std::abs((int)m_format.m_sampleRate - (int)s) + 8 * (s > m_format.m_sampleRate ? (s % m_format.m_sampleRate) : (m_format.m_sampleRate % s)); | ||
if (d < distance) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -34,6 +34,7 @@ int CJNIAudioFormat::ENCODING_DTS_HD = 0x00000008; | |||
int CJNIAudioFormat::ENCODING_DOLBY_TRUEHD = 0x00000009; | |||
int CJNIAudioFormat::ENCODING_IEC61937 = 0x0000000d; | |||
|
|||
int CJNIAudioFormat::CHANNEL_OUT_MONO = 0x00000004; | |||
int CJNIAudioFormat::CHANNEL_OUT_STEREO = 0x0000000c; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -76,6 +77,7 @@ void CJNIAudioFormat::PopulateStaticFields() | |||
if (sdk >= 5) | |||
{ | |||
CJNIAudioFormat::CHANNEL_OUT_STEREO = get_static_field<int>(c, "CHANNEL_OUT_STEREO"); | |||
CJNIAudioFormat::CHANNEL_OUT_MONO = get_static_field<int>(c, "CHANNEL_OUT_MONO"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
v2: use get_static_field v3: move mono before stereo
jenkins build this please |
Yet another bunch of workarounds for broken firmware. This time AFTV2 via: http://forum.kodi.tv/showthread.php?tid=295014&pid=2446406#pid2446406