Share your NetBSD experience (for FreeBSD users)

omxplayer works on freebsd too (i run it on pi zero) and it plays 720p videos
but there is no X drm/accelerated driver
Thanks for the hint, but still you will get no sound and this would not be a replacement for Kodi at all. I use Kodi for video streaming with certain applications.
 
did not test sound as my monitor does not have speakers but
[root@rpi-b ~]# cat /dev/sndstat
Installed devices:
pcm0: <VCHIQ audio> (play) default
No devices installed from userspace.
 
I found cabriofahrer 's thread about this: Thread what-about-2d-3d-hardware-acceleration-and-audio-support-on-raspberry-pi.86341.

Here's another thread of network interface problems on Raspberry pi Thread raspberry-pi-400-network-interface-problems.86541.

I was unaware of this for RaspberryPi and similar boards and their hardware.

According to the post above, it looks like sound hardware is recognized. I'm guessing that there's interest in using the HDMI output for sound on the RaspberryPi, aside from the traditional line out too.

It's good that this brought it to more people's attention of the state of hardware for small boards, when an assumption is that, that hardware uses drivers that are known to work on common hardware. Because NetBSD has a lot of these drivers, it would be easier to port here, than need years of engineering. According to one of those threads, OpenBSD may have those specialized open-source sound drivers also.
 
cabriofahrer , can you please show your sndstat command output like covacat has, and tell us, which operating system distribution on RaspberryPi that is run from? If you're running NetBSD or FreeBSD. But if you're running Linux, provide the hardware output of the audio hardware if you can.

On another note, I'd like to try NetBSD on microboard RISC-V hardware, provided their /dev/ folder automatically repopulates based on hardware present, like on FreeBSD, and their shutdown works properly.
 
Last edited:
OK, as I have two units, I can try out more OSes more easily (Linux, FreeBSD, NetBSD). For now, I have the one with Linux (RaspianOS) running, so here is the full dmesg output attached. I will be providing more information later.
 

Attachments

  • dmesg_RPI3_Linux.txt
    32.5 KB · Views: 68
NetBSD has a problem with gpus , you can make it work with a nvidia 1030 but don't expect good graphics performance , also i tried with older radeon gpus and i found that only very old could work ok on netbsd (for example caicos family works fine but r7 240 doesn't really some gpus works but with artifacts).
Also regarding the audio is a bit mysterious with endless audio mixers and some problems when you try to record if there is wrong sample rate (this maybe can be fixed with a command or it should cause it didn't work for me).
Performance in general is very good but i don't know why to choose NetBSD instead of FreeBSD that is better in everything.
 
Last edited:
So here is the dmesg and the output of cat /dev/sndstatfrom FreeBSD aarch64 on the Raspberry Pi3.

Code:
cat /dev/sndstat
No devices installed.
No devices installed from userspace.

Performance in general is very good but i don't know why to choose NetBSD instead of FreeBSD that is better in everything.
Absolutely right! That's why we need better support for FreeBSD on the Raspberry Pi. Another thing in relation to this: When performing a shutdown -p now in FreeBSD, the unit shuts down, but with NetBSD it reboots. Instead you have to perform a halt command, but you still have a graphical output and then you can switch off the unit. A very unpleasant behaviour.
 

Attachments

  • dmesg_freebsd13.2_aarch64.txt
    7.1 KB · Views: 66
On your Linux setup, grep for snd, sound and audio:
Code:
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0
snd_bcm2835.enable_headphones=0 snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1
snd_bcm2835.enable_hdmi=0 video=HDMI-A-1:1920x1080M@60 vc_mem.mem_base=0x3ec00000
vc_mem.mem_size=0x40000000  console=ttyS0,115200 console=tty1 root=PARTUUID=e65e89cf-02
rootfstype=ext4 fsck.repair=yes rootwait
...
[   23.880496] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been
warned.
[   23.888070] bcm2835_audio bcm2835_audio: card created with 8 channels
...
[80721.396852] Modules linked in: rfcomm cmac algif_hash aes_arm64 aes_generic algif_skcipher af_alg
bnep hci_uart btbcm bluetooth ecdh_generic ecc libaes 8021q garp stp llc hid_logitech_hidpp joydev
brcmfmac brcmutil vc4 hid_logitech_dj cfg80211 snd_soc_hdmi_codec drm_display_helper cec
drm_dma_helper drm_kms_helper snd_soc_core rfkill snd_compress bcm2835_v4l2(C) bcm2835_codec(C)
bcm2835_isp(C) snd_pcm_dmaengine syscopyarea sysfillrect v4l2_mem2mem bcm2835_mmal_vchiq(C)
sysimgblt videobuf2_vmalloc videobuf2_dma_contig fb_sys_fops videobuf2_memops videobuf2_v4l2
videobuf2_common videodev mc snd_bcm2835(C) snd_pcm i2c_bcm2835 raspberrypi_hwmon snd_timer
snd vc_sm_cma(C) uio_pdrv_genirq uio drm i2c_dev drm_panel_orientation_quirks backlight fuse ip_tables
x_tables ipv6

I didn't see anything on your FreeBSD dmesg output about sound. It seems a lot shorter, so I wonder if it's incomplete or if it doesn't have as many devices. At least for sound, having nothing there matches cat /dev/sndstat. There's bcm283_ for many devices shown on FreeBSD and Linux.


On FreeBSD, poweroff is supposed to like shutdown -p now according to shutdown(8). I'm not sure what NetBSD's manual says, but it should be online.
 
I didn't see anything on your FreeBSD dmesg output about sound. It seems a lot shorter, so I wonder if it's incomplete or if it doesn't have as many devices. At least for sound, having nothing there matches cat /dev/sndstat. There's bcm283_ for many devices shown on FreeBSD and Linux.
Well, that's the point: FreeBSD has no sound support for the Raspberry Pi 3. Meanwhile, here goes the dmesg and the sndstst output from NetBSD 9.3 aarch64. No sound here either, because I think there used to be with arm7. I need to confirm this, so I will dd an arm7 image and report back later. Another observation: Although I think that the microSD card where the FreeBSD is dd'd on is worse than the one with NetBSD, NetBSD is not really usable when xfce is started. I hardly can type any commands in the terminal, because either the letters won't type or one letter starts retyping itself without stopping. Also Strg+Alt+F* only gives a black screen with a cursor, but no text (there should be "login:").
The overall experience with FreeBSD was very pleasant, though.
This is the sndstat output from NetBSD 9.3 aarch64, the dmesg is attached:

Code:
arm64$ cat /dev/sndstat
cat: /dev/sndstat: No such file or directory
 

Attachments

  • dmesg_netbsd_aarch64_93.txt
    11.8 KB · Views: 60
OK, here is the dmesg for NetBSD from the rpi.img. With this image, there is sound support. I could install xmms and playback mp3's through the TV's speakers. But sadly, no 3D acceleration as opposed to NetBSD from the arm64.img image, which as I stated before, has no sound support, but does have 3D acceleration. Also in rpi.img, no meta packages for xfce or firefox. On both versions no support for wifi either. So my conclusion is: NetBSD is no solution for the Raspberry Pi 3 either. FreeBSD is much better with the before stated limitations, so hopefully those limitations can be overcome, soon.
 

Attachments

  • dmesg_NetBSD_RPI.txt
    16.2 KB · Views: 61
The reason may be, because NetBSD doesn't support power management, so the software can't manipulate it to turn it off. Poweroff halts it, then pressing any key reboots the system. Also, not all Raspberry Pi boards have softpower or a button as a power switch.

How about the output of /dev/sndstat for the NetBSD board where sound works?
 
I only tried it once few years ago I didn't do much with it, just wanted to see if I could make it work, it was before getting on board with FreeBSD.
At that time the main problem for me was the small size of the community, for people of will need help at some point it is a factor essential, well there is that and also the next release in beta state for years now is not a good sign.
Hopefully this will change for the better.
 
I had considered NetBSD back in the day. I was using Linux 0.95. It was certainly not production ready. I had recently switched jobs from MVS systems programmer to UNIX sysadmin in the company (they were looking for people to work on this "new" technology and I took the bait).

Initially I installed Minix on a PC. I wanted to run at home (sort of) what I was maintaining at work. I then switched to Coherent. Coherent was a clone of AT&T SYSVR4.2, which we ran on some NCR boxes. It was uncanny how even the kernel config procedure was exactly the same as that on the NCR.

But I wanted more and Coherent wasn't cutting it for me. It supported UUCP but not TCP/IP. I tried a couple of Linux distros at the time, starting with Slackware and settling on Yaggrisil. After a short while I wanted to teach myself UNIX Domain Socket programming. Linux 0.95 didn't support it so I installed an experimental Linux kernel. That resulted in the loss of my extfs filesystem about once or twice a week.

That nonsense didn't last long. I posted messages on USENET, when it was still respectable, on the comp.os.bsd.freebsd and comp.os.bsd.netbsd channels. Nobody at NetBSD responded while Jordan Hubbard of FreeBSD replied with what he thought were the differences. He went on to say try one, then the other, and stay with the one you like.

Well, I figured I'd try FreeBSD first because Jordan replied while no one from NetBSD did. That was FreeBSD 2.0.5. I was happy with it and stayed with it. The journey continues to this day.

Since then I've played with NetBSD in some VMs. The intention is to install it on a couple of old i386 machines here, should I manage to find the time, probably a few years from now.

My experience with NetBSD vs FreeBSD is that FreeBSD is certainly a better polished product. Installing a new NetBSD one doesn't get /usr/src like we do with FreeBSD. You can't just install it and start playing with the source code. A person could install git and clone their mirror on GH or install Mercurial and clone it directly from their Mercurial repos.
 
Regarding VideoCore which is available on NetBSD, and needing power management which FreeBSD has. I recently wondered, what if PkgSrc from NetBSD were used on top of FreeBSD.

For the Broadcom VideoCore Driver: https://blog.netbsd.org/tnf/entry/raspberry_pi_gpu_acceleration_in points to misc/raspberrypi-userland (https://cdn.netbsd.org/pub/pkgsrc/current/pkgsrc/misc/raspberrypi-userland/index.html). There's also other Raspberry packages in their pkg/src tree.

It would take bootstrapping PkgSrc as documented in https://www.netbsd.org/docs/pkgsrc/. Their system does use an older way of source version control, which doesn't matter for the purpose of seeing if that combination works.

I thought of getting hold of a microboard, perhaps an RISC-V one, to try it.


Edit - Then again, Thread anyone-use-pkgsrc-on-freebsd.76814 shows that it hasn't been done or isn't practical at this time. There's also difficulty making Pkgsrc programs compile on OpenBSD: https://dataswamp.org/~solene/2021-02-06-pkgsrc-on-openbsd.html?utm_source=discoverbsd.
 
Bumping up this thread :)

Long time FreeBSD user here.
I am moving away from FreeBSD. Sort of.
I will be watching, but focussing more on NetBSD.

The thing is this.
FreeBSD nowadays works very well on desktop. Kudos to the FreeBSD team. If you have a mainstream hardware (HP/DELL/LENOVO) that is in the market for last 2-3 years, then FreeBSD will work wonderfully.

Now the reason for chipping in here.
My primary work is IoT applications and Edge computing.

There I find that NetBSD has better support for peripherals.

So, I made a trade off.
Desktop ? Windows is fine to get things done. Even Debian which I have in dual boot mode.

Since, I have to get my products out, I need a platform where junior firmware engineers can start off with quick prototyping.

FreeBSD is breeze to install and setup.
But for a widely used tinkering board like Raspberry Pi (lot of people have mentioned in the thread here), FreeBSD does not have support for Bluetooth, WiFi, DSI, CSI.
Even the SPI support is not there.

FWIW, FreeBSD Bluetooth is broken even of mainstream AMD64/x86-64 platform.

NetBSD is a pain to install.
But once that is done, I found most peripherals working except SPI.

If I were to prototype a outdoor sensing platform on Raspberry Pi or any such widely available ARM SoC, I really don't care about CSI and DSI.
So, here the deal breaker was lack of radio networking support.

Most smart sensors in the market work with Bluetooth Low Energy.

I'm getting down to writing a NetBSD SPI driver that can be accessed from user space daemons. I can live with that.

So, it will be a slightly outdated NetBSD desktop working with half a dozen ARM SoC running NetBSD.
I wish it were FreeBSD.

I don't know.
It doesn't make any sense to me why FreeBSD Foundation wants to lose the IoT market.

But as I mentioned FreeBSD will be on constant watchlist.
 
A curious note: What Benny Siegert, a NetBSD developer, told The Register when he compared it to other BSDs.

The waters get blurry there – it used to be a much simpler thing, but nowadays, FreeBSD is a lot more portable than it used to be (probably mostly thanks to the OS X and related work by Apple), and OpenBSD has changed a lot too (and is diverging from NetBSD further). We at NetBSD of course do not believe the OpenBSD tale about their security focus and consider NetBSD at least as secure (with less voodoo) – but that is hard to demonstrate or verify on a technical level.

 
Hello SR_Ind,

very interesting opinion you wrote there, indeed! I myself have never dealt with IoT so far, so I'd like to hear some concrete examples or projects from your own experience where you use NetBSD with the Raspberry? Also given the apparently good support for ARM SoC's by NetBSD, I would like to ask if it is possible to flash NetBSD onto old smartphones, e.g. like an LG-E400, an LG II 430 or a Sony Xperia E3?
 
Back
Top