Hi I'm trying to connect my Linux VM to a physical CAN-Bus.
The USB Passthrough and setup of the CAN interface is working perfectly fine, but I have trouble sending messages from the VM.
First of all here is my VM version and Hardware:
user#usb-can:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
USB2CAN adapter and Documentation
http://www.inno-maker.com/product/usb-can/
https://github.com/INNO-MAKER/usb2can/blob/master/Document/USB2CAN%20UserManual%20v.1.8.pdf
So first of all if I'm sending 15 CAN Messages from my VM to my CAN interface with cansend can0 123#DEADBEEF. and the first 2-3 messages are registered and also shown when I do a candump can0:
user#usb-can:~$ candump can0
can0 123 [4] DE AD BE EF
can0 123 [4] DE AD BE EF
can0 123 [4] DE AD BE EF
However the remaining 12 are not sent anymore and when I send additional frames I get:
user#usb-can:~cansend can0 123#DEADBEEF
write: No buffer space available
So I found out that I could inspect the buffer, and it showed this:
user#usb-can:~$ tc -s qdisc show dev can0
qdisc pfifo_fast 0: root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
Sent 144 bytes 9 pkt (dropped 3, overlimits 0 requeues 1)
backlog 176b 11p requeues 1
And this locks the whole device and I cant send anything because packages get dropped.
However this is with nothing attached to the adapter so I assume that is normal? Maybe somebody can verify this with knowledge about USB to CAN devices or with his own device?
Because there is no termination resistor so it would make sense that its not working properly.
BUT When I connect a Termination resistor of 120 Ohm and use the jumper to enable the 120 Ohm in the adapter, I should have the 2 required termination resistors and thus being able to send the CAN frames. But I get the same error as before:
user#usb-can:~$ tc -s qdisc show dev can0
qdisc pfifo_fast 0: root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
Sent 80 bytes 5 pkt (dropped 0, overlimits 0 requeues 1)
backlog 176b 11p requeues 1
So in my mind the CAN Network looks like this:
USB 2 CAN adapter
_________________/\_________________
/ \
_________
|usb2can|
---------
| |
CAN HIGH ___________*____|______________________________
| | |
__________ | _______________
|120 Ohm | | |120 Ohm |
---------- | ---------------
| | |
CAN LOW ----------------*------------------------------
Do I need to add another device to the network to make it work or shouldn't it work like that?
I already tried using different termination resistors if maybe one would be broken and also tried attaching an additional device. But no success yet.
I have an AV Receiver that I want to turn on from standby using cec-client on raspberry pi. The physicall setup is as follows:
RPI --HDMI--> AV Receiver
TV <--ARC_HDMI--> AV Receiver
Scanning my HDMI devices with echo "scan" | cec-client -s -d 1 I get following output:
opening a connection to the CEC adapter...
requesting CEC bus information ...
CEC bus information
===================
device #0: TV
address: 0.0.0.0
active source: no
vendor: Samsung
osd string: TV
CEC version: unknown
power status: standby
language: ger
device #1: Recorder 1
address: 1.0.0.0
active source: no
vendor: Pulse Eight
osd string: CECTester
CEC version: 1.4
power status: on
language: eng
device #5: Audio
address: 3.0.0.0
active source: no
vendor: Harman/Kardon
osd string: H/K AVR
CEC version: 1.4
power status: standby
language: ???
As you can see, my AV Receiver has the device number #5 and physical address 3.0.0.0
I tried following already, using cec-o-matic as reference:
echo "on 3.0.0.0" | cec-client -s -d 0
echo "on 5" | cec-client -s -d 0
echo "tx 15:04" | cec-client -s -d 0
But neither command turns on the AV Receiver. The same commands addressing the TV work without an issue.
After a lot of trial and error, I found out that rebooting my Raspberry Pi actually turns on the receiver! Nice, at least something. Investigating further I found out that in /boot/config.txt one can add/set the hdmi_ignore_cec_init=1 parameter to indicate whether the Raspberry Pi should send an active source message while rebooting. Depending on whether this is set to 0 or 1 my AV receiver turns on when I boot/reboot my RPI.
Now, I obviously don't want to reboot my RPI whenever I want to turn on my AV Receiver. So my question is what is the specific CEC-message the Raspberry sends on boot, so I can replicate it with the cec-client with something along the lines of echo "tx <specific-cec-message>" | cec-client -s -d 1
I already tried monitoring cec traffic on boot with cec-client -f cec.log, but monitoring starts too late and misses the send signal from RPI on boot.
The easiest way to find this out would probably to have a second Raspberry Pi monitoring the bus while the other one boots, but I only have 1 RPI, so I can not test it myself.
Does anyone have an idea, or at least a source for me? Big Thanks for taking the time!
In case it matters here also the specific device models.
TV: Samsung ue55f8090
AVR: Harman Kardon AVR 156
RPI: Raspberry Pi 4 Model B Rev 1.4
RPI_OS: Raspbian GNU/Linux 10 (buster) armv
RPI_KERNEL: Kernel: 5.10.103-v7l+
After more digging, I finally found a solution to my specific problem.
For my setup, as described in my question, one can turn on the Harman Kardon AVR 156 by broadcasting an active source message with the physical address of the TV.
echo "tx 1f:82:00:00" | cec-client -s -d 1
A breakdown of the CEC Frame:
1 = Recording 1 (Raspberry Pi)
F = Broadcast
82 = Active Source
00 00 = ID (TV)
I hope this helps anyone stumbling on this in the future!
I am just playing with DPDK here to get some hands on experience of tools to generate packets for that i have setup tow VMs on VMware ESXi.
VM-A and VM-B are connected back to back with Internal_vSwitch
I have compiled DPDK and l2fwd on VM-B and pktgen on VM-A but when i run pktgen do start all doesn't showing generating any packets. because of my limited knowledge i am not able to debug what could be wrong.
Grub (i did configure hugepage from command line not grub)
root#VM-A:~/pktgen-dpdk-pktgen-20.11.3/usr/local/bin# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-5.4.0-91-generic root=/dev/mapper/vg0-root ro
HugePage
root#VM-A:~/pktgen-dpdk-pktgen-20.11.3/usr/local/bin# hugeadm --pool-list
Size Minimum Current Maximum Default
2097152 2048 2048 2048 *
1073741824 0 0 0
binding port
root#VM-B:~/pktgen-dpdk-pktgen-20.11.3/usr/local/bin# dpdk-devbind.py -s
Network devices using DPDK-compatible driver
============================================
0000:0b:00.0 'VMXNET3 Ethernet Controller 07b0' drv=uio_pci_generic unused=vmxnet3,vfio-pci
Network devices using kernel driver
===================================
0000:03:00.0 'VMXNET3 Ethernet Controller 07b0' if=ens160 drv=vmxnet3 unused=vfio-pci,uio_pci_generic *Active*
Pktgen not generating any packet. all the counters are zero.
root#VM-A:~/pktgen-dpdk-pktgen-20.11.3/usr/local/bin# ./pktgen -l 1-2 -n 1 -- -P -N -T -m "3.0"
Copyright (c) <2010-2020>, Intel Corporation. All rights reserved. Powered by DPDK
EAL: Detected 4 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Detected shared linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: Probe PCI driver: net_vmxnet3 (15ad:7b0) device: 0000:0b:00.0 (socket 0)
EAL: No legacy callbacks, legacy socket not created
*** Copyright (c) <2010-2020>, Intel Corporation. All rights reserved.
*** Pktgen created by: Keith Wiles -- >>> Powered by DPDK <<<
Port: Name IfIndex Alias NUMA PCI
0: net_vmxnet3 0 0 15ad:07b0/0b:00.0
Initialize Port 0 -- TxQ 1, RxQ 1
Src MAC 00:0c:29:ae:70:dc
<Promiscuous mode Enabled>
WARNING: Nothing to do on lcore 2: exiting
- Ports 0-0 of 1 <Main Page> Copyright (c) <2010-2020>, Intel Corporation
Flags:Port : P------Single :0
|ink State : <UP-10000-FD> ---Total Rate---
-kts/s Max/Rx : P------Single :0 0/0
| Ports 0-0 of 1 <Main Page> Copyright (c) <2010-2020>, Intel Corporation
/ Flags:Port : P------Single :0 3/1
Link State : P------Single :0 ---Total Rate---
Pkts/s Max/Rx : <UP-10000-FD> 3/0
Max/Tx : 3/0 3/0
MBits/s Rx/Tx : 0/0 0/0
Broadcast : 0/0 0/0
Multicast : 0
Sizes 64 : 0
65-127 : 0
128-255 : 0
256-511 : 0
512-1023 : 0
1024-1518 : 0
Runts/Jumbos : 0
ARP/ICMP Pkts : 0/0
Errors Rx/Tx : 0/0
Total Rx Pkts : 0/0
Tx Pkts : 10
Rx MBs : 0
Tx MBs : 0
TTL/Port Src/Dest : 0
Pattern Type : abcd...
Tx Count/% Rate : Forever /100%
Pkt Size/Tx Burst : 64 / 32
TTL/Port Src/Dest : 4/ 1234/ 5678
Pkt Type:VLAN ID : IPv4 / TCP:0001
802.1p CoS/DSCP/IPP : 0/ 0/ 0
VxLAN Flg/Grp/vid : 0000/ 0/ 0
IP Destination : 192.168.1.1y DPDK (pid:1957) -----------------
Source : 192.168.0.1/24rface without timers
MAC Destination : 00:00:00:00:00:00
Source : 00:0c:29:ae:70:dc
-- Pktgen 20.11.3 (D: 15ad:07b0/0b:00.0y DPDK (pid:1957) -----------------
Pktgen:/> start all
Pktgen:/>
The issue is related to the incorrect command-line configuration set for DPDK-PKTGEN.
Current: ./pktgen -l 1-2 -n 1 -- -P -N -T -m "3.0"
Correct: ./pktgen -l 1-2 -n 1 -- -P -N -T -m "2.0"
reason: pktgen option -m "3.0" stands for do RX and TX on CPU core 3. But as per DPDK lcore arguments, only core 1 and core 2 is passed as dpdk arguments. Hence rectifying the same to -m "2.0" solves the same.
I am trying to enable AF_XDP zero copy mode and i see the error in Cent OS 8(kernel 4.18), but SKB mode and DRV mode with copy works fine. The driver is ixgbe 5.6.5 which supports AF_XDP zero copy as per the documentation. strace shows the failure is during bind
./af_xdp_user -d eth2 -z -q 1
bind(3, {sa_family=0x2c /* AF_??? */, sa_data="\4\0006\1\0\0\0\0\0\0\0\0\0\0"}, 16) = -1 EOPNOTSUPP (Operation not supported)
The ethtool shows i have combined queues and not separate rx/tx queues. Is that a problem?
[root#localhost ~]# ethtool -l eth2
Channel parameters for eth2:
Pre-set maximums:
RX: 0
TX: 0
Other: 1
Combined: 63
Current hardware settings:
RX: 0
TX: 0
Other: 1
Combined: 9
[root#localhost ~]# ethtool -i eth2
driver:
ixgbe
version: 5.6.5
firmware-version: 0x61c10001
expansion-rom-version:
bus-info: 0000:00:06.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: yes
Any ideas what is missing?
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 months ago.
Improve this question
1) I've been using Ubuntu 18.04 with Windows 10 dual boot for some months now. Today suddenly my sound stopped working on Ubunutu. Activities -> Sound menu shows only "Dummy Output". All fine on Windows though.
2) Output of lsmod is:
rohit#rohitUb18043LTS:~$ lsmod | grep snd_
snd_seq_midi 20480 0
snd_seq_midi_event 16384 1 snd_seq_midi
snd_seq 69632 2 snd_seq_midi,snd_seq_midi_event
snd_rawmidi 36864 1 snd_seq_midi
snd_seq_device 16384 3 snd_seq,snd_seq_midi,snd_rawmidi
snd_soc_dmic 16384 0
snd_hda_codec_realtek 118784 0
snd_hda_codec_generic 81920 1 snd_hda_codec_realtek
ledtrig_audio 16384 2 snd_hda_codec_generic,snd_hda_codec_realtek
snd_soc_hdac_hdmi 32768 0
snd_sof_intel_hda_common 73728 1 sof_pci_dev
snd_soc_hdac_hda 24576 1 snd_sof_intel_hda_common
snd_sof_intel_hda 20480 1 snd_sof_intel_hda_common
snd_sof_intel_byt 24576 1 sof_pci_dev
snd_sof_intel_ipc 20480 1 snd_sof_intel_byt
snd_sof 98304 4 snd_sof_intel_hda_common,snd_sof_intel_byt,snd_sof_intel_ipc,sof_pci_dev
snd_sof_xtensa_dsp 16384 1 sof_pci_dev
snd_hda_ext_core 28672 4 snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_hdac_hda,snd_sof_intel_hda
snd_soc_acpi_intel_match 32768 2 snd_sof_intel_hda_common,sof_pci_dev
snd_soc_acpi 16384 2 snd_soc_acpi_intel_match,sof_pci_dev
snd_soc_core 237568 5 snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_hdac_hda,snd_soc_dmic
snd_compress 24576 1 snd_soc_core
ac97_bus 16384 1 snd_soc_core
snd_pcm_dmaengine 16384 1 snd_soc_core
snd_hda_codec_hdmi 57344 1
snd_hda_intel 53248 2
snd_intel_nhlt 20480 1 snd_hda_intel
snd_hda_codec 131072 5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek,snd_soc_hdac_hda
snd_hda_core 90112 10 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_hda_codec_realtek,snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_hdac_hda,snd_sof_intel_hda
snd_hwdep 20480 1 snd_hda_codec
snd_pcm 102400 10 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_core,snd_hda_core,snd_pcm_dmaengine
snd_timer 36864 2 snd_seq,snd_pcm
snd 86016 17 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_compress,snd_soc_core,snd_pcm,snd_rawmidi
rohit#rohitUb18043LTS:~$
3) I installed all updates from Software updater but no luck.
4) No change by using: sudo alsa force-reload
5) Looking around, found this thread: https://askubuntu.com/questions/1059619/sound-card-shown-as-dummy-output-in-ubuntu-18-04 . User says found the "active profile was off" and links to a solution on this forum (https://forums.linuxmint.com/viewtopic.php?t=268499). I am pasting the output of the four commands as per that link:
rohit#rohitUb18043LTS:~$ sudo fuser -v /dev/snd/*
[sudo] password for rohit:
USER PID ACCESS COMMAND
/dev/snd/controlC0: gdm 1505 F.... pulseaudio
rohit 1878 F.... pulseaudio
rohit#rohitUb18043LTS:~$ pacmd list-cards
1 card(s) available.
index: 0
name: <alsa_card.pci-0000_01_00.1>
driver: <module-alsa-card.c>
owner module: 7
properties:
alsa.card = "0"
alsa.card_name = "HDA NVidia"
alsa.long_card_name = "HDA NVidia at 0xb4000000 irq 17"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:01:00.1"
sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card0"
device.bus = "pci"
device.vendor.id = "10de"
device.vendor.name = "NVIDIA Corporation"
device.product.id = "0fb9"
device.product.name = "GP107GL High Definition Audio Controller"
device.string = "0"
device.description = "GP107GL High Definition Audio Controller"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
profiles:
output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5400, available: no)
output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (priority 300, available: no)
output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (priority 300, available: no)
off: Off (priority 0, available: unknown)
active profile: <off>
ports:
hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
rohit#rohitUb18043LTS:~$ pacmd list-sinks
1 sink(s) available.
* index: 0
name: <auto_null>
driver: <module-null-sink.c>
flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 1000
volume: front-left: 65536 / 100% / 0,00 dB, front-right: 65536 / 100% / 0,00 dB
balance 0,00
base volume: 65536 / 100% / 0,00 dB
volume steps: 65537
muted: no
current latency: 0,00 ms
max request: 344 KiB
max rewind: 344 KiB
monitor source: 0
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
configured latency: 0,00 ms; range is 0,50 .. 2000,00 ms
module: 15
properties:
device.description = "Dummy Output"
device.class = "abstract"
device.icon_name = "audio-card"
rohit#rohitUb18043LTS:~$ pacmd list-sink-inputs
0 sink input(s) available.
rohit#rohitUb18043LTS:~$
6) I tried the suggested command but it says "No such profile".
rohit#rohitUb18043LTS:~$ pacmd set-card-profile alsa_card.pci-0000_01_00.1 output:analog-stereo+input:analog-stereo
No such profile: output:analog-stereo+input:analog-stereo
rohit#rohitUb18043LTS:~$
Please help - how do I proceed?
Similar issue with "Dummy Sound" on Ubuntu 18.04 also with a NVIDIA card. This solved it for me:
Edit /etc/modprobe.d/alsa-base.conf as root and add options snd-hda-intel dmic_detect=0
Edit /etc/modprobe.d/blacklist.conf as root and add blacklist snd_soc_skl at the end of the file.
After making these changes, reboot your system.
More details (and credits): https://www.linuxuprising.com/2018/06/fix-no-sound-dummy-output-issue-in.html
I had the same problem, and tried the solution given by #maartenor without success.
Eventually I got the sound back by upgrading linux kernel to the last HWE stack, for me it was 4.15.0-106-generic to 5.3.0-59-generic.
The command to do this :
$ sudo apt install linux-generic-hwe-18.04
Edit the file /etc/modprobe.d/alsa-base.conf and add the following lines:
options snd-hda-intel dmic_detect=0
options snd-hda-intel model=laptop-amic enable=yes
The first line is to enable the speaker, the second for the internal microphone.
Good luck!
Got this answer from Reddit. Worked like a charm for me!
Link : https://www.reddit.com/r/linuxmint/comments/fltlrl/no_sound_on_acer_swift_3_with_kernel_53/
Try this..
Open your terminal
sudo apt update && sudo apt install alsamixer
run alsamixer in your terminal.
press arrow right til you go to sound option (if headphone go to HEADPHONES bar).
press M to unmute.
press up/down to adjust the volume.
press Esc to exit alsamixer.
Following steps worked very reliably. It does not fix the audio-losing-after-suspend issue permanently, but instantly as a command to run after back from suspend.
Use lspci to get the audio card location (0000:00:1f.3). On my machine,
$ lspci
00:1f.0 ISA bridge: Intel Corporation H110 ...
00:1f.2 Memory controller: Intel ...
00:1f.3 Audio device: Intel Corporation 100 Series/C230 Series Chipset ...
00:1f.4 SMBus: Intel Corporation 100 Series/C230 Series Chipset ...
Then, (make sure the directories below exist)
$ echo 1 | sudo tee /sys/bus/pci/devices/0000:00:1f.3/remove
$ echo 1 | sudo tee /sys/bus/pci/rescan
I believe the audio driver/hardware is stuck. So we remove the device driver, and rescan the PCI bus to get audio back.
i found answer above not work on my computer, and i solve this problem by accidient , this is script i use , most same as answer above, but at last, u need mute then unmute auidio. sleep a short moment after command is necessary here if you put script in sh file then excute it , use sh -c is for file redirection for root
REST=0.5
#make sure Audio always actived
sudo sh -c 'echo 1 >/sys/bus/pci/rescan'
sleep $REST
DEVICE_ID=$(lspci -D | grep Audio | awk '{print $1}')
sleep $REST
sudo sh -c 'echo 1 >/sys/bus/pci/devices/0000:00:1f.3/remove'
sleep $REST
sudo sh -c 'echo 1 >/sys/bus/pci/rescan'
sleep $REST
#mute then unmute to restart audio
amixer -D pulse sset Master mute
sleep $REST
amixer -D pulse sset Master unmute