Hello,

I am using pjsua on a recent snapshot of OpenBSD and I am trying to
use a microphone from and plugged in USB camera, fully detected and
configured (UVC camera, dmesg bellow). I want to use it because the
laptop built in microphone and soundcard are very noisy.

Pjsua has some command line parameter to select input source,
--capture-dev=ID, but to get the proper ID one needs another binary
which is not present on OpenBSD. I tried all the numbers from 0 to 10
and no success.

My idea is to use sndiod and change the "default" record device to be
the USB camera microphone, I was using these flags "-f rsnd/1", but
again pjsua is using the laptop microphone, not the USB one.

I tried to figure out sndiod arhitecture, but I don't know the
internals. So, if it is possible to trick pjsua in using sndiod and
make sndiod use the specified input source, or if i need to use some
other sound server, please advise. Informations are included below.
Thank you.

$ dmesg
OpenBSD 5.6-current (GENERIC) #309: Thu Sep  4 02:48:16 MDT 2014
    t...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Pentium(R) M processor 1.86GHz ("GenuineIntel"
686-class) 1.87 GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,PBE,NXE,EST,TM2,PERF
real mem  = 1072066560 (1022MB)
avail mem = 1042153472 (993MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 08/21/06, BIOS32 rev. 0 @
0xfd760, SMBIOS rev. 2.33 @ 0xe0010 (64 entries)
bios0: vendor IBM version "1YET65WW (1.29 )" date 08/21/2006
bios0: IBM 2669R1G
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT ECDT TCPA APIC MCFG BOOT
acpi0: wakeup devices LID_(S3) SLPB(S3) UART(S3) EXP0(S4) EXP1(S4)
EXP2(S4) EXP3(S4) PCI1(S4) DOCK(S4) USB0(S3) USB1(S3) USB3(S3)
USB7(S3) AC9M(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiec0 at acpi0
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 133MHz
ioapic0 at mainbus0: apid 1 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 1
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (AGP_)
acpiprt2 at acpi0: bus 2 (EXP0)
acpiprt3 at acpi0: bus -1 (EXP1)
acpiprt4 at acpi0: bus 3 (EXP2)
acpiprt5 at acpi0: bus -1 (EXP3)
acpiprt6 at acpi0: bus 11 (PCI1)
acpicpu0 at acpi0: C3, C2, C1, PSS
acpipwrres0 at acpi0: PUBS, resource for USB0, USB1, USB7
acpitz0 at acpi0: critical temperature is 99 degC
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpibat0 at acpi0: BAT0 model "IBM-92P1087" serial  1741 type LION oem "SANYO"
acpibat1 at acpi0: BAT1 not present
acpiac0 at acpi0: AC unit online
acpithinkpad0 at acpi0
acpidock0 at acpi0: DOCK not docked (0)
bios0: ROM list: 0xc0000/0x10000 0xd0000/0x1600 0xd1800/0x1000
0xdc000/0x4000! 0xe0000/0x10000
cpu0: Enhanced SpeedStep 1863 MHz: speeds: 1866, 1600, 1333, 1066, 800 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82915GM Host" rev 0x03
ppb0 at pci0 dev 1 function 0 "Intel 82915GM PCIE" rev 0x03: apic 1 int 16
pci1 at ppb0 bus 1
radeondrm0 at pci1 dev 0 function 0 "ATI Radeon Mobility M300 M22" rev 0x00
drm0 at radeondrm0
radeondrm0: msi
ppb1 at pci0 dev 28 function 0 "Intel 82801FB PCIE" rev 0x03: apic 1 int 20
pci2 at ppb1 bus 2
bge0 at pci2 dev 0 function 0 "Broadcom BCM5751M" rev 0x11, BCM5750 B1
(0x4101): apic 1 int 16, address 00:15:58:09:c5:1d
brgphy0 at bge0 phy 1: BCM5750 10/100/1000baseT PHY, rev. 0
ppb2 at pci0 dev 28 function 2 "Intel 82801FB PCIE" rev 0x03: apic 1 int 22
pci3 at ppb2 bus 3
uhci0 at pci0 dev 29 function 0 "Intel 82801FB USB" rev 0x03: apic 1 int 16
uhci1 at pci0 dev 29 function 1 "Intel 82801FB USB" rev 0x03: apic 1 int 17
uhci2 at pci0 dev 29 function 2 "Intel 82801FB USB" rev 0x03: apic 1 int 18
uhci3 at pci0 dev 29 function 3 "Intel 82801FB USB" rev 0x03: apic 1 int 19
ehci0 at pci0 dev 29 function 7 "Intel 82801FB USB" rev 0x03: apic 1 int 19
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb3 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xd3
pci4 at ppb3 bus 11
cbb0 at pci4 dev 0 function 0 "Ricoh 5C476 CardBus" rev 0x8d: apic 1 int 16
iwi0 at pci4 dev 2 function 0 "Intel PRO/Wireless 2200BG" rev 0x05:
apic 1 int 21, address 00:16:6f:14:95:fe
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 12 device 0 cacheline 0x0, lattimer 0xb0
pcmcia0 at cardslot0
auich0 at pci0 dev 30 function 2 "Intel 82801FB AC97" rev 0x03: apic 1
int 22, ICH6 AC97
ac97: codec id 0x41445374 (Analog Devices AD1981B)
ac97: codec features headphone, 20 bit DAC, No 3D Stereo
audio0 at auich0
ichpcib0 at pci0 dev 31 function 0 "Intel 82801FBM LPC" rev 0x03: PM disabled
pciide0 at pci0 dev 31 function 2 "Intel 82801FBM SATA" rev 0x03: DMA,
channel 0 wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <HTS541040G9AT00>
wd0: 16-sector PIO, LBA, 38154MB, 78140160 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
atapiscsi0 at pciide0 channel 1 drive 0
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0: <HL-DT-ST, RW/DVD GCC-4242N, 0J05> ATAPI
5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2
ichiic0 at pci0 dev 31 function 3 "Intel 82801FB SMBus" rev 0x03: apic 1 int 23
iic0 at ichiic0
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci3: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at ichpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
wsmouse1 at pms0 mux 0
pms0: Synaptics touchpad, firmware 5.9
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
aps0 at isa0 port 0x1600/31
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
uvideo0 at uhub0 port 3 configuration 1 interface 0 " Webcam C170" rev
2.00/28.25 addr 2
video0 at uvideo0
uaudio0 at uhub0 port 3 configuration 1 interface 2 " Webcam C170" rev
2.00/28.25 addr 2
uaudio0: audio rev 1.00, 2 mixer controls
audio1 at uaudio0
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on wd0a (f6591a772a12dd8e.a) swap on wd0b dump on wd0b
drm: initializing kernel modesetting (RV380 0x1002:0x5460 0x1014:0x056E).
radeondrm0: VRAM: 128M 0x00000000C0000000 - 0x00000000C7FFFFFF (64M used)
radeondrm0: GTT: 512M 0x00000000A0000000 - 0x00000000BFFFFFFF
drm: PCIE GART of 512M enabled (table at 0x00000000C0040000).
drm: Panel ID String: 1024x768
drm: Panel Size 1024x768
radeondrm0: 1024x768
wsdisplay0 at radeondrm0 mux 1: console (std, vt100 emulation), using wskbd0
wsdisplay0: screen 1-5 added (std, vt100 emulation)

$ mixerctl -v
outputs.master=255,255 volume
outputs.master.mute=off  [ off on ]
outputs.mono=255 volume
outputs.mono.mute=on  [ off on ]
outputs.mono.source=mixerout  [ mixerout mic ]
outputs.hp=255,255 volume
outputs.hp.mute=on  [ off on ]
inputs.spkr=255 volume
inputs.spkr.mute=off  [ off on ]
inputs.phone=191 volume
inputs.phone.mute=on  [ off on ]
inputs.mic=191 volume
inputs.mic.mute=on  [ off on ]
inputs.mic.preamp=off  [ off on ]
inputs.mic.source=mic0  [ mic0 mic1 ]
inputs.line=191,191 volume
inputs.line.mute=on  [ off on ]
inputs.cd=191,191 volume
inputs.cd.mute=on  [ off on ]
inputs.video=255,255 volume
inputs.video.mute=off  [ off on ]
inputs.aux=191,191 volume
inputs.aux.mute=on  [ off on ]
inputs.dac=191,191 volume
inputs.dac.mute=off  [ off on ]
record.source=mic  [ mic cd video aux line mixerout mixeroutmono phone ]
record.volume=255,255 volume
record.volume.mute=off  [ off on ]
outputs.extamp=off  [ off on ]

$ usbdevs -dv
Controller /dev/usb0:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000),
Intel(0x8086), rev 1.00
  uhub0
 port 1 powered
 port 2 powered
 port 3 addr 2: high speed, power 500 mA, config 1, Webcam
C170(0x082b), (0x046d), rev 28.25
   uvideo0
   uaudio0
 port 4 powered
 port 5 powered
 port 6 powered
 port 7 powered
 port 8 powered
Controller /dev/usb1:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
  uhub1
 port 1 powered
 port 2 powered
Controller /dev/usb2:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
  uhub2
 port 1 powered
 port 2 powered
Controller /dev/usb3:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
  uhub3
 port 1 powered
 port 2 powered
Controller /dev/usb4:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
  uhub4
 port 1 powered
 port 2 powered

Reply via email to