-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
WIP: Core Audio Backend #6056
WIP: Core Audio Backend #6056
Conversation
Thank you for the work you have done and are continuing to do on this. I feel that lack of CoreAudio support has been a huge drawback up until now. |
@kfreezen, are you still working on this? And are you willing to do what it takes to make this pull request mergeable? If so, then I can give you as much or as little help as you need. Otherwise, I would be happy to take over from here. |
@mattmcclinch Yes, I'm still working on it. I got to the point where I didn't know what else to do. I thought that I'd add a PR here and get others' input on it. As for specific comments on the code, I will be replying to those throughout the day today. Thanks for your interest in this. It makes me a little happier than I was before I saw this thread this morning. |
By the way, if you don't know what else to do, you can work on reformatting your code so that it follows the coding rules. |
@mattmcclinch is there an auto-formatter somewhere I can use for that?
…On Fri, May 8, 2020 at 8:58 AM mattmcclinch ***@***.***> wrote:
By the way, if you don't know what else to do, you can work on
reformatting your code so that it follows the coding rules
<https://musescore.org/en/handbook/developers-handbook/finding-your-way-around/musescore-coding-rules>
.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6056 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACUWLBKUITHUVW7VUPVVQTRQP6W3ANCNFSM4M3UHY4A>
.
|
You will probably have to do it by hand. |
There is an xml file suitable for QtCreator in the developerts' handbook |
Are you using the MacBook Pro speakers or something else?
…On Fri, May 8, 2020 at 22:44 mattmcclinch ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In audio/drivers/coreaudio.cpp
<#6056 (comment)>:
> + OSStatus osErr = AudioObjectSetPropertyData (kAudioObjectSystemObject, &theAddress, 0, NULL, sizeof(CFRunLoopRef), &theRunLoop);
+ if (osErr != noErr) {
+ initialized = false;
+ return false;
+ }
+
+ AudioObjectPropertyAddress outputDeviceAddress = {
+ kAudioHardwarePropertyDefaultOutputDevice,
+ kAudioObjectPropertyScopeGlobal,
+ kAudioObjectPropertyElementMaster
+ };
+
+ AudioObjectAddPropertyListener(kAudioObjectSystemObject, &outputDeviceAddress, &onDefaultOutputDeviceChanged, this);
+
+ AudioDeviceID deviceId = getDefaultOutputDevice();
+ return openAudioUnit(&audioUnit, &deviceId, this);
MacBook Pro (15 inch, 2018), macOS Catalina Version 10.15.4.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6056 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACUWLBJXHPY2DUUFMAVYG3RQS7SHANCNFSM4M3UHY4A>
.
|
The pitch issue occurred when I was just using the MacBook Pro speakers. If I had earphones plugged in or a bluetooth headset connected, it sounded fine. |
Please squash all these commits into just one |
461e790
to
38a168e
Compare
I'm hoping that covers all the formatting changes. Tried to make sure I got them all. There seems to be a glitch I'm running into intermittently while using the CoreAudio driver. The position indicator froze at position 0 in the score and the sequencer buffer filled to max. I can't get that to reproduce consistently for me though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a few remaining formatting issues. Also, please use Q_UNUSED to silence the many 'unused parameter' warnings in coreaudio.cpp.
9c828a8
to
c9d5ef6
Compare
c9d5ef6
to
ae807c9
Compare
I'm curious whether there's anything I missed on this one, or if it's waiting on someone else? |
It needs a rebase, adjusting to the new coding style. There's a script to help with that, in tools/codestyle. |
4b96e6a
to
8b109e9
Compare
There are some glitches that a friend and I have run into while testing this branch over the last 3-4 months. The main glitch is what looks like the sequencer freezing after the program has been running in the background for a while. I have not narrowed down what causes the bug, since it's fairly intermittent and shows up when you hit the Play button. It seems like the problem is fixed if I edit the score before playing, however. Maybe someone can give me some ideas on where to look for this one? |
Added option and tabstop for Core Audio to preference dialog
8b109e9
to
611fc52
Compare
I'm curious what architecture changes are being actively made in MuseScore. Is there a source or documentation on those arch changes? Is audio driver code moving to another project? That's what it looks like. |
@igorkorsukov should be able to answer that. |
Yes, that's right, the architecture of the project has changed a lot. The new audio driver is here, you can preview it. I am very sorry that we were not able to take advantage of your work. |
@igorkorsukov no problem. As long as I can get "instant switching" with my Airpods, I'm happy. Where is a good place to ask questions about the general architecture and MuseScore's long term goals with it? |
You can ask questions in pull requests or in the development chat https://t.me/musescoreeditorchat (if the question is about architecture, then it's better to mention me) |
@psmokotnin FYI |
I added a basic Driver class for a Core Audio backend, and added a RadioGroupBox to the preference dialog for selecting Core Audio.
Why did I want to add this code/What are the benefits?
I wanted MuseScore to switch output devices automatically if I were to plug one in. PortAudio required me to mess with the I/O tab in the Preferences dialog to switch output devices. PortAudio has no API for tracking output device changes.
Using Core Audio directly has another benefit, which is a lower "Energy Impact" score. My not-so-scientific test yielded a difference between 5 and 2.5 when playback was stopped. It's not groundbreaking, but it is a small improvement.