I'm trying to use a bunch of sundcards (8 usb + 4 hdmi + 1 mobo) to control different zones separately & combine them in cool ways.
I'm having trouble getting pulse to recognize all of my soundcards' existence.
"aplay -l" recognizes all 13 cards, as does "pacmd list-cards", but pulse only recognizes 10 of them (0-9). It seems to find them in the "pacmd dump", but not in "list-sinks."
my "pacmd info" file loads all the modules correctly, but I can't figure out why "list-sinks" doesn't list them.
If ALSA recognizes your sound cards then you can try to add them to PulseAudio manually with pacmd load-module module-alsa-sink device=hw:x,y where x and y is the device, subevice pair of aplay -l.
If it works correctly then you can append these commands to the default configuration of PulseAudio (/etc/pulse/default.pa). (I know that it's only a hack, but it works for me :)
Related
if I execute:
speaker-test -D plughw:1,0 -t wav , sound gets played over the hdmi cable, as it is supposed to.
But if I type speaker-test -t wav , no sound gets played over the hdmi cable, so I guess the issue is the default output device.
Here is a list of what I've already tried:
change the output device in the top left corner on the Desktop
execute amixer cset numid=3 2 in the console
uncomment those 2 lines in the config:
hdmi_drive=2
hdmi_force_hotplug=1
change to those 2 lines in the alsa.conf file:
defaults.ctl.card 1
defaults.pcm.card 1 (also tried with 2 instead of 1)
My goal is to later play sound over a browser, but chrome seems to only be able to output sound over the default audio output device, so I guess I somehow need to change it.
I am a noob, so please tell if me if you need more informations and how to get them.
If anyone has some hits on how to solve this issue, I'd be really grateful
had the same problem (PI 4, Bullseye).
what helped was:
sudo raspi-config
1. System options
S2. Audio
Select HDMI Option (In my case it was HDMI 2, because default output was on HDMI 1)
After that default output worked. Everything else (changing config.txt or alsa.conf) wasn't necessary in my case.
reference: Raspberry Pi Configuration
At the time I tried to get into the configuratioms via
sudo raspi-config
as #reallyATypo suggested, but it seemed to be broken somehow. Even navigating into it on the desktop environment didn't work...
Since there were those weird things going on with the os and there wasn't much data on the RasPi anyways, I decided to set up an entirely new os on the same SD card. On there the default configurations seemed to be already correct and there also was no problem anymore with the os.
Thank you all for answering :)
Idk if that is the right thing to do, but I'm gonna set my answer as a workig one in order to close the issue
I am building some kind of kiosk system and I bought this USB DIY keyboard for it: https://www.amazon.com/gp/product/B07QPXQQ7L
This allows me to have a lot of buttons and they behave like keyboard keys.
I'm writing a program (Perl) that will take the input from that keyboard and do things based on that.
The problem is that I need to have the rest of the system (both X and the TTYs) ignore that keyboard so that it won't type random things in the terminal or in the window manager. In other words, the system should disregard it but the device itself must still be available in /dev/input/...
I don't need a real keyboard to control the machine because I connect via VNC and SSH.
Bonus points if you know how to read from a /dev/input/... keyboard and end up with letters typed just like with STDIN in a terminal.
Thanks!
I found the solution here where someone wanted the exact same thing in the case of a barcode reader:
https://serverfault.com/questions/385260/bind-usb-keyboard-exclusively-to-specific-application/976557#976557
SUBSYSTEM=="input", ACTION=="add", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="yyyy", RUN+="/bin/sh -c 'echo remove > /sys$env{DEVPATH}/uevent'"
ACTION=="add", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="yyyy", SYMLINK+="diykeyboard"
And then replace xxxx and yyyy by the Vendor and Product ID as found in lsusb. So in my case 1c4f and 0002:
Bus 001 Device 003: ID 1c4f:0002 SiGma Micro Keyboard TRACER Gamma Ivory
The udevadm control --reload thing didn't do it for me, I had to reboot.
Then in theory the data typed on the keyboard should be available at /dev/diykeyboard (the SYMLINK variable).
Now in my case unfortunately there are multiple events that match this vendor+product, and to match the right one I needed to add DEVPATH=="*:1.0/*", KERNEL=="event*" in the second line where it creates the SYMLINK. And then surprise it did not create the link in /dev so I had to do something dirty, create a link myself with ln:
SUBSYSTEM=="input", ACTION=="add", ATTRS{idVendor}=="1c4f", ATTRS{idProduct}=="0002", RUN+="/bin/sh -c 'echo remove > /sys$env{DEVPATH}/uevent'"
SUBSYSTEM=="input", ACTION=="add", ATTRS{idVendor}=="1c4f", ATTRS{idProduct}=="0002", DEVPATH=="*:1.0/*", KERNEL=="event*", RUN+="/bin/sh -c 'ln -sf /dev/input/$kernel /diykeyboard'"
(don't create the link in /tmp since udev happens before the mounting of /tmp at boot)
From there I can read from /diykeyboard (which usually points to /dev/input/event0) either with evtest which shows the keys typed, or directly with my program and then decoding the scancodes.
I am trying to use 5 usb cameras on ubuntu 18.04.1 LTS in python using opencv.
Individually they all work fine, but as I connect them all together the following happens:
Mostly all cameras are successfully detected in start and are listed in lsusb as well as ls /dev/video*, but as I try to use them through my code in python one of these 5 cameras disappear and error like VIDEOIO ERROR: V4L: index 0 is not correct! is printed.A nd after that either ls /dev/video* does not show that camera or the camera name e.g. video0 is automatically changed to e.g. video6. i know if we restart PC the device names are changed but in this case I am not rebooting.
Sometimes the cameras are enlisted in both lsusb as well as in ls /dev/video* but while using select timeout appears.
Let me know if you need further information.
1.Try first to show video streams from all cameras with ffmpeg (or ffplay): https://trac.ffmpeg.org/wiki/Capture/Webcam#Linux
Or with gstreamer.
2. OpenCV can capture video from webcam with any backend (ifit was comliled with it): https://docs.opencv.org/3.4/d4/d15/group__videoio__flags__base.html#ga023786be1ee68a9105bf2e48c700294d
For example: cv.CAP_V4L2, cv.CAP_GSTREAMER, cv.CAP_FFMPEG etc
I am connected on my embedded device with the serial port and would like to start my custom binaries on boot and be able to see the output generated.
My /etc/inittab file contains:
console::respawn:/sbin/getty -L 115200 ttyAPP3 vt100
console::respawn:/usr/bin/mybinary
With this configuration, I can see the output of mybinary in the serial console but It is difficult/impossible to connect (insert login and password) to getty because of the interference of the output generated.
I tried to switch the output in inittab to another not used tty (tty10) like this:
console::respawn:/sbin/getty -L 115200 ttyAPP3 vt100
tty10::respawn:/usr/bin/mybinary
And now I can connect but how can I see the output generated to /dev/tty10 ?
I tried cat /dev/tty10 but nothing is shown.
I know the question is old, but it has no answers at all for crying out loud.
Remember that a TTY is both an output device and also an input device -- by cat'ing from it you're reading input from the terminal which means the keyboard, NOT the screen.
I don't know if there's a parallel in other *nixes, but Linux systems have /dev/vcsX and /dev/vcsaX character devices (nodes c,7,0+X and c,7,128+X respectively) for each /dev/ttyX device - these are mirrors of the data currently on the output of the TTY device (ie. the screen part of the TTY, not the keyboard part). These will give you what you're looking for. The vcsaX devices will give you a displaybyte+attributebyte pair (i.e. the foreground/background text colour -- see other references for more information on text attribute bytes) for each character on the screen, while the vcsX devices give only the displaybyte for each character. Of course it's a raw stream/dump so if the row and/or column count of your terminal doesn't match that of the the TTY you're dumping then you'll need to parse the data and reformat it to match.
tl;dr: use "cat /dev/vcs10"
Hope that helps.
In Ubuntu, we can select the output device of audio in sound preferences. But now I want to write a shell script, so I need to select the output device from the commandline.
You can first view your current default audio device by typing:
pactl stat
And with
pactl list
you can view all your devices.
And with this command
echo "set-default-sink alsa_output.Headset" | pacmd
you can set the default device.
But I found a much better source for this problem and a included little shell script for this problem here http://ubuntuforums.org/archive/index.php/t-1370383.html