|
NetBSD General Other questions regarding NetBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
||||
Quote:
To add something to this thread, as of 8.0, NetBSD OSS sound subsystem has been heavily reshaped. we now happily have in-kernel mixing, audio(4). It would be one day good on the other hand, to see it completely replaced with a modern OSSv4 implementation like Illumos Boomer Quote:
EDIT: by the way, welcome
__________________
“Mi casa tendrá dos piernas y mis sueños no tendrán fronteras„ |
|
||||
Yes, as I stated above NetBSD's audio(4) sound subsystem is based on Solaris SunAudio API, which differs from traditional OSSv3 implementations, in the way it just passes one struct to the kernel (see AUDIO_SETINFO ioctl), and provides a simple and well-documented backend (everything on the software side is done the traditional way, which implies opening a pseudodevice /dev/audio – a hardware abstraction layer – for r/w operations), characterized by low-latency, low-cpu-usage and possibly cross-platform (Illumos?). It's been reworked for 8.0 and further improved across the transition towards 9.x to provide kernel built-in hardware-level mixing functionalities, thus substantially differing from other Unices where this task is typically left to userspace-level sound servers (well, you can do mixing on Linux with ALSA plugins like dmix, but it's just 'meh' – complex to set up and adapt to various scenarios, quite resource intensive, poor results, and, as if this wasn't already enough, applications are deprecating it –).
The rework also introduced a nice set of tunable sysctl values (e.g. hw.audioX.blk_ms for latency). Quote:
Naturally this doesn't prevent anybody from using JACK2, Pulseaudio or Nas in more complex scenarios. Quote:
Quote:
Code:
$ sysctl -w hw.audio0.multiuser=1 # (default is '0') $ echo 'hw.audio0.multiuser=1' >> /etc/sysctl.conf
__________________
“Mi casa tendrá dos piernas y mis sueños no tendrán fronteras„ Last edited by Sehnsucht94; 24th March 2020 at 07:40 AM. Reason: fix formatting |
|
||||
Hello Sensucht,
Quote:
Code:
# lsof -p `pgrep mpg123` COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mpg123 3882 bashrules cwd VDIR 20,0 4096 41027584 /home/bashrules mpg123 3882 bashrules txt VREG 0,0 113920 1369211 /usr/local/bin/mpg123 mpg123 3882 bashrules txt VREG 0,0 8160 1588547 /usr/local/lib/mpg123/output_sun.so mpg123 3882 bashrules txt VREG 0,0 2079944 6587525 /lib/libc.so.12.213 mpg123 3882 bashrules txt VREG 0,0 208424 6587561 /lib/libm.so.0.12 mpg123 3882 bashrules txt VREG 0,0 56408 1369224 /usr/local/lib/libout123.so.0.2.2 mpg123 3882 bashrules txt VREG 0,0 206608 1369219 /usr/local/lib/libmpg123.so.0.44.10 mpg123 3882 bashrules txt VREG 0,0 164176 10465283 /libexec/ld.elf_so mpg123 3882 bashrules 0u VCHR 5,5 0t51287932 13 /dev/pts/5 mpg123 3882 bashrules 1u VCHR 5,5 0t51287932 13 /dev/pts/5 mpg123 3882 bashrules 2u VCHR 5,5 0t51287932 13 /dev/pts/5 mpg123 3882 bashrules 3r VREG 11,3 29374214 10469628 beethoven-symphony01.mp3 mpg123 3882 bashrules 4w 0xffffe866a7a3bcc0 file struct, ty=5, op=0xffffffff8102b9e0 Quote:
Quote:
Quote:
I don't understand the situation in firefox. It's built with --disable-pulseaudio --disable-alsa --with-oss. So it uses oss? It compiles in cubeb_sun.c. So it uses sunaudio? |
|
||||
One problem at a time. Now that mixing over all users work, I will attack my next problem. Every 10 to 100 min, the sound distorts (hard to describe). I can only recover audio by restarting all audio streams. Is anyone else running into this problem or am I alone?
My hardware: From dmesg Code:
hdaudio0 at pci0 dev 27 function 0: HD Audio Controller hdaudio0: interrupting at msi0 vec 0 hdafg0 at hdaudio0: vendor 14f1 product 50a1 hdafg0: DAC00 2ch: Speaker [Jack] hdafg0: ADC01 2ch: Mic In [Jack] hdafg0: ADC02 2ch: Line In [Jack], Mic In [Jack] hdafg0: DAC03 2ch: HP Out [Jack] hdafg0: 2ch/2ch 44100Hz 48000Hz 96000Hz PCM16 PCM20 PCM24 AC3 audio0 at hdafg0: playback, capture, full duplex, independent audio0: slinear_le:16 2ch 48000Hz, blk 4ms for playback audio0: slinear_le:16 2ch 48000Hz, blk 4ms for recording spkr1 at audio0: PC Speaker (synthesized) wsbell at spkr1 not configured hdafg1 at hdaudio0: vendor 8086 product 2805 hdafg1: DP00 8ch: Digital Out [Jack] hdafg1: 8ch/0ch 48000Hz PCM16* Code:
$ lspci -vvs 0:1b.0 00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05) Subsystem: Dell Device 04ed Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 0, Cache Line Size: 64 bytes Interrupt: pin A routed to IRQ 5 Region 0: Memory at fe400000 (64-bit, non-prefetchable) Capabilities: [50] Power Management version 2 Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3hot+,D3cold+) Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME- Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+ Address: 00000000fee00000 Data: 0070 Capabilities: [70] Express (v1) Root Complex Integrated Endpoint, MSI 00 DevCap: MaxPayload 128 bytes, PhantFunc 0 ExtTag- RBE- DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq- RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+ MaxPayload 128 bytes, MaxReadReq 128 bytes DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend- Capabilities: [100 v1] Virtual Channel Caps: LPEVC=0 RefClk=100ns PATEntryBits=1 Arb: Fixed- WRR32- WRR64- WRR128- Ctrl: ArbSelect=Fixed Status: InProgress- VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans- Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256- Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=01 Status: NegoPending- InProgress- VC1: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans- Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256- Ctrl: Enable+ ID=1 ArbSelect=Fixed TC/VC=22 Status: NegoPending- InProgress- Capabilities: [130 v1] Root Complex Link Desc: PortNumber=0f ComponentID=00 EltType=Config Link0: Desc: TargetPort=00 TargetComponent=00 AssocRCRB- LinkType=MemMapped LinkValid+ Addr: 00000000fed1c000 A starting point is enabling debugging output by recompling the audio driver with these options Code:
options HDAUDIOVERBOSE # verbose HDAUDIO driver messages options HDAUDIO_DEBUG options HDAFG_DEBUG Is there a debugging infra for the netbsd kernel? If not, I'll probably go for the follow-up step with some sort of printk equivalent. |
|
||||
Quote:
Have you tried with a NetBSD-native tool like fstat(1)? In my case with ]firefox and mpg123 both playing music at the same time, I get: Code:
USER CMD PID FD MOUNT INUM MODE SZ|DV R/W NAME vins mpg123 436 4* audio 0xfffffc085ef0e490 vins firefox 526 22* audio 0xfffffc0877cba0c0 Quote:
Quote:
Third-party software developers may refer to it differently in configure scripts depending on how much deep is their understanding of the subtle differences between sound APIs outside the Linux ecosystem; OpenAL-soft for examples refers to it as 'solaris', others may call it 'sun', 'sunaudio' or often 'OSS', implying /dev/audio to be a operating-system-specific OSS variant/derivative. Indeed, support for legacy applications requiring a traditional OSS interface is provided by an emulation API, refer to ossaudio and the soundcard.h header. For example QEMU (compiled by default against OSS) VMs can play sound just fine (using either NVMM or HAXM as backend for hw acceleration, otherwise it will feel laggy and sluggish), no sooner will have you pointed QEMU to the right interface (as opposed to the default /dev/dsp for OSS). My little script for Linux VMs on HAXM: Code:
env QEMU_OSS_DC_DEV=/dev/audio QEMU_OSS_DAC_DEV=/dev/audio qemu-system-x86_64 \ -boot c --accel hax -m 6G -soundhw hda -display gtk -k it \ -M pc -cpu Broadwell -smp cores=2,threads=2 -vga std \ -device virtio-net,netdev=vmnic -netdev user,id=vmnic \ -drive file=$HOME/VMs/linux.img,if=virtio,cache=none
__________________
“Mi casa tendrá dos piernas y mis sueños no tendrán fronteras„ Last edited by Sehnsucht94; 1st April 2020 at 12:50 AM. |
|
||||
Quote:
Quote:
Quote:
Quote:
By the way, you may have or may have not already noticed that I'm no more than a hobbyist, and it's safe to assume your understanding of C and *nix and debugging is far more advanced than mine; that's why I strongly suggest you open a bug report, ask for support on netbsd-users mailing list; alternatively on #netsbd IRC or comp.unix.bsd.netbsd.misc newsgroup. Last but not least, you may consider opening a new thread here (considered we've gone pretty much off-topic at this point), even though I fear not many will be able to provide help, given the activity of this subforum Cheers!
__________________
“Mi casa tendrá dos piernas y mis sueños no tendrán fronteras„ Last edited by Sehnsucht94; 1st April 2020 at 12:23 AM. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Underlegend Networks - NetBSD free shell server | muflon | Off-Topic | 1 | 8th September 2015 01:53 PM |
[Link][HowTo] Setting up an 8TB NetBSD file server | s0xxx | Guides | 0 | 20th August 2011 10:42 AM |
Recording sound with external sound card | backrow | OpenBSD General | 5 | 21st August 2009 08:17 PM |
Convertin A Ubuntu ssh/ Samba server to NetBSd | FloridaBSD | FreeBSD General | 6 | 24th May 2008 09:35 AM |