![]() |
#76 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
THIS IS THE OLD TAR.GZ FROM THE ORIGINAL TOP POST.
Moved here now. THIS IS ONLY TESTED ON A K3 - PLEASE USE THE TONES DEMO FOR OTHER MODELS Usage ./Balsamic ./YourWave.wav Note that this version will probably not support the plughw device for now. So stereo waves in sensible rates, I think. Sorry for the foof. Last edited by twobob; 07-12-2012 at 10:59 PM. Reason: updated details. thanks knc1 |
![]() |
![]() |
![]() |
#77 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
|
![]() |
![]() |
![]() |
#78 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Thanks for the tip
Quote:
Well, I have these building again. albeit somewhat shonkily. Time to play with some noises. EDIT: UPDATED TOP POST. Last edited by twobob; 07-10-2012 at 02:41 PM. Reason: finally replaced all the broken downloads. |
|
![]() |
![]() |
![]() |
#79 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
![]()
Well. I managed to get my hands on some fairly heavyweight code for full duplex.
Sadly though the initialisation period of the card is making it choke THE FAIL: straced. Spoiler:
This smells to me like unhandled underrun so I'll see if I can get it to double up on the buffer times. Nice to get some fresh code code to rummage around in. http://pastebin.com/fCicqctq EDIT: Even with an enormous period of pcm_period_size=4096 it still dies off after just a few seconds... Perhaps some more rugged error handling is in order. Spoiler:
Last edited by twobob; 07-10-2012 at 08:03 PM. Reason: Added further failure :) |
![]() |
![]() |
![]() |
#80 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
More code - More fail:
Another interrupt driven example that fails:
http://equalarea.com/paul/alsa-audio.html Title "A Minimal Interrupt-Driven Program" ( 3rd on page) THE FAIL: straced. Spoiler:
The Code Spoiler:
So issues with that one... Polling doesn't look like it wants to play nice. ![]() It's only an example. I prefer the previous posts design in oh so many ways. Last edited by twobob; 07-10-2012 at 08:06 PM. Reason: Added Code ref |
![]() |
![]() |
![]() |
#81 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Code:
frames_to_deliver = frames_to_deliver > 4096 ? 4096 : frames_to_deliver; Why? There was a recent GCC bug fixed in the ARM arch for "wrong code generation" from that construct. Quicker to just re-write it and re-test than run down all of the who/what/when/why of the bug. |
|
![]() |
![]() |
![]() |
#82 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Posix signals for audio - polling not great
Using posix signals for Linux Audio IO is evil by all accounts - so best avoid Async stuff.
(http://mailman.alsa-project.org/pipe...ay/008030.html) I'm not getting much mileage from the polling either. possibly need more error handling It's supposedly the better option. sigh. Would be nice to work out which are the more solid transfer methods. Here's some fairly helpful Do's and Dont's, syndicated with permission (as indicated on the page http://0pointer.de/blog/projects/guide-to-sound-apis ) here Spoiler:
Last edited by twobob; 07-10-2012 at 09:12 PM. Reason: added refs. |
![]() |
![]() |
![]() |
#83 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Ternary form no good?
Quote:
![]() I'll give it another pop then I went with Code:
if (frames_to_deliver > 4096) {frames_to_deliver = 4096;} EDIT: It didn't help, but good catch anyways. Frankly I'm not so keen on this second example. The first one is much more robust. Last edited by twobob; 07-10-2012 at 09:04 PM. Reason: added reworked code |
|
![]() |
![]() |
![]() |
#84 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
4 results. Really?
|
![]() |
![]() |
![]() |
#85 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
More Nice things:
https://lwn.net/Articles/495612/ Has an article on this years Linux Audio Conference. Which info is like finding hens teeth might I add. In addition this is usually a paid for link. As a one-off this particular article is free to read. Happy days. (They also have a run-down of linux plugins here https://lwn.net/Articles/501978/ which code glean some inspriration) https://ccrma.stanford.edu/software have a few audio code goodies to get your head around. (and they know a thing or two) Time for bed. ![]() |
![]() |
![]() |
![]() |
#86 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Looks like the tones demo I top posted uses about 35 - 40% of the cpu just to do the demo...
![]() Would like to see this run side-by-side geekmasters code now to see if the device can handle it ![]() Clearly some optimisation to be done. |
![]() |
![]() |
![]() |
#87 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Re: never touching system files, you can temporarily replace a system file with a modified copy using bind mount, like I did in my tccmake script. You would need to launch you app with a script that does the bind mount before your app, then unmounts after.
|
![]() |
![]() |
![]() |
#88 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#89 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
I like the coroutines method by Simon Tatham (the PuTTY guy), which allows logically interleaving control flow while maintaining visual separation: http://www.chiark.greenend.org.uk/~s...oroutines.html We could use that to interleave the video and audio code inside one control loop. Simon Tatham also has a nice collection of simple Java games that might make nice kindlets: http://www.chiark.greenend.org.uk/~sgtatham/puzzles/ Anyway, I am looking forward to adding some some code to gmplay, to play gmv video files that contain interleaved audio and video (using your code above). Thanks. Just need to get caught up at work a bit first before I take some "educational play time". Re: running side-by-side, you can do that by opening two SSH shells... Last edited by geekmaster; 07-11-2012 at 04:52 AM. |
|
![]() |
![]() |
![]() |
#90 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Okay, I opened up three SSH sessions on my K3. I ran htop in one. Then I ran gmplay with the Howard Lloyd clock video. Htop reported gmplay using 88% CPU. Then I ran tones, which made gmplay get jerky (slower framerate) and dropped gmplay to about 37% CPU, while tones took 40% CPU.
After about 20 seconds, tones aborted with "Write error: Input/output error", then gmplay jumped back up to 88%. I think a lot of that time is spent in system calls (especially on the K3, which does not return from the eink update until complete). gmplay spends a significant amount of time sleeping on the K4 or K5 (while the K3 is inside the system calls). Perhaps the K3 eink drivers use a wait loop or spinlock, consuming CPU overhead. Last edited by geekmaster; 07-11-2012 at 04:07 AM. |
![]() |
![]() |