[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-omap
Subject:    opening /dev/sound/dsp in RDWR mode on  OMAP 1710 H3 ,
From:       Amit_Choudhary () mindtree ! com (Amit Choudhary)
Date:       2005-01-29 8:15:00
Message-ID: 5959EA4638D8734599AB75EAAFBB6FEF0125D099 () mtv01ex04 ! mindtree ! com
[Download RAW message or body]


Denying RDWR mode would be a good idea, it may save some time for people who
assume that the driver is duplex.

Regarding that Ctrl-C, I just return from audio_sync() without doing
anything. From my point of view, if I want to kill my app or if I have issued
a close on the device then I really don't care about the remaining data.
(Assuming that audio_sync is called only at these times.) 

Can we have a short term solution. May be the DMA allocation can be moved to
later part when there is actually a read/write for the first time. 

And also can we have a check that if one DMA operation (read/write) has been
scheduled then don't schedule the other one and probably put the process to
sleep. Also, probably having different dma callbacks for read and write.

Are these the only glitches in here or is there something else.

Regards,
Amit



-----Original Message-----
From: Menon, Nishanth [mailto:x0nishan@ti.com]
Sent: Friday, January 28, 2005 8:12 PM
To: Amit Choudhary; linux-omap-open-source@linux.omap.com
Subject: RE: opening /dev/sound/dsp in RDWR mode on OMAP 1710 H3 ,system
hangs (Audio driver problems??)


Hi Amit,

U can read/write to the audio device at a time. RDWR mode says that you
are telling the driver that you are going to read and write at the same
time and the driver does some initial preparations like requesting dma
channels, setting up buffers etc. This is a path never taken and not
designed for either. As David said, It would be a simple matter of
putting the following code in audio_open to deny any such ambitious
apps:
if ((file->f_mode & FMODE_WRITE) && (file->f_mode & FMODE_READ))
	goto out;
I did not do it hoping that someone in the community would feel
interested in a full duplex communication and implement the same.

I guess am feeling happy that at least the read works since looks like
some part of the code is working fine.

About the hang. In case DMA hangs, well.. It just wont respond to the
ctrl+c, as the logic to sync up on close would never come out. 

Regards,
Nishanth Menon

-----Original Message-----
From: linux-omap-open-source-bounces@linux.omap.com
[mailto:linux-omap-open-source-bounces@linux.omap.com] On Behalf Of Amit
Choudhary
Sent: Friday, January 28, 2005 8:21 AM
To: linux-omap-open-source@linux.omap.com
Subject: RE: opening /dev/sound/dsp in RDWR mode on OMAP 1710 H3 ,system
hangs (Audio driver problems??)

Hi David and Steve,

I can do certain things in my application to prevent concurrent read and
write accesses. I have also modified some code in the driver so that the
system doesn't hang anymore and a Ctrl-C gets me out peacefully.

But the problem is when I open the /dev/sound/dsp in RDWR mode and then
write
to it. It makes something behave in a wrong way although the read path
is
devoid of any problems. 

Scenario 1
----------
1. Open /dev/sound/dsp in RDWR mode
2. Don't do any write, only read

Result: Everything is fine and I am able to read.

Scenario 2
----------
1. Open /dev/sound/dsp in RDWR mode
2. Don't do any read, only write (writing 64 bytes of data 32 times
works
well because the program exits before DMA gets a chance to complete.
Tried
writing 512 bytes of data 640 times, it gets stuck).

Result: Hangs, presumably DMA gets stuck (although Ctrl-C bails me out).

If I am not doing any read, then DMA should not get stuck. The
combination of
opening the device in RDWR mode + writes to the device causes some
problem.

Any resolution to this would be highly appreciable.

Regards,
Amit





-----Original Message-----
From: David Brownell [mailto:david-b@pacbell.net]
Sent: Friday, January 28, 2005 1:29 AM
To: linux-omap-open-source@linux.omap.com
Cc: Johnson, Steve-OMAP; Amit Choudhary
Subject: Re: opening /dev/sound/dsp in RDWR mode on OMAP 1710 H3 ,
system hangs (Audio driver problems??)


On Thursday 27 January 2005 6:47 am, Johnson, Steve-OMAP wrote:
> 
> The audio driver was written to play or record, but not do both
> simultaneously.  If you want to do both simultaneously, you will need
to
> do a pretty significant rewrite.

Preventing concurrent read and write accesses (and thus presumably
the hang) might be a simple and useful step, though ... :)

- Dave


-------------- next part --------------
-----------------------------------------------------------------------------------------------------------------------------
 Disclaimer
-----------------------------------------------------------------------------------------------------------------------------


"This message(including attachment if any)is confidential and may be \
privileged.Before opening attachments please check them for viruses and \
defects.MindTree Consulting Private Limited (MindTree)will not be responsible for any \
viruses or defects or any forwarded attachments emanating either from within MindTree \
or outside.If you have received this message by mistake please notify the sender by \
return  e-mail and delete this message from your system. Any unauthorized use or \
dissemination of this message in whole or in part is strictly prohibited.  Please \
note that e-mails are susceptible to change and MindTree shall not be liable for any \
improper, untimely or incomplete transmission."

-----------------------------------------------------------------------------------------------------------------------------



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic