IRC log of #maemo-devel for Tuesday, 2010-09-14

MNZso the default device is a softvol that dumps into dmix, and PA connects directly to dmix, if PA connects then the softvol is muted. PA will just sit idle most of the time except for calls00:00
DocScrutinizersounds feasible, yes00:00
MNZexcept for media apps that do PA directly and not ALSA's pulse plugin00:01
DocScrutinizerI don't know enough bout PA to comment on the best way to marry it with ALSA/ACI00:04
MNZyou know about the alsa 'pulse' plugin?00:04
DocScrutinizersorry, ttyl00:05
MNZnp, c ya00:05
DocScrutinizerdinner, if I find anything yet00:05
*** silbo__ has quit IRC00:06
*** csaavedra has quit IRC00:14
*** MNZ has quit IRC00:47
*** SpeedEvil has quit IRC01:28
*** SpeedEvil1 has joined #maemo-devel01:28
*** SpeedEvil1 is now known as SpeedEvil01:30
*** swc|666 has joined #maemo-devel01:44
*** SpeedEvil has quit IRC02:30
*** SpeedEvil has joined #maemo-devel02:30
*** alvaro__ has quit IRC02:33
*** GeneralAntilles has quit IRC02:49
*** GeneralAntilles has joined #maemo-devel02:51
*** matnel has quit IRC03:33
*** lcuk has quit IRC03:45
*** swc|666 has quit IRC03:49
*** matnel has joined #maemo-devel04:01
*** swc|666 has joined #maemo-devel06:13
*** kamui__ has joined #maemo-devel07:17
*** shinkamui has quit IRC07:22
*** DocScrutinizer has quit IRC07:33
*** DocScrutinizer has joined #maemo-devel07:33
*** tealbird has joined #maemo-devel07:44
*** septiq has joined #maemo-devel08:07
*** ShadSEC has quit IRC10:03
*** ShadSEC has joined #maemo-devel10:09
*** ShadSEC has quit IRC10:13
*** ShadSEC has joined #maemo-devel10:14
*** ShadSEC has quit IRC10:22
*** ShadSEC has joined #maemo-devel10:29
*** amigadave has joined #maemo-devel10:30
*** ShadSEC has quit IRC10:35
*** csaavedra has joined #maemo-devel10:45
*** jacekowski has quit IRC10:45
*** ShadSEC has joined #maemo-devel10:48
*** jacekowski has joined #maemo-devel10:50
*** gopal has joined #maemo-devel11:09
*** ShadSEC has quit IRC11:09
gopalhi, is there any limit on the size of the file an application is allowed to create in /tmp partition?11:10
*** ShadSEC has joined #maemo-devel11:14
gopalwhen i created my files in my home folder it was created properly...but in the tmp folder there was an error...only some parts of the file where created11:18
*** ShadSEC has quit IRC11:33
*** amigadave has quit IRC11:38
*** ShadSEC has joined #maemo-devel11:41
*** amigadave has joined #maemo-devel11:45
*** boogeyman has joined #maemo-devel11:46
*** swc|666 has quit IRC11:48
*** ShadSEC has quit IRC11:56
*** MNZ has joined #maemo-devel11:57
*** tron71 has joined #maemo-devel12:23
*** ptl has quit IRC12:35
*** ShadSEC has joined #maemo-devel12:38
*** ShadSEC has quit IRC12:43
*** achipa has joined #maemo-devel12:43
*** csaavedra has quit IRC12:44
*** csaavedra has joined #maemo-devel12:44
*** ptl has joined #maemo-devel12:46
*** ptl has quit IRC12:46
*** ptl has joined #maemo-devel12:46
*** tron71 has quit IRC13:03
*** septiq has quit IRC13:13
*** ShadSEC has joined #maemo-devel13:16
*** ShadSEC has quit IRC13:20
*** silbo__ has joined #maemo-devel13:35
*** ShadSEC has joined #maemo-devel13:39
*** madsy_ has joined #maemo-devel13:49
*** madsy has quit IRC13:49
*** ShadSEC has quit IRC13:52
*** ShadSEC has joined #maemo-devel13:59
*** ShadSEC has quit IRC14:06
*** ShadSEC has joined #maemo-devel14:18
*** silbo__ has quit IRC14:29
*** silbo__ has joined #maemo-devel14:35
*** ShadSEC has quit IRC14:39
*** ShadSEC has joined #maemo-devel14:44
*** ShadSEC has quit IRC14:49
*** lmoura_ has joined #maemo-devel14:53
*** ShadSEC has joined #maemo-devel14:56
*** lmoura has quit IRC14:56
*** jarkkom has joined #maemo-devel14:58
*** ShadSEC has quit IRC15:10
*** jarkkom has quit IRC15:13
*** lmoura_ has quit IRC15:18
*** ShadSEC has joined #maemo-devel15:18
*** jarkkom has joined #maemo-devel15:18
*** lizardo has joined #maemo-devel15:28
*** lmoura_ has joined #maemo-devel15:29
*** gopal has quit IRC15:40
*** alvaro__ has joined #maemo-devel15:46
*** qknight_ has joined #maemo-devel16:10
*** septiq has joined #maemo-devel16:13
*** skrr has joined #maemo-devel16:17
DocScrutinizerMNZ: (acihooklib, ACI basics) <copy from another chan> DocScrutinizer: idea being the user apps using ALSA snd_open() and snd_close() don't do this with "ALSA:default" but come with their own .alsarc.d/* alsaconfig files to include to ALSA .alsarc and defining a unique ALSA audio device for the app. Then with acihooklib and ALSA hooks plugin you define arbitrary commands that get executed whenever such a unique individual audio dev is16:26
DocScrutinizersnd_open()'ed or close()'ed16:26
MNZDocScrutinizer, Why the unique alsa device?16:38
DocScrutinizerbecause then you get e.g. a softvol for each app for free, and also you probably want to assign app specific commands assigned to the unique device's unique acihooklib/hooks plugin16:40
DocScrutinizerof course several mp3 players might just use one generic audiodev like musicplayback:0.016:42
MNZwell most alsa apps simply open the default device and have config options to change to another device16:43
MNZAnd that's what we have on maemo, the default device being a virtual device (pulseaudio plugin, dumps audio to PA which does its thing and dumps back to hw:0,0)16:43
DocScrutinizersure that's not really the topic here though16:43
DocScrutinizeryepyep16:44
DocScrutinizerthe idiocy being when the app doesn't allow for any other device than ALSA:default16:44
DocScrutinizerbut you can 'fix' that by defining a thing like "#include $APPS_OWN_AUDIODEV" in global .asoundrc, and start app with "APPS_OWN_AUDIODEV=/path/to/my/asoundrcfile  app"16:46
DocScrutinizerthen redefining default inside this $APPS_OWN_AUDIODEV file16:47
DocScrutinizerdon't ask me how to use that scheme for generic PA apps16:47
MNZ:D clever16:48
DocScrutinizerMNZ: I've been thinking about that shit for 2+ years until acihooklib finally hitting the world16:48
MNZwhat does the default alsa hook functionality offer?16:50
DocScrutinizerwould be a sad and disappointing result if it only were some simple "use dmix instead of PA"16:50
DocScrutinizerdefault alsa hook function is to set controls like alsactl does16:50
DocScrutinizeror alsamixer16:51
DocScrutinizereven locking, and restoring on device close16:51
DocScrutinizerthis alone is pretty powerful a tool16:51
DocScrutinizeradd acihooklib and you can do virtually everything, just using ALSA and forget PA and other weird approaches16:52
MNZactually my current thought on this is 2 softvols dumping into a dmix. 1 softvol is set to default, and 1 is set as PA's sink. If PA ever opens this softvol, the other one is completely muted. So all calls and system stuff goes through PA (can't change that) but media (mafw stuff and native alsa) goes through the other softvol16:52
DocScrutinizersounds sensible and exactly along my own thoughts16:53
DocScrutinizerMNZ: for an alternative to PA's much praised hotswitching of audio cards (e.g. from speaker to headset): you can split a downstream into 2 duplicates, run each one thru a softvol, and let them output to e.g. speaker and headset same time16:57
DocScrutinizerplug-detect daemon of wired headset simply would mute the speaker softvol (first raw approach)16:58
*** achipa has quit IRC16:58
MNZActually speaker amp is turned on/off in the driver on plug detection as well16:59
DocScrutinizerheh, so finally no nead to care about softvol muting then :-D16:59
DocScrutinizerneed*16:59
DocScrutinizerthough I really don't apreciate that concept. E.G ringtone playback when headphones plugged in should ramp up volume of ringtone via headset first, and after some 5..10s should start concurrent playback via speakers - you might have dropped the device anywhere without unplugging the headset. Or just have the headset 'unplugged' from your ears17:02
MNZI've noticed this in the PA configs17:03
MNZthere are two alsa playback devices, and only on ringing are both of them used, otherwise audio is dumped only to one of them17:04
MNZI'm unsure yet what the other one is17:04
DocScrutinizer(btw seems we're now entering fields where even PA isn't as versatile as ALSA + ACI :-D )17:04
MNZhehe17:04
DocScrutinizerand the most funny part: all this done by mere understanding and exploiting existing options in ALSA, plus some config file tweaking, plus some 100lines of code for a lib.so specified and coded by a weirdo (me) with some help of a brilliant kernel hacker (paul)17:10
MNZheh fun times :D17:12
DocScrutinizernow add to this a small program called by acihooklib (or a acihooklib extension) that talks to a central resource arbiter and device state management entity ( :-P ) via d-bus, and knows how to pass arbitrary signals and/or keypress events etc to PPID (the audio app parent process), like "P" keyevent for 'pause' to mp3player...17:19
DocScrutinizernota bene, still all this needs ZERO customizing of original audio application, except setting audio device config correctly. No special maemo sourcecode version, implementing messing around with d-bus calls to MCE to avoid e.g. screen blanking during video playback. All that can be done with original unmodded app plus ACI17:22
DocScrutinizerwhich has been my major goal when inventing this: keep apps unchanged, avoid need for any platform specific modifications17:24
MNZWas this work originally with the purpose of removing PA from maemo?17:25
DocScrutinizerthen came PA on virtually all desktop distros, and users bitching about all formerly nicely working ALSA based apps now need to learn PA, as PA's ALSA compatibility plugin is resulting in all sorts of audio problems17:26
DocScrutinizerMNZ: nope, this work was targeted direction sane Openmoko audio system17:26
DocScrutinizerOpenmoko discarded PA after some 8 weeks as it had performance issues and ate large amounts of CPU X-P17:27
DocScrutinizerso PA never been on by dish for that17:28
DocScrutinizermy*17:28
ShadowJKheh, I never got alsa to work any better without pulse than what it does with alsa's pulse plugin17:34
DocScrutinizerShadowJK: maybe you never seriously tried?17:35
ShadowJKthough setting apps to usw hw:0,0 or something directly worked awesomely, though only one app at a time17:35
DocScrutinizeras in "create your own customized .asoundrc" etc17:35
MNZI dunno but I never actually *tried* to get alsa working, because it just does. Last I recall messing with asound.conf on my laptop/PC was several years ago on LFS (linux from scratch) :/17:36
DocScrutinizer:-))17:37
MNZShadowJK, just set programs to use the 'default' device. A dmix plugin is created automagically now17:37
DocScrutinizerMNZ: that largely depends on distro maintainers' effort to correctly support your particular hardware in asoundrc17:38
DocScrutinizerand lib/alsa/config17:38
DocScrutinizeror whatever it's named17:38
*** madsy_ has quit IRC17:39
MNZit's not distro maintainer's job even, the alsa folks do that stuff17:39
DocScrutinizer:nod:17:39
*** madsy has joined #maemo-devel17:39
ShadowJKyeah well, point me to the documentation and I'll give it a go :-)17:39
MNZI don't even HAVE asound.conf/.asoundrc on my current installation :D17:39
ShadowJKthe dmix plugin randomly hangs for me :/17:39
DocScrutinizerhmmm17:40
DocScrutinizeranyway documentation is ALSA's major flaw, admittedly17:40
*** amigadave has quit IRC17:41
DocScrutinizerI started there: http://alsa.opensrc.org/.asoundrc17:41
MNZfor dmix http://alsa.opensrc.org/index.php/Dmix17:41
DocScrutinizerhttp://www.alsa-project.org/~jfulmer/alsa-faq.html17:42
DocScrutinizerhttp://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html17:43
DocScrutinizerhttp://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html17:43
ShadowJKI also had latency reporting and buffer fill reporting issues with dmix17:43
ShadowJKthe values reported were like "full, full, full, full, empty" :/17:44
DocScrutinizersorry, I don't get the point of latency reporting17:44
DocScrutinizerand yes, ther's some problems there - been at least. See twinkle audio_device.c for some 10 lines dealing with that17:45
ShadowJKthe length of audio between the sample playing and the last sample in the buffer17:45
DocScrutinizerwhy would you want to know?17:46
ShadowJKBecause if dmix is holding 5 seconds of audio, or even .5 seconds of audio, I want to know, so that I can delay video by that amount, so that sound and lip movement are synchronized17:47
DocScrutinizerthere's fillup threshold and lower-threshold you can specify when your process gets interrupted by ALSA device's ring buffer management17:47
DocScrutinizerShadowJK: ALSA isn't designed to work that way aiui. define your buffers in a way they meet your needs17:48
*** septiq has quit IRC17:49
DocScrutinizerALSA is driven by audio hw card's clock, not by app process' timers17:49
DocScrutinizerso the point where timing is correct is the speaker output, and you just fill ahead the buffers, while starting audio and video playback in sync and then forget about it17:50
ShadowJKIn order to display video at the same rate as the audio hw clock, you need to know how fast the audio hw clock is running17:51
DocScrutinizerI guess there's other ways to probe that than latency value polling17:51
ShadowJKsnd_pcm_delay() is awesome when talking to hw:0,0 (or whatever the syntax is), but when dmix gets in the middle, the returned values become increasingly useless :/17:52
DocScrutinizerof course17:52
DocScrutinizerthat's an obvious system imanent property17:52
jacekowskiyou have to love linux sound system17:52
DocScrutinizeranyway it's really easy to define a audio device plugin stack in asoundrc, that guarantees any arbitrary maximum latency. System load will increase accordingly to lower buffer sizes / lower latency. So usually you just use a plugin stack defined in a way to meet your latency requirements. For video playback I'd guess that's somewhere around 50..100ms17:55
DocScrutinizerand no need for snd_pcm_delay()17:56
DocScrutinizer:-)17:56
ShadowJKI don't actually care about maximum latency or minimum latency. It can be whatever it wants, it can even change, I don't care. I just want an accurate figure of what it is17:56
ShadowJKiirc it was like 2-5 seconds with dmix :)17:57
DocScrutinizerjust don't expect 'alsa:default' to meet your needs, and try to work around it with snd_pcm_delay() when finding it actually doesn't17:57
DocScrutinizeras that'S quite sure the wrong way to go17:57
DocScrutinizerShadowJK: your statement is paradox17:58
ShadowJKNo it's not17:58
DocScrutinizereither you care about latency, then deal with it in a reasonable way (by using a properly defined plugin stack), or you don't care, then do not whine about whatever your default setup is doesn't meet your (allegedly nonexistent) latency requirements17:59
ShadowJKI don't have latency requirements as such. It's fine even if the buffer is 60 seconds big (and even nicer if the entire buffer can be paused or thrown away).18:01
DocScrutinizerit can18:01
DocScrutinizerobviously not for dmixed audio streams though, as that would mean you're possibly discarding output of another process mixed in18:02
ShadowJKYou only need low latency for realtime stuff, like telephony or, uh, if you want to emulate a karaoke player18:02
DocScrutinizercheckout twinkle! after v0.4.1 +- there's never been any complaints about latency, until PA came messing up stuff18:04
DocScrutinizerShadowJK: and btw in my book telephony with a tolerable max latency of maybe 500ms is all but realtime18:07
ShadowJKalsa-pulse seems to give me about 500ms18:08
DocScrutinizerso that's any great or what?18:09
ShadowJKWell it's positive that each call to snd_pcm_delay() actually reports a different value18:14
ShadowJKand not the same value for half a second then jumping to a new value ;p18:14
*** pH5 has joined #maemo-devel18:14
DocScrutinizerthat's not what it's supposed to do, so it's actually positive18:15
DocScrutinizerand - once again - I don't see the need for using  snd_pcm_delay() usually, and I guarantee it's useless for plugin stacked audio devices18:16
DocScrutinizerit's not the recommended way to deal with the issue18:16
DocScrutinizeryou can't complain about object destructor doesn't work correctly in assembler. Different domain, different paradigm18:17
DocScrutinizerALSA obviously wasn't designed to use  snd_pcm_delay() on plugin stacks, and I'd say it's no big loss as there are better ways to deal with the issue than that18:19
DocScrutinizercalling  snd_pcm_delay() at top of a plugin stack and then trying to adjust audio(!) according to the results (even when they were of any meaning and accuracy) is like pushing a rope18:21
DocScrutinizerlet's say you're using a very complicated ALSA plugin stack with a lot of buffering to playback audio of a video. You get all parameters of the stack on opening the audio device, you can rather precisely estimate what's your min and max latency (say 500ms min, 600ms max). You have to live with the 'jitter' of 20% (or define a better audio plugin stack which yields better jitter and lower latency). You start video playback in sync with18:30
DocScrutinizeraudio playback, after filling audio buffers. Now when you playback for 30min, maybe clock source of audio hw has some drift, and you occasionally detect you can't fill buffers with the expected data rate, and you sit on one buffer frame of 25ms you have 'spare' as your video is ahead due to audio clock being a tad slow. What do you do? Obviously you need to insert a duplicate frame to VIDEO to get it back in sync to your audio, and18:30
DocScrutinizerfine you are again18:31
DocScrutinizerif you're smart you will insert that dup frame after detecting 2 rather identical original frames in sequence, as then you'll not see any artifacts in moving objects18:36
DocScrutinizerif you're even smarter you tune your framerate slightly to adapt to the audio clock source freq18:36
DocScrutinizeror you tune your audio sample generation rate to compensate for the audio hw clock slightly off to what you expected it was18:38
DocScrutinizerdropping audio buffer frames is a bad idea, as is inserting filler frames (except when silence)18:39
ShadowJKI wouldn't try to adjust audio as a result of snd_pcm_delay18:40
DocScrutinizerWAAAAAH, would you please stop debating about snd_pcm_delay18:41
DocScrutinizerwhere in my above monolog was snd_pcm_delay ?18:41
DocScrutinizerexcept in "dont use snd_pcm_delay" in prolog18:42
ShadowJKsystem clock and audio clock are like +- 10% of eachother, so just starting audio and video at the same time and hoping for the best doesn't work18:42
ShadowJK"calling  snd_pcm_delay() at top of a plugin stack and then trying to adjust audio(!) according to the results" <- that18:42
DocScrutinizerseen next line and rest of this line????18:42
DocScrutinizer (even when they were of any meaning and accuracy) is like pushing a rope18:44
ShadowJKThe way that video players do it is something like this for 25fps video, 44100hz audio: Show first frame, start playing audio. decode next frame, Wait until audio drivers report that 1764 samples have been played, display the decoded frame, wait for audio drivers to report another 1764 samples played18:44
DocScrutinizerumm, so you say as they are doing BS we need to do BS as well?18:45
ShadowJKthe video rate (relative to system clock here, mind) is adjusted to audio clock. Audio samplerate isn't adjusted and isn't resampled18:46
ShadowJKand audio frames aren't inserted or dropped18:46
DocScrutinizerumm, so where's the problem? evaluate true audio clock rate (or, more precisely, apparent true audio clock rate as seen from a closed system based on inaccurate system clock) - e.g playback 10s of silence and see what this gets you. then calculate all your remaining numbers based on that, and fine you are18:48
DocScrutinizerand for all I know almost every sw video player has a setting to adjust audio-video skew by +-some-seconds18:49
DocScrutinizerso you absolutely don't need short latency. And aiui you're just on my line for the rest of the procedure18:50
ShadowJKsure.. but if there's a A-V delay that's constant throughout, then it's either a problem in parsing the file, or you get an error from the delay reporting that's constant and non-changing, which is annoying, but not the end of the world18:50
ShadowJKA constant error is easier to deal with than a $real-$reported value that's non-constant and has a sawtooth waveform :-)18:51
DocScrutinizerdelay reporting in alsa aiui means knowing your plugin stack18:51
DocScrutinizerthe sawtooth is exactly what's really going on while ringbuffer emties fradually, then is filled by another chunk18:52
DocScrutinizerthat's the jitter you have to live with18:52
ShadowJKSo I think this is my original point, that once plugins get involved, you don't know if you get good data anymore, like alsa wasn't designed to keep it..18:53
DocScrutinizerthough you're free to make it as small as you like, at expense of higher system load for smaller biffers18:53
ShadowJKpulseaudio is a horrible CPU hog and likes to hang apps and itself daily, but atleast it seems designed to not throw away stuff the sound system is reporting :-)18:54
DocScrutinizerfrom inspecting and knowing your plugin stack you know the abs max/min values aka jitter you'll encounter18:54
*** septiq has joined #maemo-devel18:57
DocScrutinizerbtw for things like voip the situation is more complicated as you have two clock sources, one in your local audiio hw and one in far end hw. In that case you can't avoid occasional audio frame dropping or inserting, to sync with the far end18:58
DocScrutinizerSIPphones not dealing with this are the ones that see occasional "lad is increasing to minutes, after hours of call duration" bugs18:59
DocScrutinizers/lad /lag /18:59
DocScrutinizerfor meadi playback you're happily rif of that issue18:59
ShadowJKthe "jitter" is one sample big when you deal directly with hw:0,0, even if the buffer setup is 16384 samples * 8 buffers :-)19:00
DocScrutinizermedia19:00
DocScrutinizererr what?19:00
ShadowJKYep, what I said :-)19:02
DocScrutinizersorry don't follow - which 'jitter'?19:02
DocScrutinizerthe values repited by snd_pcm_delay ?19:03
DocScrutinizerreported19:03
ShadowJKyeah19:03
DocScrutinizernow that's odd19:03
ShadowJKobviously if you repeatedly ask how many bytes you can write to the buffer, it's 0 until it jumps to 1638419:03
DocScrutinizerexcept if you use sample by sample filling of buffer19:03
DocScrutinizernow that's exactly *not* what you said before19:04
DocScrutinizerit's absolutely sane19:04
DocScrutinizeranyway, RL is calling19:05
DocScrutinizercya19:05
DocScrutinizersee, audio HARDWARE might have a buffer which is big enough to hold 16384. hw:0.0 is filling this buffer whenever hw tells "I'm getting out of data" - in a chunk of 16384. There quite well may be no way whatsoever to ask the audio hardware how much of that chunk actually has been sent out via D/A. That's the whole purpose of advanced audio hw, not to load burden of transferring 16bit every 1/44.000 of a second. Thats why IRQs were19:10
DocScrutinizerinvented19:10
DocScrutinizerso how could you get any sawtooth like you supposed, from  snd_pcm_delay() on hw:0.0?19:12
DocScrutinizerthat's simply Heissenberg of audio19:13
*** shinkamui has joined #maemo-devel19:17
DocScrutinizeryou define a Heissenberg as small as fits your needs, on setting up audio stack, and then have to live with it. no  snd_pcm_delay() whatsoever will get you beyond that Heissenberg, once your audio device is set up19:18
DocScrutinizeryou know you're in sync when starting hw playback of first filled buffer, and you know there's something not exactly to the specs not earlier than when a whole buffer size aka Heissenberg constant of audio of offset has elapsed, so that's where you are19:21
*** kamui__ has quit IRC19:21
DocScrutinizerotherwise you'd be back to polling when  exactly snd_pcm_delay() is jumping, and that's just a silly way to say "I would need smaller buffer size"19:22
*** silbo__ has quit IRC19:51
*** septiq_ has joined #maemo-devel19:57
*** septiq has quit IRC20:00
*** septiq_ is now known as septiq20:00
*** septiq has quit IRC20:06
*** VDVsx has joined #maemo-devel20:31
*** swc|666 has joined #maemo-devel21:12
*** edisson has joined #maemo-devel21:15
*** lmoura_ has quit IRC21:27
*** lmoura has joined #maemo-devel21:27
*** VDVsx has quit IRC21:45
jarkkomanyone worked with threaded mainloop pulseaudio? I've got app that runs just fine on emulator under ubuntu but running it on actual n900 there's segfault somewhere inside libpulsecommon after app gets PA_CONTEXT_CONNECTING callback21:57
*** shadeslayer has left #maemo-devel22:02
*** lcuk has joined #maemo-devel22:10
MNZDocScrutinizer, using softvol how do I get the control to show up? with22:12
MNZwith card "0"22:12
MNZit's supposed to show with amixer -D hw:022:13
DocScrutinizerhmm, yup I'd guess so22:13
DocScrutinizerfor me *iirc* it sometimes needed some mixer restart (kmixer) for the volume sliders (two as all alsa plugins are down- as well as upstream, except a few like dmix, dsnoop) to show up on the tabs. Also make sure they're not hidden, several mixers allow hiding controls22:15
MNZI'm using amixer, a simple alsa util that just dumps controls on stdout as text22:15
MNZohhh frrriiiiigggg22:22
*** go1dfish has quit IRC22:23
*** 16SAAFA93 has joined #maemo-devel22:24
*** ShadSEC has quit IRC22:27
DocScrutinizerohhh what?22:41
MNZnvm I thought it was stale inodes or something (I had mved asound.conf and made a new one, so if it was still open by something...)22:42
MNZbut no, full restart and still can't get control to show up22:42
DocScrutinizerI have to admit I can't recall how amixer was dealing with softvol22:42
MNZthough the pcm registers ("aplay -L" lists it22:42
MNZI have read two docs that say it should work as expected22:43
MNZsomething fishy is happening22:43
DocScrutinizererr, there's been some catch, lemme think22:43
DocScrutinizercheck if card '0' parameter is correct.22:44
*** go1dfish has joined #maemo-devel22:44
MNZit seems to be right. I tried both "0" and 022:45
MNZwhat's                 [iface STR]     # interface of the element22:45
DocScrutinizerhttp://tech.groups.yahoo.com/group/twinklephone/message/1786  +-A thread context22:46
*** _0x47 has joined #maemo-devel22:55
MNZok still doesn't work, but I tried playback and it adds 20% cpu usage to mplayer XD XD22:57
*** air has quit IRC23:00
DocScrutinizerlol23:02
MNZand 10% of those is resampling :D changed dmix to 44100 and instant 10% down23:03
DocScrutinizerbtw, you're aware of the Plugin: Route & Volume  ( http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html ) ?23:04
* SpeedEvil wonders HTF you get 10% CPU on resampling.23:04
MNZSpeedEvil, I was thinking of that.... but both PA and dmix seem to require quite a bit of computing to do it23:06
MNZTBH I have no idea what the computation behind this is23:06
MNZDocScrutinizer, I don't get it, what does that do?23:06
DocScrutinizere.g. mixes down stereo to mono; out= L*0.5 + R*0.523:07
DocScrutinizeror mono to stereo, or quattro23:07
MNZis... that it?23:08
DocScrutinizeryep, it's all it does23:08
ShadowJK48000 -> 44100 ate about 5% on a P3-733MHz with the non-stupid algorithm :/23:11
DocScrutinizergood resampling is friggin expensive23:16
DocScrutinizerseveral MULADDS and maybe even trigo23:17
DocScrutinizeror ln23:17
DocScrutinizerall in real23:18
lcukgood resampling can be done entirely in integer23:18
lcukbut you need LOTS of integers ;)23:18
DocScrutinizerok, ot that23:19
DocScrutinizeror23:19
DocScrutinizerand at lease int32 :-D23:19
DocScrutinizerdarn, at least23:19
DocScrutinizeris alexia a co-symptom of alzheimer?23:20
DocScrutinizerMNZ: anyway, by all means avoid resampling whenever possible23:22
DocScrutinizeryou MUST NOT resample multiple times for a single device23:22
DocScrutinizer~211923:23
DocScrutinizer~join!!23:23
MNZWell the codec supports changing sampling rate23:24
MNZalsa devices support multiple rates?23:24
MNZso eg. you open and specify a rate and it passes down the rate to the hw23:24
DocScrutinizerit's absolutely better nevertheless to keep sampling rate at 48000 for all plugin stack, than to resample 44100 -> 48000 after dmix and whatnot running on a slightly cheaper rate23:25
DocScrutinizerMNZ: it does this for all usual plugins, except plug plugin, and resample plugin23:26
MNZso how would I set multiple rates for dmix..?23:27
DocScrutinizeruse aplay -v xy.wav for a nice listing of plugin stack, incl sampling rates in and out of each, buffer sizes, format etc23:28
DocScrutinizerconnect to dmix via plug23:28
DocScrutinizerdevice uses plug:dmix:hw23:29
DocScrutinizerdmix and hw work with rate defined in hw, plug resamples if needed to the rate app asked for on opening the stack23:30
*** 16SAAFA93 has quit IRC23:32
DocScrutinizerpcm.xxx {23:32
DocScrutinizer    type plug23:32
DocScrutinizer    slave.pcm "dmix"23:32
DocScrutinizer}23:32
*** pH5 has quit IRC23:34
DocScrutinizerNote that the dmix plugin itself supports only a single configuration. That is, it supports only the fixed rate (default 48000), format (S16), channels (2), and period_time (125000). For using other configuration, you have to set the value explicitly in the slave PCM definition. The rate, format and channels can be covered by an additional plug plugin, but there is only one base configuration, anyway.23:35
MNZok I'm confused. So the hw supports different rates, can you outline how to exploit that?23:36
DocScrutinizersee, dmix needs to add/mix streams of same format. So on first invocation, the app is defining format, rate etc, and this propagates down the stack until hw, getting all sorts of modifications explicitly defined on the way. when hitting hw it asks hw about what that "plugin" supports, and if hw can do the requested rate, an ACK will propagate up the stack23:39
villagerpc-gamer hardware supports different rates, and alsa supports it on that hardware... the n900 hardware might not support that23:39
DocScrutinizerfor a seconds source using same dmix, the dmix and lower levels of plugins and hw are predefined23:39
DocScrutinizerbut usually you'll define a rate in hw slave plugin23:40
DocScrutinizerso you always see same situation when opening same device, no matter if it's been opened concurrently by another app and what parameters that app asked for. the plug plugin between app and dmix is converting whatever the app asked for to the fixed dmix rate then23:42
DocScrutinizerand you know your output won't eventually be 8000 and sound like an old phone, while you asked for 44100 stereo for HiFi23:42
MNZbut if it's fixed like that... then how can the hardware be exploited to avoid resampling?23:44
DocScrutinizerthat's indeed almost impossible23:45
DocScrutinizerbut when you think about it, this could be done only for mutual exclusive use of a hw23:45
DocScrutinizerso no dmix involved, and any concurrent snd_open() will fail23:45
villagerwhich is what caused all the pulseaudio precursors to get invented...23:46
DocScrutinizerso I.E. you just use hw:0.0 directly from your app, and hw will open whatever app asks, as long as it's supported by hw23:46
MNZI was thinking something like first open() sets the current rate and next concurrent() open would simply resample. But that doesn't look possible23:49
MNZunless we write an alsa plugin for it (and I'm not sure if it becomes possible then)23:49
DocScrutinizerindeed that's wha's hapening when you are using plug;dmix:hw23:49
DocScrutinizerwithout explicitly defined rates23:50
MNZbut I just tried without specifying rate and it simply uses 48k23:50
DocScrutinizerwhatever rate first app asks for, propagates down the stack and sets hw rate23:50
DocScrutinizerfor second app dmix is fixed to what frist app asked for, and plug will resample23:51
MNZDocScrutinizer, but I just tried that! aplay playing 44.1k wav to plug:dmix:hw23:51
MNZall of which have no rate setting, but -v tells me all are 48k23:51
DocScrutinizerhmm, and your hw slabe plugin has no rate specified?23:51
MNZno rates whatsoever23:52
DocScrutinizerumm, that's weird23:52
MNZnot really. With no rate specified it simply sets it to a default of 48k23:52
DocScrutinizermaybe I got something wrong then, or there's something odd in maemo ASLA23:52
MNZThat opening and setting current rate thing, I think it would need a separate plugin23:52
DocScrutinizercan you pastebin -v please?23:53
*** lizardo has quit IRC23:53
DocScrutinizeralso try specify rate for aplay explicitly23:54
MNZtried that, same thing23:55
MNZhttp://pastebin.com/5N3KMAqz23:55
DocScrutinizernah, when you tell aplay to use -r 44100, then either plug is resampling to 48000, or whole stack is using 44100, or snd_open() fails23:56
MNZyeah, same thing as in plug goes 44.1k23:56
MNZrest is 4823:56
MNZactually, without plug and no rate settings I get a message saying 'asked for 44.1 but got 48'23:57
DocScrutinizercheck23:59

Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!