sun backend update

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

sun backend update

j4nKy

hi

attached are some improvements for the newly added sun backend.

- use a single I/O thread, and sync capture and playback using poll(),
  somewhat similar to the alsa backend
- add xrun reporting
- use AUMODE_PLAY instead of AUMODE_PLAY_ALL
- fix a mistake where it was previously checking capture parameters,
  when it should have been checking playback parameters
- some code formatting: 80 character lines, consistent error message
  format (use strerror(), __FILE__@__LINE__ always last), replace
  some printf with jack_error where appropriate, etc

the NetBSD/OpenBSD audio system keeps track of the number of frames
that are missed because read() or write() happened too late.  for
playback, AUMODE_PLAY makes you "catch up to realtime".  if you
miss 1024 frames, then immediately write 2048 frames, only 1024
will actually be sent to the DAC.  AUMODE_PLAY_ALL does not make
you catch up.  if 1024 frames are missed then 2048 are written,
all 2048 are sent to the DAC.

so I chose AUMODE_PLAY, because it is much better for synchronization,
as it doesn't expand playback time.

I'm not sure about adding the restart on xrun functionality that
the alsa backend has.  is there an explanation of the "NT"
functions already written somewhere?  or is it best to just read
the code :)

--
[hidden email]
SDF Public Access UNIX System - http://sdf.lonestar.org

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel

patch-drivers_sun_sun_driver_c (25K) Download Attachment
patch-drivers_sun_sun_driver_h (1021 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: sun backend update

Stéphane Letz

Le 17 mars 08 à 01:16, Jacob Meuser a écrit :

>
> hi
>
> attached are some improvements for the newly added sun backend.
>
> - use a single I/O thread, and sync capture and playback using poll(),
>  somewhat similar to the alsa backend
> - add xrun reporting
> - use AUMODE_PLAY instead of AUMODE_PLAY_ALL
> - fix a mistake where it was previously checking capture parameters,
>  when it should have been checking playback parameters
> - some code formatting: 80 character lines, consistent error message
>  format (use strerror(), __FILE__@__LINE__ always last), replace
>  some printf with jack_error where appropriate, etc
>
> the NetBSD/OpenBSD audio system keeps track of the number of frames
> that are missed because read() or write() happened too late.  for
> playback, AUMODE_PLAY makes you "catch up to realtime".  if you
> miss 1024 frames, then immediately write 2048 frames, only 1024
> will actually be sent to the DAC.  AUMODE_PLAY_ALL does not make
> you catch up.  if 1024 frames are missed then 2048 are written,
> all 2048 are sent to the DAC.
>
> so I chose AUMODE_PLAY, because it is much better for synchronization,
> as it doesn't expand playback time.

Applied
>
>
> I'm not sure about adding the restart on xrun functionality that
> the alsa backend has.  is there an explanation of the "NT"
> functions already written somewhere?  or is it best to just read
> the code :)

Read the code (:

Stephane


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel