Skip to content

Add "stabilization read" to MP3 seeks in SoundSourceCoreAudio.#565

Merged
rryan merged 1 commit into
mixxxdj:masterfrom
rryan:extaudiofile
Apr 24, 2015
Merged

Add "stabilization read" to MP3 seeks in SoundSourceCoreAudio.#565
rryan merged 1 commit into
mixxxdj:masterfrom
rryan:extaudiofile

Conversation

@rryan
Copy link
Copy Markdown
Member

@rryan rryan commented Apr 24, 2015

SoundSourceProxyTest.seekForward was failing on OSX due to
cover-test.mp3 not producing accurate samples on a seek. It seems this
is related to the MP3 decoder not being "primed" right after a seek. To
compensate for this, we seek backwards 29 MP3 frames (same as in
SoundSourceMp3) and read forward.

The test passes now but it would be ideal if we had a reliable way to
determine the right amount to read on a per-file basis from ExtAudioFile
directly (in case other formats need pre-fetching). I'm following up
with Apple support for help here.

@rryan
Copy link
Copy Markdown
Member Author

rryan commented Apr 24, 2015

Paging @asantoni :) might be useful for libaudiodecoder.

@daschuer
Copy link
Copy Markdown
Member

See what Uwe did in sounsource mp3
https://github.com/mixxxdj/mixxx/blob/master/src/sources/soundsourcemp3.cpp#L14

We seek 29 mp3 frames reverse, which is 1152 * 29 sample per channel.

If CoreAudio does not seek revers, you need to seek 33408 stereo frames backward to be bullet prove.

Comment thread src/sources/soundsourcecoreaudio.cpp Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value is applied to any file type isn't it? :-/

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m4a, mp3 and mp2 -- yea

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So wee need to find the worst of them. An the other are suffering an unneeded performance penalty.
Or can can we use SoundsourceMp3 here? Equal weapons for all targets, less special cased code to maintain.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to compare the libmad CPU performance with the coreaudio one?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not have to build libmad on mac. We will always have to use SSCoreAudio for M4A/AAC support so this doesn't actually save us any code.

@rryan
Copy link
Copy Markdown
Member Author

rryan commented Apr 24, 2015

See what Uwe did in sounsource mp3
https://github.com/mixxxdj/mixxx/blob/master/src/sources/soundsourcemp3.cpp#L14

We seek 29 mp3 frames reverse, which is 1152 * 29 sample per channel.

If CoreAudio does not seek revers, you need to seek 33408 stereo frames backward to be bullet prove.

Ah right -- I'll update to use 29 and make it MP3 only.

SoundSourceProxyTest.seekForward was failing on OSX due to
cover-test.mp3 not producing accurate samples on a seek. It seems this
is related to the MP3 decoder not being "primed" right after a seek. To
compensate for this, we seek backwards 29 MP3 frames (same as in
SoundSourceMp3) and read forward.

The test passes now but it would be ideal if we had a reliable way to
determine the right amount to read on a per-file basis from ExtAudioFile
directly (in case other formats need pre-fetching). I'm following up
with Apple support for help here.
@rryan rryan changed the title Add "stabilization read" to every seek in SoundSourceCoreAudio. Add "stabilization read" to MP3 seeks in SoundSourceCoreAudio. Apr 24, 2015
@rryan
Copy link
Copy Markdown
Member Author

rryan commented Apr 24, 2015

PTAL, updated.

@rryan
Copy link
Copy Markdown
Member Author

rryan commented Apr 24, 2015

Merging now to fix the master build.

rryan added a commit that referenced this pull request Apr 24, 2015
Add "stabilization read" to MP3 seeks in SoundSourceCoreAudio.
@rryan rryan merged commit 30120ce into mixxxdj:master Apr 24, 2015
@rryan rryan deleted the extaudiofile branch April 10, 2016 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants