Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* making aoss able to wrap fopen() calls
@ 2004-02-05 16:26 Peter Kirk
  2004-02-05 16:49 ` Jaroslav Kysela
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Kirk @ 2004-02-05 16:26 UTC (permalink / raw)
  To: ALSA development

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hey,

During a thread on alsa-user I was told that aoss does not wrap fopen() calls. 
Since I am trying to dmix/dnsoop/asym some oss applications, I am trying to 
find a way around this restriction.

Could you point me to a good idea of implementing this ? On irc I was 
discussing doing a libc wrapper that replaces the fopen calls with some 
substitute (that aoss can handle), but I'm not sure if its the way to go. 

Please tell me how it can be achieved.

Thanks in advance
Peter
- -- 
He played the king as if afraid someone else would play the ace.
		-- John Mason Brown, drama critic
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAIm7Fg2ieGvTmHiURAu2/AKCTbppd/g5Fvg7l50XK6UdCaknhFACfdzkf
GEqmfQ/1VT15FUoF1T5/3Xw=
=jMJf
-----END PGP SIGNATURE-----



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: making aoss able to wrap fopen() calls
  2004-02-05 16:26 making aoss able to wrap fopen() calls Peter Kirk
@ 2004-02-05 16:49 ` Jaroslav Kysela
  2004-02-06 11:28   ` Peter Kirk
  0 siblings, 1 reply; 5+ messages in thread
From: Jaroslav Kysela @ 2004-02-05 16:49 UTC (permalink / raw)
  To: Peter Kirk; +Cc: ALSA development

On Thu, 5 Feb 2004, Peter Kirk wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hey,
> 
> During a thread on alsa-user I was told that aoss does not wrap fopen() calls. 
> Since I am trying to dmix/dnsoop/asym some oss applications, I am trying to 
> find a way around this restriction.
> 
> Could you point me to a good idea of implementing this ? On irc I was 
> discussing doing a libc wrapper that replaces the fopen calls with some 
> substitute (that aoss can handle), but I'm not sure if its the way to go. 
> 
> Please tell me how it can be achieved.

The whole libaoss is based on glibc wrappers (open, close, ioctl, write, 
read, mmap) so follow this rule ;-)

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: making aoss able to wrap fopen() calls
  2004-02-05 16:49 ` Jaroslav Kysela
@ 2004-02-06 11:28   ` Peter Kirk
  2004-02-09 14:07     ` Jaroslav Kysela
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Kirk @ 2004-02-06 11:28 UTC (permalink / raw)
  To: alsa-devel; +Cc: Jaroslav Kysela

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Donnerstag, 5. Februar 2004 17:49 schrieb Jaroslav Kysela:
> > Could you point me to a good idea of implementing this ? On irc I was
> > discussing doing a libc wrapper that replaces the fopen calls with some
> > substitute (that aoss can handle), but I'm not sure if its the way to go.
> >
> > Please tell me how it can be achieved.
>
> The whole libaoss is based on glibc wrappers (open, close, ioctl, write,
> read, mmap) so follow this rule ;-)

Right, 

I have done some looking at source code, and have found the places I needed to 
find (in alsa-oss.c). 
Two questions:
(1) Is my assumtion right, that I will have to write substitute functions for 
fopen(), fclose(), fread() and fwrite() ?

(2) My current approach is to "translate" the f* calls into calls that can be 
handled already. Is this a good idea ?

Peter
- -- 
A critic is a bundle of biases held loosely together by a sense of taste.
		-- Whitney Balliett
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAI3pJg2ieGvTmHiURAhCoAKCbo0VxbUDm85MBiR9ZpqX3HhDUxgCdFya4
+2bewyW36EcCJksr9jpWsOY=
=1X1j
-----END PGP SIGNATURE-----



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: making aoss able to wrap fopen() calls
  2004-02-06 11:28   ` Peter Kirk
@ 2004-02-09 14:07     ` Jaroslav Kysela
  2004-02-09 18:19       ` Peter Kirk
  0 siblings, 1 reply; 5+ messages in thread
From: Jaroslav Kysela @ 2004-02-09 14:07 UTC (permalink / raw)
  To: Peter Kirk; +Cc: alsa-devel

On Fri, 6 Feb 2004, Peter Kirk wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Am Donnerstag, 5. Februar 2004 17:49 schrieb Jaroslav Kysela:
> > > Could you point me to a good idea of implementing this ? On irc I was
> > > discussing doing a libc wrapper that replaces the fopen calls with some
> > > substitute (that aoss can handle), but I'm not sure if its the way to go.
> > >
> > > Please tell me how it can be achieved.
> >
> > The whole libaoss is based on glibc wrappers (open, close, ioctl, write,
> > read, mmap) so follow this rule ;-)
> 
> Right, 
> 
> I have done some looking at source code, and have found the places I needed to 
> find (in alsa-oss.c). 
> Two questions:
> (1) Is my assumtion right, that I will have to write substitute functions for 
> fopen(), fclose(), fread() and fwrite() ?
> 
> (2) My current approach is to "translate" the f* calls into calls that can be 
> handled already. Is this a good idea ?

I'm more digging to this problem now and it seems that it's completely 
broken idea. Basically the FILE structure is not public outside the glibc, 
so mangling is very hard and very difficult to maintain.

The sox has already support for ALSA, but because it use f* calls, it's
limited to "hw:X,Y" devices only. So I suggest to use pipes (and stdin or
stdout in sox) rather than doing something very ugly.

I also don't like very much the situation with the OSS->ALSA wrapper.  
Right now, I'm working on a very small library which will reroute the
native OSS calls to any dynamic library. So ALSA, arts, esd and other
audio subsystems can use modified OSS programs directly. The modification
of one application requires only a few minutes for a middle skilled
programmer. Now, I need persuade audio developers to use this library 
rather than direct calls.

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: making aoss able to wrap fopen() calls
  2004-02-09 14:07     ` Jaroslav Kysela
@ 2004-02-09 18:19       ` Peter Kirk
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Kirk @ 2004-02-09 18:19 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Montag, 9. Februar 2004 15:07 schrieb Jaroslav Kysela:
> On Fri, 6 Feb 2004, Peter Kirk wrote:
> > Am Donnerstag, 5. Februar 2004 17:49 schrieb Jaroslav Kysela:
> > > > Could you point me to a good idea of implementing this ? On irc I was
> > > > discussing doing a libc wrapper that replaces the fopen calls with
> > > > some substitute (that aoss can handle), but I'm not sure if its the
> > > > way to go.
> > > >
> > > > Please tell me how it can be achieved.
> > >
> > > The whole libaoss is based on glibc wrappers (open, close, ioctl,
> > > write, read, mmap) so follow this rule ;-)
> >
> > Right,
> >
> > I have done some looking at source code, and have found the places I
> > needed to find (in alsa-oss.c).
> > Two questions:
> > (1) Is my assumtion right, that I will have to write substitute functions
> > for fopen(), fclose(), fread() and fwrite() ?
> >
> > (2) My current approach is to "translate" the f* calls into calls that
> > can be handled already. Is this a good idea ?
>
> I'm more digging to this problem now and it seems that it's completely
> broken idea. Basically the FILE structure is not public outside the glibc,
> so mangling is very hard and very difficult to maintain.
>
> The sox has already support for ALSA, but because it use f* calls, it's
> limited to "hw:X,Y" devices only. So I suggest to use pipes (and stdin or
> stdout in sox) rather than doing something very ugly.
>
> I also don't like very much the situation with the OSS->ALSA wrapper.
> Right now, I'm working on a very small library which will reroute the
> native OSS calls to any dynamic library. So ALSA, arts, esd and other
> audio subsystems can use modified OSS programs directly. The modification
> of one application requires only a few minutes for a middle skilled
> programmer. Now, I need persuade audio developers to use this library
> rather than direct calls.


Ok,

that propably explains why my patch causes some weird results...will not spend  
anymore time with it. Hopefuly I will see the day where I can use teamspeak 
with multiple input streams.

Thanks for the update, saves me from the headaches

Peter
- -- 
The husband who doesn't tell his wife everything probably reasons that
what she doesn't know won't hurt him.
		-- Leo J. Burke
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAJ88fg2ieGvTmHiURAntnAJ9mas87AX20ZGOzbOctGDRHFRAz9gCeK0Z7
6sy3rbbRgFb2JQrcTA0CyH4=
=ka4v
-----END PGP SIGNATURE-----



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-02-09 18:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-05 16:26 making aoss able to wrap fopen() calls Peter Kirk
2004-02-05 16:49 ` Jaroslav Kysela
2004-02-06 11:28   ` Peter Kirk
2004-02-09 14:07     ` Jaroslav Kysela
2004-02-09 18:19       ` Peter Kirk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox