-
Notifications
You must be signed in to change notification settings - Fork 222
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
fixed IOS gui issues, now runs on device (but without sound support) #1450
Conversation
- no multiple window support - storyboard is for splash screen, not main window - set client flag in main.cpp
make sure client settings and chat dialog can be closed in IOS
Thanks for working on this! If there's already an improvement over the status quo by getting this merged, we could merge it as-is, I guess. I have no way to test IOS-related stuff though. @ann0see Are you able to test this? |
Correct. The .pro file was functional for iOS, all I did was run qmake for iOS and made the project work from within XCode. Some review would be nice - this is the first open source project I participate in, and also the first iOS app / C++ / Qt project (my background is in Java service programming). So all feedback is welcome. |
Great! Thank you for working on this. I just compiled and installed it for my iPhone SE and it crashed on the first run. After I granted microphone privileges and started it again, it seemed to load with GUI. Unfortunately, it's a bit slow, but also shows what's possible!! I think Android could also learn from this: You implemented a close button which lacks on Android! |
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.
Thank you very much for working on this! I really appreciate it. GUI seems to work (especially on an iPad?). See my other comments and especially look at the code style.
Attaching crash log:
Probably something with code signing. It only occurs on a start through Xcode. I don't think you'll need to worry about that. |
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 think Android could also learn from this: You implemented a close button which lacks on Android!
When things started working, I immediately got into trouble when I opened the settings window. I could not get back other than quitting the app. For the chat window there was an escape because I could somehow click 'next' to the window and get back to the main window.
However, I dislike the menus in iOS. That is not really the way a GUI should work on a mobile device... but that's quite another issue.
Yep. The GUI works but it clearly shows that it's not an iOS App |
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.
Not approving it yet since we might be able to remove code.
@ann0see @jeroenvv although coding is not my thing, I'd love to try and do a few things here. If it's not complicated, could you show me how to build the iOS version?
Then I couldn't build the project, either using |
Which qmake did you run? What I found out was that I needed to install qt5 with the qt installer (not homebrew), and explicitly select iOS when choosing the Qt version. |
Great! Thanks a lot for the quick response. Indeed I run with homebrew's qmake. I'm reinstalling :) |
@@ -632,7 +632,6 @@ int main ( int argc, char** argv ) | |||
QCoreApplication* pApp = new QCoreApplication ( argc, argv ); | |||
#else | |||
# if defined ( Q_OS_IOS ) | |||
bIsClient = false; | |||
bUseGUI = true; |
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.
Is this needed?
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.
no, and in the last version of the PR, this line has been removed.
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 can still see bUseGui = true in the diff?
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 can image bUseGui is forced to true, independent of command line settings. Apps on IOS must have a GUI.
Team, I've been trying to understand and cook something up for iOS audio. From what I understand from android sound.cpp code, we have to write 3 functions init, start, stop, and callbacks. So I grabbed a sample RemoteIO project from Apple, and started modifying things. In Apple's sample project, I could indeed find codes to init, start and stop the IOUnit. However, I'm having trouble with compiling/linking. (The sample project alone works fine, just the part I took and put into Jamulus is trouble). For information, I don't have any experience with developing audio, or even developing. This is my first time using Qt, Xcode, etc. I even discovered some of Github's amazing features thanks to Jamulus (lol). So I'm posting here some information so that anyone interested in getting iOS audio working can continue, or point me into the right direction, or maybe help, or discuss. Any contribution is welcome. |
Same for me unfortunately: Although I've been programming in Objective-C once, I've never done much with it so I doubt to be much help. I think we can merge this Pull Request and do the audio work in another one. |
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.
Not yet 100% ready to be merged since there's still a code style issue (too many spaces in line 40 clientsettingsdlg.cpp). Otherwise I think all that is ok.
I made progress haha (it could be nothing though, it’s too early). I managed to build with a part of the code taken from Apple. And right when the app loads, my background music stops. And when I try to connect, there’s clearly an orange mic from iOS showing Jamulus is accessing the mic.
I still have the messge “your sound card is not working...”.
Also have to figure out the callback part :)
… On 8 Apr 2021, at 21:55, ann0see ***@***.***> wrote:
Same for me unfortunately: Although I've been programming in Objective-C once, I've never done much with it so I doubt to be much help. I think we can merge this Pull Request and do the audio work in another one.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
spacing issue Co-authored-by: ann0see <20726856+ann0see@users.noreply.github.com>
Maybe we can work together on this? Can you share your code? |
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.
Didn't test the last commit, but since it's just spacing, I'll approve this
Thank you very much for working on this! Next steps:
|
That’d be great, I’ll share my code as soon as I get home! I actually have sound now, but only one way. People can hear me clearly. But I can’t hear people, apart from myself (I think this is default behavior in iOS when dealing with audio data from the mic). I’m having trouble to set the callback to play sound. Feedback about audio quality: buffer size 128 works fine. 64 is not good. Total delay is high and unstable. But ping is already unstable, which is strange because I thought iOS should be good at this. Anyway, apologies because my code is very bad, lots of bad practices and uncommented codes. You’ll see very soon. |
@jeroenvv please excuse my lack of dev experience. I have never developed anything serious. Never used github. So here's my rookie way of sharing code: It's a zip archive of my jamulus project, because I don't really know how to do the right way (make modifications in a fork of the master branch? -EDIT: @jeroenvv branch). Some notes: again, the coding is really bad. I took pieces from jamulus' Mac source code and a sample project from Apple. I removed codes not suitable for iOS in the first and added codes for iOS from the second, then added a few to make them work together. At first I had some linking issues when compiling, which I solved by setting "Compile sources as" "Objective C++", but I also had to add 4 type conversions in the opus library. Now the code handling Mic input (which works) is in the performRender function. I tried to do the same thing to the function playbackCallback to make it route audio data from server to speakers, but haven't succeeded. Don't hesitate to ask questions. Because I'm sure there are pieces of code that make no sense or do nothing, they're just there because I was testing different things. Also, most of the time I have no idea what I'm doing, so please bear with me. |
No problem. The Jamulus contributors/devs will probably be able to help out. I'd advise you to get familiar with git/GitHub which is not too difficult. Once you know what a repository/branch/commit/fork/push is. I might not be able to look into the code yet since there's a lot to do. Others might help out? |
Just requested a review from softins I think it's ok, a developer with a bit more C++/Qt experience should have a look at this before we can merge it. |
I need help with some basic buffer operations: In client.cpp, after the input audio is sent to the server, audio data from server is also fetched into the same buffer Float32* pLeftData = (Float32*) ( bufferList->mBuffers[0].mData );
Float32* pRightData = (Float32*) ( bufferList->mBuffers[1].mData );
// copy output data
for ( int i = 0; i < inNumberFrames; i++ )
{
printf ("Allocated left data at %lx ",pLeftData);
printf ("Allocated right data at %lx ",pRightData);
// copy left and right channels separately
pLeftData[i] = (Float32) pSound->vecsTmpAudioSndCrdStereo[2 * i] / _MAXSHORT;
pRightData[i] = (Float32) pSound->vecsTmpAudioSndCrdStereo[2 * i + 1] / _MAXSHORT;
} |
It seems to me that loop from 0 to |
Indeed I have to add a check for actual number of frames. But in this case my concern is more about pLeftData and pRightData access. Allocated, but one line of code later, back to NULL? |
Happy to look at it at some point, but my time is very limited right now. However, I'm wondering if merging this should be delayed until after we have released the next update anyway. |
Is that what's happening? What I'm saying is that if the index runs off the end, then the address you'll get back will be zero, quite possibly, hence appear to be NULL. |
|
UPDATE: I finally got sound both ways. I'll clean up the code and try to do a proper pull request. That's a lot of firsts for me so please bear with me :) |
Team I've uploaded my repo here https://github.com/ngocdh/jamulus-ios (clean source code, working sound for iOS) but don't know how to create a pull request. Can you help? FYI, I'm using source control in Xcode. I first created a clone from https://github.com/jeroenvv/jamulus/tree/ios_gui, but then Xcode seems to treat https://github.com/jeroenvv/jamulus as the master branch, to which I can't create pull request. |
@ngocdh how did you create your repo? I think you did not start it out as a fork of jamulussoftware/jamulus. When you start your repo as a fork, you can then commit changes and submit a pull request to the original repository. |
Thanks a lot @jeroenvv all good now. I just sent my first pull request. |
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.
Happy to approve and merge these changes, as they are simple and are needed for further iOS work.
Thanks people! |
This is my first attempt to create a working IOS version. Made some minor changes to have to GUI run on IOS iPhone and iPad.
I have not yet worked on sound support.