How to change default audio devices in pjsip - raspberry-pi3

I would like to change default playback and capture audio device in pjsip library to usb audio codec and IQAudio DAC which is connected externally to Raspberry pi compute module 3+ .I tried by running pjsua binary with following arguments.
sudo ./pjsua-x86_64-unknown-linux-gnu --config-file <config file name> --playback-dev=0 --capture-dev=1
following are the record and playback devices.
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: IQaudIODAC [IQaudIODAC], device 0: IQaudIO DAC HiFi pcm512x-hifi-0 [IQaudIO DAC HiFi pcm512x-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
But I am not able to select the desired Audio devices.
By default it is taking usb audio codec as playback and capture device.How can we change the audio devices from default to desired ones.Can anyone help me?
Thanks in advance

Related

agl-sota u-boot raspberrypi3 - Card did not respond to voltage select! Device 0: unknown device

I am building an automotive-grade-linux demo image using yocto for raspberrypi3.
I am adding a layer agl-sota for OTA feature. This is where my u-boot breaks.
While booting up according to defconfig CONFIG_ENV_EXT4_DEVICE_AND_PART="0:1" u-boot takes mmc0 which is sd card that can be verified through 'mmc info' and partition 1.
Yet it shows:
U-Boot 2020.10 (Jun 29 2020 - 03:06:40 +0000)
DRAM: 768 MiB
RPI 3 Model B (0xa02082)
MMC: mmc#7e202000: 0, sdhci#7e300000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment
In: serial
Out: vidconsole
Err: vidconsole
Net: No ethernet found.
starting USB...
Bus usb#7e980000: USB DWC2
scanning bus usb#7e980000 for devices... 3 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Card did not respond to voltage select!
Device 0: unknown device
Waiting for Ethernet connection... unable to connect.
...
...
u-boot >
'mmc info' output:
U-Boot> mmc info
Device: mmc#7e202000
Manufacturer ID: 3
OEM: 5344
Name: SU16G
Bus Speed: 50000000
Mode: SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.8 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
What configuration issue is disallowing u-boot to boot the kernel.?
I am using raspberrypi imager for flashing the wic.xz image.

Webcam in Lenovo Ideapad 3 horrible resolution in Ubuntu 20.04

Got Lenovo Ideapad 3 at end of year. Installed ubuntu 20.04 on it. Webcam "works" but the image is undistinguishable (basically an indescript blob and I don't look that bad). Can run hand in front of webcam and see some change to blob, but nothing recognizable. Can turn camera on and off. Not a pro, so I've been searching and gathered the following data:
uname -a
Linux mjcasile-IdeaPad-3-15IIL05 5.8.0-44-generic #50~20.04.1-Ubuntu SMP Wed Feb 10 21:07:30 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Many refs to fix in 5.4.0-37-generic ... but figuring I'm at 5.8.0-44-generic would include it. Should I research backing off to 5.4.0-37-generic ? Not sure kernel level is the issue
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
sudo lshw
output includes this:
*-usb:0
description: Video
product: Integrated Camera
vendor: Chicony Electronics Co.,Ltd.
physical id: 5
bus info: usb#1:5
version: 27.11
serial: 0001
capabilities: usb-2.01
configuration: driver=uvcvideo maxpower=500mA speed=480Mbit/s
lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 2386:4339 Raydium Corporation Raydium Touch System
Bus 001 Device 002: ID 04f2:b6d9 Chicony Electronics Co., Ltd Integrated Camera
Bus 001 Device 004: ID 8087:0aaa Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
ls -l /dev/video*
crw-rw----+ 1 root video 81, 0 Mar 14 20:13 /dev/video0
crw-rw----+ 1 root video 81, 1 Mar 14 20:13 /dev/video1
dmesg
Pertinent info (per my untrained eye)
[ 2.151466] usb 1-5: New USB device found, idVendor=04f2, idProduct=b6d9, bcdDevice=27.11
[ 2.151467] usb 1-5: New USB device strings: Mfr=3, Product=1, SerialNumber=2
[ 2.151468] usb 1-5: Product: Integrated Camera
[ 2.151469] usb 1-5: Manufacturer: Chicony Electronics Co.,Ltd.
[ 2.151470] usb 1-5: SerialNumber: 0001
...
[ 2.810480] uvcvideo: Found UVC 1.10 device Integrated Camera (04f2:b6d9)
...
[ 2.797385] videodev: Linux video capture interface: v2.00
[ 2.807515] intel_rapl_common: Found RAPL domain package
[ 2.807517] intel_rapl_common: Found RAPL domain core
[ 2.807518] intel_rapl_common: Found RAPL domain uncore
[ 2.807867] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_component_ops [i915])
[ 2.810480] uvcvideo: Found UVC 1.10 device Integrated Camera (04f2:b6d9)
[ 2.811987] input: Raydium Corporation Raydium Touch System as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0/0003:2386:4339.0002/input/input12
[ 2.812088] hid-multitouch 0003:2386:4339.0002: input,hiddev0,hidraw1: USB HID v1.10 Device [Raydium Corporation Raydium Touch System] on usb-0000:00:14.0-6/input0
[ 2.812132] usbcore: registered new interface driver usbhid
[ 2.812133] usbhid: USB HID core driver
[ 2.816014] input: Integrated Camera: Integrated C as /devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5:1.0/input/input13
[ 2.816062] usbcore: registered new interface driver uvcvideo
[ 2.816063] USB Video Class driver (1.1.1)
...
[ 3.814863] ACPI: Video Device [GFX0] (multi-head: yes rom: no post: no)
[ 3.815098] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input14
[ 3.815322] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 3.816277] fbcon: i915drmfb (fb0) is primary device
[ 3.816318] Console: switching to colour frame buffer device 170x48
(on a prior run I also saw:
[ 0.168948] ACPI: Added _OSI(Linux-Dell-Video))
When I bring up VLC and Open Capture Device ... I get error:
Your input can't be opened: VLC is unable to open the MRL 'v4l2:///dev/video0'. Check the log for details.
Any idea where to begin on this? Thanks,
OK, clearly an embarrassing answer. The little label telling one how to turn the webcam on and off was actually covering the camera. Take off the label, and voila. All is good. I guess that qualifies as a "hardware" problem. More of a DFU though (Dumb darn user).

I2C driver changes to recognize multiple buses

We have defined the analog videoIn adv7180 metadata hardware definition in the i2c2 node in one iMX device tree file. The ultimate aim is to recognize adv7180 driver from the i2c2 bus.
During the boot process of the processor using the linux image made with defconfig changes for I2C, the second I2C bus is not getting recognized.
Given below are the serial console print statements:
U-Boot 2015.10+fslc+g1b6aee7 (Jan 16 2018 - 14:57:01 +0530)
CPU: Freescale i.MX6Q rev1.2 996 MHz (running at 792 MHz)
CPU: Automotive temperature grade (-40C to 125C) at 26C
Reset cause: POR
Board: MX6-SabreSD
I2C: ready
Line 129: i2c i2c-1: IMX I2C adapter registered //i2c-2 not registered??
Line 272 onwards: i2c /dev entries driver
IR NEC protocol handler initialized
IR RC5(x) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
IR RC5 (streamzap) protocol handler initialized
IR SANYO protocol handler initialized
IR MCE Keyboard/mouse protocol handler initialized
mxc_v4l2_output v4l2_out.28: V4L2 device registered as video16
mxc_v4l2_output v4l2_out.28: V4L2 device registered as video17
i2c-core: driver [mag3110] using legacy suspend method
i2c-core: driver [mag3110] using legacy resume method
I have written these extra lines in defconfig files in the source directory of my Yocto Built.
CONFIG_IMX_HAVE_PLATFORM_IMX_I2C=y
# CONFIG_I2C_COMPAT is not set
CONFIG_I2C_CHARDEV=y
# CONFIG_I2C_HELPER_AUTO is not set
CONFIG_I2C_ALGOPCF=m
CONFIG_I2C_ALGOPCA=m
CONFIG_I2C_ALGOBIT=y
CONFIG_I2C_IMX=y
CONFIG_I2C_MUX=y
CONFIG_I2C_MUX=y
I have also check Kconfig files and seen that i2c driver is passed from the kernel-source directory in the built.
Do I have to make modifications to the C-files (driver files) made in the path /home/fsl-community-bsp-myproject/build/tmp/work-shared/imx6qonlinepdd/kernel-source/drivers/i2c of my yocto built?
There is even a C file for adv7180 in the sub-directory /drivers/media , can it be modified?
you should look in the device tree you're using if i2c bus 2 is enabled.
You need to add the folowing line in your dts :
&i2c2 { // Change the name as needed
status = "okay";
pinctrl-names = "default";
}
You've probably status = "disabled"; in the i2c node you're seeking.
EDIT:
At first glance provided dts (https://pastebin.com/Y0esXmaX) seems ok. In order to debug further, one shall look into /dev/ directory in order to find the i2c bus.
As an example :
root#pico-imx8mq:~# ls /dev/*i2c*
/dev/i2c-0 /dev/i2c-1 /dev/i2c-2
This means I have 3 i2c bus and I can find them all on my dts. If you don't have the bus there you probably do have a dts problem.
dmesg | grep i2c might also give some hints.
You can also use i2cdetect from i2ctools package :
root#pico-imx8mq:~# i2cdetect -y 0 ## that will detect devices on first i2c bus
root#pico-imx8mq:~# i2cdetect -y 1 ## that will detect devices on second i2c bus
root#pico-imx8mq:~# i2cdetect -y 2 ## that will detect devices on third i2c bus

Allwinner A13 hang on boot and return "SPL:Unsupported Boot Device!" error

I am new in here and I am sorry my bad English.
I have OLinuXino A13 board. I endeavor kernel and boot events. So I try boot OLinuxino-A13 via spiflash(in FEL mode). I connected board to my PC(USB OTG). I Sending commands from my computer for writing to spiflash. And differently I build second connect with usb-ttl. So I can see opening writing of board with CuteCom program from my PC. And I use sunxi-tools for write to spiflash of my board.
And I did this:
I compiled kernel and I created u-boot-sunxi-with-spl.bin file. After I entered FEL mode and I wrote this file to on my board with ./sunxi-fel spiflash-write 0 /path/u-boot-sunxi-with-spl.bin. When I use boot my board from PC with ./sunxi-fel uboot /path/u-boot-sunxi-with-spl.bin, my board start and it work for find to sd card. Result this:
U-Boot SPL 2019.04-rc1-00141-g63f7e3fca3 (Feb 19 2019 - 17:23:48 +0300)
DRAM: 512 MiB
CPU: 1008000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from FEL
U-Boot 2019.04-rc1-00141-g63f7e3fca3 (Feb 19 2019 - 17:23:48 +0300) Allwinner Technology
CPU: Allwinner A13 (SUN5I)
Model: Olimex A13-Olinuxino
I2C: ready
DRAM: 512 MiB
MMC: mmc#1c0f000: 0
Loading Environment from FAT... MMC: no card present
Setting up a 1024x768 vga console (overscan 0x0)
In: serial
Out: vga
Err: vga
Allwinner mUSB OTG (Peripheral)
Net:
Warning: usb_ether using MAC address from ROM
eth0: usb_ether
starting USB...
USB0: USB EHCI 1.00
USB1: USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 2 <0x08><0x08><0x08> 1 <0x08><0x08><0x08> 0
MMC: no card present
Device 0: unknown device
But differently if I restart my board after(card is out of fel mode) ./sunxi-fel spiflash-write 0 /path/u-boot-sunxi-with-spl.bin command. Result this:
U-Boot SPL 2019.04-rc1-00141-g63f7e3fca3 (Feb 19 2019 - 17:23:48 +0300)
DRAM: 512 MiB
CPU: 1008000000Hz, AXI/AHB/APB: 3/2/2
SPL: Unsupported Boot Device!
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
A13-OLinuxino_defconfig file:
CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
CONFIG_SPL=y
CONFIG_MACH_SUN5I=y
CONFIG_DRAM_CLK=408
CONFIG_DRAM_EMR1=0
CONFIG_MMC0_CD_PIN="PG0"
CONFIG_USB0_VBUS_DET="PG1"
CONFIG_USB1_VBUS_PIN="PG11"
CONFIG_AXP_GPIO=y
# CONFIG_VIDEO_HDMI is not set
CONFIG_VIDEO_VGA_VIA_LCD=y
CONFIG_VIDEO_VGA_VIA_LCD_FORCE_SYNC_ACTIVE_HIGH=y
CONFIG_VIDEO_LCD_POWER="AXP0-0"
CONFIG_VIDEO_LCD_BL_PWM="PB2"
CONFIG_NR_DRAM_BANKS=1
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_SPL_I2C_SUPPORT=y
CONFIG_CMD_DFU=y
# CONFIG_CMD_FLASH is not set
CONFIG_CMD_USB_MASS_STORAGE=y
# CONFIG_SPL_DOS_PARTITION is not set
# CONFIG_SPL_PARTITION_UUIDS is not set
CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-olinuxino"
CONFIG_DFU_RAM=y
CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
CONFIG_AXP_ALDO3_VOLT=3300
CONFIG_CONS_INDEX=2
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_MUSB_GADGET=y
CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=yONFIG_AXP_ALDO3_VOLT=3300
CONFIG_CONS_INDEX=2
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_MUSB_GADGET=y
CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
I struggle for exceed this error and want to see result like on above. How can I fix this error?

Rtsp h264 missing plugin

I'm trying to receive a live H264 stream from a wireless camera using RTSP. The camera IP is 192.168.150.1 and it doesn't require authentication.
Since I'm developing under windows, I installed Gstreamer 1.0 - 1.8.3, a complete installation, with all the plugin and everything selected during the installation process.
When I try the pipeline
gst-launch-1.0 rtspsrc location="rtsp://192.168.150.1" latency=100 ! rtph264depay ! avdec_h264 ! autovideosink
I receive this output:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.150.1
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: No supported stream was found. You might need to allow more transport protocols or may otherwise be missing the right GStreamer RTSP extension plugin.
Additional debug info:
gstrtspsrc.c(6421): gst_rtspsrc_setup_streams (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
I also tried the following command:
gst-play-1.0 rtsp://192.168.150.1
getting this output:
Interactive keyboard handling in terminal not available.
Now playing rtsp://192.168.150.1
Pipeline is live.
ERROR Your GStreamer installation is missing a plug-in. for rtsp://192.168.150.1
ERROR debug information: gsturidecodebin.c(1006): no_more_pads_full (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0:
no suitable plugins found:
gstrtspsrc.c(6421): gst_rtspsrc_setup_streams (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source
Reached end of play list.
When I try the same URL (rtsp://192.168.150.1) in VLC I can see the stream. So my guess is that I'm missing "the right GStreamer RTSP extension plugin"
The output of inspect-1.0 | grep 264 is:
File STDIN:
x264: x264enc: x264enc
videoparsersbad: h264parse: H.264 parser
typefindfunctions: video/x-h264: h264, x264, 264
rtp: rtph264depay: RTP H264 depayloader
rtp: rtph264pay: RTP H264 payloader
openh264: openh264dec: OpenH264 video decoder
openh264: openh264enc: OpenH264 video encoder
libav: avdec_h264: libav H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 decoder
libav: avmux_ipod: libav iPod H.264 MP4 (MPEG-4 Part 14) muxer
I also tried using FFmpeg and I can see the video, but I prefer using Gstreamer because I'm going to use the same configuration (camera, pipeline, gstreamer library...) on an Android device, and in my opinion Gstreamer seems to be the best choice.
From FFmpeg I got this info about the stream
Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 640x352, 29.92 tbr, 90k tbn, 180k tbc
Does anyone have some advices to sort this thing out?
Wich plugin am I missing? And how can I to add in my installation?
Edit:
The output of gst-launch-1.0.exe -v playbin uri=rtsp://192.168.150.1
Setting pipeline to PAUSED ...
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: ring-buffer-max-size = 0
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-size = -1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-duration = -1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: use-buffering = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: download = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: uri = rtsp://192.168.150.1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: connection-speed = 0
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: source = "\(GstRTSPSrc\)\ source"
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.150.1
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: Your GStreamer installation is missing a plug-in.
Additional debug info:
gsturidecodebin.c(1006): no_more_pads_full (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
no suitable plugins found:
gstrtspsrc.c(6421): gst_rtspsrc_setup_streams (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
I had exactly same problem with GStreamer/1.8.3.
And the reason was that my camera did not provide the "Control URL" attribute in it's session descriptions, while GStreamer is not smart enough to fall back to the base URL in this case (like other players do).
So, I ran the following command to get detailed logs from GStreamer:
gst-play-1.0 rtsp://camera_ip:port/ --gst-debug-level=9 --gst-debug-no-color &> GSTREAMER_LOGS.txt
In the logs I found this line:
DEBUG rtspsrc gstrtspsrc.c:6109:gst_rtspsrc_setup_streams:<source> skipping stream 0x7f01b402c140, no setup
Then looking into the current gstrtspsrc.c code from Kurento's gst-plugins-good bundle, I found that "skipping stream ..., no setup" error only happens when stream->conninfo.location == NULL. And that, as I said, happened because my camera didn't provide the "Control URL" attribute in SDP. Adding the following line to my camera SDP session descriptions solved the issue for me:
a=control:*
But, generally, this probably needs to be fixed in GStreamer code.
I believe this is a limitation of GStreamer that isn't shared by VLC and ffmpeg. I have a similar situation here, where I have three different RTSP cameras, two that work fine with GStreamer and one that doesn't. All three work fine with VLC and ffmpeg.
I used Wireshark to look at the raw RTSP protocol and found that the two cameras that work with GStreamer include an sprop-parameter-sets parameter field, while the one that doesn't work doesn't have this field.
The information encoded in sprop-parameter-sets (the SPS and PPS data) is usually present in the RTP stream that comes from the camera. Apparently VLC and ffmpeg are smart enough to pick this up, but GStreamer is not.
I tried to manually insert the sprop-parameter-sets data by using the caps command line parameter, but was unsuccessful.

Resources