From: Alex W. <ale...@at...> - 2002-09-05 05:12:35
Attachments:
aica.diff
|
I was a little perturbed by how much system time was being consumed when playing mp3s on the dc, so I went looking around. The main problem seems to be the busy wait in aica_audio_tidy_buffers() for "high freq" audio. I changed the 23000 Hz to 48000, and the dc seems to keep up just fine. For me this made playing a 44100 Hz mp3 go from ~85% system time to <5%. While I was in there I did some other cleanups and rewrote the buffer allocation scheme. I haven't done much more than play mp3s, so use at your own risk. Let me know what you think. I'm not on the mailing list, so please keep me in the CC. Thanks, Alex |
From: <ad...@mc...> - 2002-09-05 08:52:23
|
ale...@at... wrote: > > I was a little perturbed by how much system time was being consumed > when playing mp3s on the dc, so I went looking around. The main problem > seems to be the busy wait in aica_audio_tidy_buffers() for "high freq" > audio. I changed the 23000 Hz to 48000, and the dc seems to keep up > just fine. For me this made playing a 44100 Hz mp3 go from ~85% system > time to <5%. While I was in there I did some other cleanups and rewrote > the buffer allocation scheme. I haven't done much more than play mp3s, > so use at your own risk. Let me know what you think. I'm not on the > mailing list, so please keep me in the CC. Thanks, > Alex > I'm a bit puzzled, as I have played high sample rate and bit rate MP3s without seeing any real impact on system time etc. But I haven't been using very sophisticated tools to measure it (just looking at 'uptime' really). But I've certainly been able to run this in the background without any noticeable impact on foreground applications. Tell me more about your setup - what player are you using and what tool to measure system time etc. In the meantime I'll remind myself what myy code looks like. Can you post a patch? Adrian |
From: Alex W. <ale...@at...> - 2002-09-05 13:03:47
Attachments:
aica.diff
|
ad...@mc... wrote: > > I'm a bit puzzled, as I have played high sample rate and bit rate MP3s without seeing any real impact on system time etc. But I haven't been using very sophisticated tools to measure it (just looking at 'uptime' really). > > But I've certainly been able to run this in the background without any noticeable impact on foreground applications. > > Tell me more about your setup - what player are you using and what tool to measure system time etc. > > In the meantime I'll remind myself what myy code looks like. Can you post a patch? > > Adrian > > I'm using mpg123 to play the mp3 and top to see what the system is up to. I also noticed that previously I was not able to run "bb" w/o it dogging as soon as the audio started up. With the changes it plays pretty smooth (maybe one audio skip). I posted a patch with my original mail. That was against r1.5 that's currently in CVS. Looks like it got truncated in the archive... don't know if that's normal. I'll try again. Alex |
From: <ad...@mc...> - 2002-09-05 16:59:45
|
ale...@at... wrote: > ad...@mc... wrote: > > > > I'm a bit puzzled, as I have played high sample rate and bit rate MP3s without seeing any real impact on system time etc. But I haven't been using very sophisticated tools to measure it (just looking at 'uptime' really). > > > > But I've certainly been able to run this in the background without any noticeable impact on foreground applications. > > > > Tell me more about your setup - what player are you using and what tool to measure system time etc. > > > > In the meantime I'll remind myself what myy code looks like. Can you post a patch? > > > > Adrian > > > > > I'm using mpg123 to play the mp3 and top to see what the system is up > to. I also noticed that previously I was not able to run "bb" w/o it > dogging as soon as the audio started up. With the changes it plays > pretty smooth (maybe one audio skip). I posted a patch with my original > mail. That was against r1.5 that's currently in CVS. Looks like it got > truncated in the archive... don't know if that's normal. I'll try > again. > Alex Apologies. I'm using an online mail reader, so missed the patch. Are you using the m17n disto then? Could you email me a copy of top? What is bb? Is that a media demo app? > > |
From: Alex W. <ale...@at...> - 2002-09-06 00:07:29
|
ad...@mc... wrote: > > Apologies. I'm using an online mail reader, so missed the patch. Are you using the m17n disto then? Could you email me a copy of top? > > What is bb? Is that a media demo app? > I'm running an upgraded version of the 7/28 base available from http://debian.dodes.org/. I believe top was in there by default. It's dynamically linked, so not sure it would work if I just sent the binary. Let me know and we can try if you want. bb (http://aa-project.sourceforge.net/bb/) is an ascii text mode demo. Kinda silly, but pretty amazining what you can do w/ ascii. Alex |
From: Adrian M. <ad...@mc...> - 2002-09-05 19:39:17
|
Well, I haven't applied the patch but I have tested performance with top. Although not all of top worked for me (especially the CPU %ages) - I could certainly see that mpg123 is eating close to 100% of processor time for high bitrate samples - 49 seconds of real time being recorded as 49 seconds of process time. But I'm not sure users will want *any* clicks. What do people think? I will apply tyhe patch and have a look. Adrian |
From: Adrian M. <ad...@mc...> - 2002-09-06 23:54:30
|
Alex, Well, having tested this I'm not inclined to import it - though I am open to persuasion. I had no problems at all with playing mp3s or even some video mpegs (including the famous dancemonkeyboy.mpeg) but when I played a *very* demanding mpeg with mplayer there were both clicks and repeated audio. Even with -framedrop specified the clicks remained, though there were no repeats. The judgement is a fine one (mplayer isn't up to playing the mpeg in sync with the current aica driver without -framedrop, but it doesn't click or repeat either). But as the sleeping doesn't free up extra computing time for mplayer, it generated only bad things for mplayer's performance, rather than anything positive. I accept that your buffering code is neater than the existing code and would be happy to add that regardless. On the driver - what do others think? This is really about multitasking - is anybody doing that and having problems with sound? If so, then maybe Alex's patch should go in.... Let me know Adrian |
From: Alex W. <ale...@at...> - 2002-09-07 01:33:15
|
Adrian, If you're not willing to take it as is, you could always add a build option or module option to skip the sleep at a certain frequency threshold. Since most people are building their own kernel, that would make for a win-win. Personally, I'm trying to get my dc to the point that I can use it as a network mp3 player w/ a web front-end for song selection... I think the less cpu hungry audio driver will manage that just fine. Thanks, Alex Adrian McMenamin wrote: > Alex, > > Well, having tested this I'm not inclined to import it - though I am open to > persuasion. > > I had no problems at all with playing mp3s or even some video mpegs (including > the famous dancemonkeyboy.mpeg) but when I played a *very* demanding mpeg > with mplayer there were both clicks and repeated audio. Even with -framedrop > specified the clicks remained, though there were no repeats. > > The judgement is a fine one (mplayer isn't up to playing the mpeg in sync with > the current aica driver without -framedrop, but it doesn't click or repeat > either). But as the sleeping doesn't free up extra computing time for > mplayer, it generated only bad things for mplayer's performance, rather than > anything positive. > > I accept that your buffering code is neater than the existing code and would > be happy to add that regardless. > > On the driver - what do others think? This is really about multitasking - is > anybody doing that and having problems with sound? If so, then maybe Alex's > patch should go in.... > > Let me know > > > Adrian > |
From: <ad...@mc...> - 2002-09-05 08:55:19
|
ale...@at... wrote: > > I was a little perturbed by how much system time was being consumed > when playing mp3s on the dc, so I went looking around. The main problem > seems to be the busy wait in aica_audio_tidy_buffers() for "high freq" > audio. I changed the 23000 Hz to 48000, and the dc seems to keep up > just fine. For me this made playing a 44100 Hz mp3 go from ~85% system > time to <5%. While I was in there I did some other cleanups and rewrote > the buffer allocation scheme. I haven't done much more than play mp3s, > so use at your own risk. Let me know what you think. I'm not on the > mailing list, so please keep me in the CC. Thanks, > Alex > I'm a bit puzzled, as I have played high sample rate and bit rate MP3s without seeing any real impact on system time etc. But I haven't been using very sophisticated tools to measure it (just looking at 'uptime' really). But I've certainly been able to run this in the background without any noticeable impact on foreground applications. Tell me more about your setup - what player are you using and what tool to measure system time etc. In the meantime I'll remind myself what myy code looks like. Can you post a patch? Adrian |