Skip to content
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

enable audio playback #19

Closed
Wouter1 opened this issue Dec 30, 2014 · 10 comments
Closed

enable audio playback #19

Wouter1 opened this issue Dec 30, 2014 · 10 comments

Comments

@Wouter1
Copy link
Owner

Wouter1 commented Dec 30, 2014

Maybe we can also fix the playback

@Wouter1
Copy link
Owner Author

Wouter1 commented Dec 30, 2014

Let's first try to fix 96kHz and lower; I already saw places that need fixing for higher rates.

@Wouter1
Copy link
Owner Author

Wouter1 commented Jan 1, 2015

There seems a rather fundamental issue with the existing approach.

Every write to USB call can write about 64*580 ~ 37kB.
The ring buffer is 3 * 4096 * 6 = 73728 bytes.
So we can easily have one wrap every two USB calls.

There are 4 framelists for the write.

So it seems we can have 2 wraps scheduled at any one time.

However, the approach currently has only one 'theWrapRangeDescriptor'

@Wouter1
Copy link
Owner Author

Wouter1 commented Jan 2, 2015

There also was something wrong with the erase head position. Disabled that for now.
Playback now seems to work but more testing is needed and also cleanup and refactor of the code

Wouter1 added a commit that referenced this issue Jan 2, 2015
@Wouter1
Copy link
Owner Author

Wouter1 commented Jan 2, 2015

Tested audio playback on 44.1 and 96kHz, seems to kind of work. Still getting overrun warnings, and more testing is needed.192kHz not yet tested.

@Wouter1
Copy link
Owner Author

Wouter1 commented Jan 2, 2015

Switching the rate seems to disable the playback connection with the EMU. It seems only 44kHz is actually working.

@Wouter1
Copy link
Owner Author

Wouter1 commented Jan 3, 2015

The switching of the rate seems to mangle the virtual and physical format of the channels from "mixable" to "unmixable".

HALLab tool can be used to set it back to "mixable" (select EMU, click "info", select "Streams" tab, and in the Output Stream column then change "Virtual format" to "Mixable".

@Wouter1
Copy link
Owner Author

Wouter1 commented Jan 3, 2015

With that trick, all rates, 48kHz and 96kHz and even 192kHz seem to work fine! I'm a bit suspicious of this, everthing says it's 192kHz and even the lights on the EMU device dim as usual with 192kHz but is this really? I would expect some more bugs

@Wouter1
Copy link
Owner Author

Wouter1 commented Jan 3, 2015

There was a weird code snip in EMUUSBAudioEngine that added the found LinearPCM formats from the device as isMixable=false AFTER adding them as isMixable=true. I have no idea what's the idea behind that but removing that solved the problem

Wouter1 added a commit that referenced this issue Jan 3, 2015
…mit. Audio playback after changing rate now works.
@Wouter1 Wouter1 closed this as completed Jan 3, 2015
@twixst
Copy link

twixst commented Jan 8, 2015

Hi! Im still cant manage playback to work
Before, it did not worked at all, and now audio is playing, but without sound
Im using yosemite, help please

@Wouter1
Copy link
Owner Author

Wouter1 commented Jan 8, 2015

twixst,
Thanks for your interest in my driver.
Probably you have the problem reported in issue #18. For some computers playback is not yet working. Please check issue #18 and if that sounds like your problem, keep an eye on that ticket. If you think your issue is something different, please report.

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

No branches or pull requests

2 participants