qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Audio output for CS4231, patch/RFC
@ 2006-09-23 16:13 Blue Swirl
  2006-09-23 17:52 ` [Qemu-devel] " Fabrice Bellard
  2006-09-24  3:22 ` malc
  0 siblings, 2 replies; 6+ messages in thread
From: Blue Swirl @ 2006-09-23 16:13 UTC (permalink / raw)
  To: fabrice, paul; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 340 bytes --]

Hi,

This patch hooks CS4231 to the audio subsystem. It's not ready for applying, 
though I can already make some noise. Any comments?

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

[-- Attachment #2: cs4231-audio.diff.bz2 --]
[-- Type: application/x-bzip, Size: 2620 bytes --]

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

* [Qemu-devel] Re: Audio output for CS4231, patch/RFC
  2006-09-23 16:13 [Qemu-devel] Audio output for CS4231, patch/RFC Blue Swirl
@ 2006-09-23 17:52 ` Fabrice Bellard
  2006-09-23 19:14   ` Blue Swirl
  2006-09-24  3:22 ` malc
  1 sibling, 1 reply; 6+ messages in thread
From: Fabrice Bellard @ 2006-09-23 17:52 UTC (permalink / raw)
  To: Blue Swirl; +Cc: paul, qemu-devel

Blue Swirl wrote:
> Hi,
> 
> This patch hooks CS4231 to the audio subsystem. It's not ready for 
> applying, though I can already make some noise. Any comments?

One comment: you could move the DMA related functions and registers to 
sparc32_dma.c because it seems reasonnable that the DMA stuff was really 
implemented outside of the cs4231 chip (I believe the same chip was used 
in some PC cards with an ISA based DMA).

Regards,

Fabrice.

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

* [Qemu-devel] Re: Audio output for CS4231, patch/RFC
  2006-09-23 17:52 ` [Qemu-devel] " Fabrice Bellard
@ 2006-09-23 19:14   ` Blue Swirl
  0 siblings, 0 replies; 6+ messages in thread
From: Blue Swirl @ 2006-09-23 19:14 UTC (permalink / raw)
  To: fabrice; +Cc: paul, qemu-devel

>One comment: you could move the DMA related functions and registers to 
>sparc32_dma.c because it seems reasonnable that the DMA stuff was really 
>implemented outside of the cs4231 chip (I believe the same chip was used in 
>some PC cards with an ISA based DMA).

I had thought about that, but the CS and DMA registers are located in nearby 
addresses. Cleanest solution from the driver point of view would be that 
Qemu handled the case correctly where several drivers register 
non-overlapping memory areas of less than one page size within the same 
page. That way the DMA controller could reside in sparc32_dma.c and not know 
anything about CS registers and vice versa.

Looks like the PC cards were called Windows Sound System compatible and 
there were several manufacturers in the early '90s.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

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

* [Qemu-devel] Re: Audio output for CS4231, patch/RFC
  2006-09-23 16:13 [Qemu-devel] Audio output for CS4231, patch/RFC Blue Swirl
  2006-09-23 17:52 ` [Qemu-devel] " Fabrice Bellard
@ 2006-09-24  3:22 ` malc
  2006-09-24  6:23   ` Blue Swirl
  1 sibling, 1 reply; 6+ messages in thread
From: malc @ 2006-09-24  3:22 UTC (permalink / raw)
  To: qemu-devel

Blue Swirl <blueswir1 <at> hotmail.com> writes:

> 
> Hi,
> 
> This patch hooks CS4231 to the audio subsystem. It's not ready for applying, 
> though I can already make some noise. Any comments?

After having a cursory look at it only one thing really caught my attention:
in the audio callback you set s->audio_free to the provided value, but then
in you never use it. If i'm reading everything correctly this would lead to
reading N bytes from DMA in write_audio, succeeding in writing only M bytes
(where M < N) to the audio subsystem and loosing N-M bytes forever. Basically
you should never attempt to do volatile reads of more than audio_free bytes.
SB16 operates in similar fashion.

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

* RE: [Qemu-devel] Re: Audio output for CS4231, patch/RFC
  2006-09-24  3:22 ` malc
@ 2006-09-24  6:23   ` Blue Swirl
  2006-09-24 10:39     ` malc
  0 siblings, 1 reply; 6+ messages in thread
From: Blue Swirl @ 2006-09-24  6:23 UTC (permalink / raw)
  To: malc; +Cc: qemu-devel

>After having a cursory look at it only one thing really caught my 
>attention:
>in the audio callback you set s->audio_free to the provided value, but then
>in you never use it. If i'm reading everything correctly this would lead to
>reading N bytes from DMA in write_audio, succeeding in writing only M bytes
>(where M < N) to the audio subsystem and loosing N-M bytes forever. 
>Basically
>you should never attempt to do volatile reads of more than audio_free 
>bytes.
>SB16 operates in similar fashion.

Okay, thanks for the clarification.

By the way, I couldn't find where AUD_open_out is implemented, what did I 
miss?

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/

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

* RE: [Qemu-devel] Re: Audio output for CS4231, patch/RFC
  2006-09-24  6:23   ` Blue Swirl
@ 2006-09-24 10:39     ` malc
  0 siblings, 0 replies; 6+ messages in thread
From: malc @ 2006-09-24 10:39 UTC (permalink / raw)
  To: Blue Swirl; +Cc: qemu-devel

On Sun, 24 Sep 2006, Blue Swirl wrote:

>> After having a cursory look at it only one thing really caught my 
>> attention:
>> in the audio callback you set s->audio_free to the provided value, but then
>> in you never use it. If i'm reading everything correctly this would lead to
>> reading N bytes from DMA in write_audio, succeeding in writing only M bytes
>> (where M < N) to the audio subsystem and loosing N-M bytes forever. 
>> Basically
>> you should never attempt to do volatile reads of more than audio_free 
>> bytes.
>> SB16 operates in similar fashion.
>
> Okay, thanks for the clarification.
>
> By the way, I couldn't find where AUD_open_out is implemented, what did I 
> miss?

audio/audio_template.h (since code is mostly the same for in and out)

--
mailto:malc@pulsesoft.com

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

end of thread, other threads:[~2006-09-24 10:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-23 16:13 [Qemu-devel] Audio output for CS4231, patch/RFC Blue Swirl
2006-09-23 17:52 ` [Qemu-devel] " Fabrice Bellard
2006-09-23 19:14   ` Blue Swirl
2006-09-24  3:22 ` malc
2006-09-24  6:23   ` Blue Swirl
2006-09-24 10:39     ` malc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).