From kde-core-devel Sun Jul 11 15:15:52 1999 From: Antonio Larrosa Date: Sun, 11 Jul 1999 15:15:52 +0000 To: kde-core-devel Subject: Re: Comments on maudio2 X-MARC-Message: https://marc.info/?l=kde-core-devel&m=93171116629832 Christian Esken wrote: > > >I believe we could make some guarentees about when audio will be played, > >as well, some interface should be available to at least guess at how much > >audio has been played. I'm sure this could be possible. > > More about this below. > >For audio apps that I write, at least the two I'm working on now, some of > >the code is insanely time critical. For example, syncing to external > >MIDI. It looks safe though for me to use the audio filters myself rather > >than depend on an audio server at all. Is that the intent, or does that > >go against the design? > > You want to speak to Stefan Westerfeld (obviously). He has done great work > on the sync-audio-midi thing. We might go with his solution as THE generic > multimedia streaming concept. I think you should take a look at arts. > I haven't looked yet at kmedia2 nor at kmusic (I will do this week), but I suppose it has a open_port, and play_this_wav_data_at_this_ms functions, which play a given waveform at the specified time (with time=0 when opening the port), isn't it ? I'll provide a play_this_note_at_this_ms function, so synchronizing both should be easy (we both could provide a function that synchronizes a given audio port and a midi port, and thus they both would be in sync). This weekend I've started doing the midi server, I think it should be a different app from the audio server, do you also think so ? The way I'm doing it, any app can act as a midiOut interface or as a midiIn interface, in this way: midiIn interfaces midiOut interfaces ------------------ -------------------- midiIn (External synth) ------------> midiOut (External synth) / -----> AWE synth / / kmid (playing) ---------------- / keyview panel (an app) sequencer (playing) ---\ \-------------> sequencer (recording) \ / ----------/ The real (hardware) devices will be always there, and the apps can register/unregister when running. As you see, you can have a sequencer playing through a device, recording what another app is playing, and at the same time, what that app is playing is duplicated and sent to another device. The midi maps (midi mapper) should work only on midiOut devices (which I've called interface as a more general word to be able to talk at the same time about apps that act as devices) I will also do an app to configure this "diagramm" where the user can select the connections as he likes best. The midi server will have a global buffer for _any_ midiOut interface and it should do the timing, as it can't change the OSS buffer once it has written data to it, so only play_this_now events will be written to it (btw, I can't use the /dev/midixx devices as the synth devices only work on /dev/sequencer iirc) As a side note, I only use simple sockets communications. For the incoming data (e.g. in a sequencer recording), what would be best among these solutions ? : 1) start a thread and do a select, so that when data comes in, it generates a Qt signal (pro: would be the nicest solution, otoh: it would force the app to be thread safe) 2) let the application asks every moment if there's data to read (pro: easy otoh: it's __very__ ugly ) 3) ... (fill in) ... I would vote for 1) ( or 3) :-) ) > >Have you considered supporting multiple audio devices? > > Yes, definitley. And about broadcasting the audio to other computers and > audio servers as well. > Could you tell us how have you solved the problem about security ? (hosts from which this server allows to receive audio and hosts from which it doesn't). At this moment, I'm doing the server only for single computers, perhaps when it works, I make it work in a network, but not for now) Btw, I'm curious, iirc, kmedia2 mixes wave data when more than one app try to play, does it uses the hardware on AWE cards when possible ? or does the app mixes them ? Greetings, -- Antonio Larrosa Jimenez antlarr@arrakis.es larrosa@kde.org http://www.arrakis.es/~rlarrosa Klein bottles for rent -- inquire within.