Re: CVS commit: src/sys

2020-04-28 Thread Tetsuya Isaki
At Wed, 29 Apr 2020 12:22:01 +0900,
Tetsuya Isaki wrote:
> > i would just put it in types.h called __AUDIO_BLK_MS,
> > and leave a default used in the code if unset.
> It sounds nice.
> I commit once here, and then I will try it.

How about this diff?
The old platforms are the same as before, hppa, m68k, sh3, sparc(!64)
and vax.

Thanks,

--- a/sys/arch/hppa/include/types.h
+++ b/sys/arch/hppa/include/types.h
@@ -103,4 +103,8 @@ extern const char __CONCAT(name,_ras_start[]), 
__CONCAT(name,_ras_end[])
 #define__HAVE_MM_MD_DIRECT_MAPPED_PHYS
 #define__HAVE_MM_MD_KERNACC
 
+#if defined(_KERNEL)
+#define__AUDIO_BLK_MS (40) /* See sys/dev/audio/audio.c */
+#endif
+
 #endif /* _HPPA_TYPES_H_ */
diff --git a/sys/arch/m68k/include/types.h b/sys/arch/m68k/include/types.h
index d8b1347ae..0a581dff0 100644
--- a/sys/arch/m68k/include/types.h
+++ b/sys/arch/m68k/include/types.h
@@ -80,6 +80,7 @@ typedef int   __register_t;
 
 #if defined(_KERNEL)
 #define__HAVE_RAS
+#define__AUDIO_BLK_MS (40) /* See sys/dev/audio/audio.c */
 #endif
 
 #endif /* !_M68K_TYPES_H_ */
diff --git a/sys/arch/sh3/include/types.h b/sys/arch/sh3/include/types.h
index 9a8b247be..f0a8e92d7 100644
--- a/sys/arch/sh3/include/types.h
+++ b/sys/arch/sh3/include/types.h
@@ -79,6 +79,7 @@ typedef   int __register_t;
 
 #if defined(_KERNEL)
 #define__HAVE_RAS
+#define__AUDIO_BLK_MS (40) /* See sys/dev/audio/audio.c */
 #endif
 
 #define__HAVE_CPU_LWP_SETPRIVATE
diff --git a/sys/arch/sparc/include/types.h b/sys/arch/sparc/include/types.h
index 01af19775..360bb069a 100644
--- a/sys/arch/sparc/include/types.h
+++ b/sys/arch/sparc/include/types.h
@@ -141,4 +141,10 @@ typedef unsigned long int  __register_t;
 #define__HAVE_TLS_VARIANT_II
 #define__HAVE_COMMON___TLS_GET_ADDR
 
+#if defined(_KERNEL)
+#if !defined(__arch64__)
+#define__AUDIO_BLK_MS (40) /* See sys/dev/audio/audio.c */
+#endif
+#endif
+
 #endif /* _MACHTYPES_H_ */
diff --git a/sys/arch/vax/include/types.h b/sys/arch/vax/include/types.h
index e49c9db96..8ab482051 100644
--- a/sys/arch/vax/include/types.h
+++ b/sys/arch/vax/include/types.h
@@ -82,6 +82,7 @@ typedef int   __register_t;
 #define__HAVE_OLD_DISKLABEL
 #ifdef _KERNEL
 #define__HAVE_RAS
+#define__AUDIO_BLK_MS (40) /* See sys/dev/audio/audio.c */
 #endif
 
 #define__HAVE___LWP_GETPRIVATE_FAST
diff --git a/sys/dev/audio/audio.c b/sys/dev/audio/audio.c
index 13386ccfb..20a0c6c10 100644
--- a/sys/dev/audio/audio.c
+++ b/sys/dev/audio/audio.c
@@ -183,6 +183,7 @@ __KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.41 2020/01/11 
04:53:10 isaki Exp $");
 #include 
 
 #include 
+#include  /* for __AUDIO_BLK_MS */
 
 #include 
 
@@ -454,38 +455,25 @@ audio_track_bufstat(audio_track_t *track, struct 
audio_track_debugbuf *buf)
 /*
  * Default hardware blocksize in msec.
  *
- * We use 10 msec for most platforms.  This period is good enough to play
- * audio and video synchronizely.
+ * We use 10 msec for most modern platforms.  This period is good enough to
+ * play audio and video synchronizely.
  * In contrast, for very old platforms, this is usually too short and too
  * severe.  Also such platforms usually can not play video confortably, so
- * it's not so important to make the blocksize shorter.
+ * it's not so important to make the blocksize shorter.  If the platform
+ * defines its own value as __AUDIO_BLK_MS in its , it
+ * uses this instead.
+ *
  * In either case, you can overwrite AUDIO_BLK_MS by your kernel
  * configuration file if you wish.
- *
- * 40 msec was initially choosen for the following reason:
- * (1 / 40ms) = 25 = 5^2.  Thus, the frequency is factored by 5.
- * In this case, the number of frames in a block can be an integer
- * even if the frequency is a multiple of 100 (44100, 48000, etc),
- * or even if 15625Hz (vs(4)).
  */
-#if defined(__hppa__)  || \
-defined(__m68k__)  || \
-defined(__sh3__)   || \
-(defined(__sparc__) && !defined(__sparc64__))  || \
-defined(__vax__)
-#define AUDIO_TOO_SLOW_ARCHS 1
-#endif
-
 #if !defined(AUDIO_BLK_MS)
-# if defined(AUDIO_TOO_SLOW_ARCHS)
-#  define AUDIO_BLK_MS 40
+# if defined(__AUDIO_BLK_MS)
+#  define AUDIO_BLK_MS __AUDIO_BLK_MS
 # else
-#  define AUDIO_BLK_MS 10
+#  define AUDIO_BLK_MS (10)
 # endif
 #endif
 
-#undef AUDIO_TOO_SLOW_ARCHS
-
 /* Device timeout in msec */
 #define AUDIO_TIMEOUT  (3000)

---
Tetsuya Isaki 
 


Re: CVS commit: src/sys

2020-04-28 Thread Tetsuya Isaki
At Tue, 28 Apr 2020 05:33:45 +1000,
matthew green wrote:
> i would just put it in types.h called __AUDIO_BLK_MS,
> and leave a default used in the code if unset.

It sounds nice.
I commit once here, and then I will try it.

Thanks,
---
Tetsuya Isaki 


Re: CVS commit: src/sys

2020-04-28 Thread Tetsuya Isaki
At Mon, 27 Apr 2020 15:58:01 +0200,
Joerg Sonnenberger wrote:
> > Then how about this?
> > (thanks tsutsui@ for comment about choosing archs)
> > This #ifdefs may not look elegance, but I think it's simple and
> > realistic.
> 
> I'd just move it the whole block into audio.c, but otherwise this sounds
> like a good step forward.

Thank you.  I will do so.
---
Tetsuya Isaki 


Re: [sctp fix] Re: CVS commit: src/sys/kern

2020-04-28 Thread Luke Mewburn
On 20-04-26 18:15, Maxime Villard wrote:
  |  - There was no demonstrated use-case justifying importing it. In addition,
  |major OSes like Windows and macOS do not implement SCTP. There just is no
  |demand for SCTP on the market; and on NetBSD, proportionally even less.

SCTP is used in mobile telco environments; the control plane for
3G and 4G networks uses SCTP (or TCP as an option, but mostly SCTP).

NetBSD is a server OS; and could be viable in that market, which
currently is mostly Linux (AFAICT), which does have a viable SCTP stack.

It's understandable why macOS (a client OS) doesn't support SCTP.


Besides the rest of your arguments (which may be valid), this particular
one is not.


regards,
Luke.