date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,302,229,948,000 |
I didn't lock the screen on my OpenSuse Linux and let my girlfriend do all evil things when I was sleeping. Is there a way to find out if she deleted any files from my PC?
I was looking at the "Date Modified" timestamp of my folders and then I tried to delete something and that date didn't change. I was also looking a... |
I don't work with OpenSuse, but as I know, there is no logs on trashcan.
But if content of a directory change, His modification time have to change too.
At all, there is a few possibility to restore something, but:
You have to stop immediatly your disk activity (in root: mount -o remount,ro /home if /home is the moun... | How to find last deleted files on OpenSuse? |
1,302,229,948,000 |
When browsing to trash:/// in Nautilus, I see a long list of files and directories that I recognize and remember placing in the trash. However, attempting to delete them from Nautilus either results in a Preparing message indefinitely, or an error message Error while deleting. You do not have sufficient permissions to... |
This problem was actually being caused by having a .Trash-1000 folder on the external drive itself, with all the contents I was seeing in Nautilus within it.
In order to delete these files, I had to remount that drive as writable:
sudo mount -o remount,rw /partition/identifier /mount/point
After this point, I was ab... | Nautilus shows files in Trash, can't be located on cli |
1,302,229,948,000 |
On the desktop in Xfce 4.10, the trash can icon seems to be replaced by a pdf icon.
How can I replace it by a trash can icon?
|
The system doesn't seem to have an appropriate icon theme. End users who have installed from standard CD/DVD bootable image of any distro should not face this problem.
That "PDF icon"
No, that is not a "PDF icon" but rather a fallback icon provided by Xfce component (Xfdesktop). One way to discover this icon is to use... | How to obtain a trash can icon on the dektop (Xfce) |
1,302,229,948,000 |
In Debian the /root/ directory is so big but du show nothing inside it. root account is just a supervisor/administrator/superuser user, there is no folder for this account in home directory. This extra account created just for supervision is installed by default in Debian.
|
The problem is the ghost trash folder in this extra account. When you open Disk Usage Analyzer as a regular user you see a mismatch between the space occupied and what is shown in next screen. In the image below is shown a partition with 48.9 GB and with only 5.7 GB free.
but when you click in the / folder the screen... | du report wrong usage and root folder is so big |
1,422,948,101,000 |
I have an FFmpeg command to trim audio:
ffmpeg -ss 01:43:46 -t 00:00:44.30 -i input.mp3 output.mp3
The problem I have with this command is that option -t requires a duration (in seconds) from 01:43:46. I want to trim audio using start/stop times, e.g. between 01:43:46 and 00:01:45.02.
Is this possible?
|
ffmpeg seems to have a new option -to in the documentation:
-to position (input/output)
Stop writing the output or reading the input at position. position
must be a time duration specification, see (ffmpeg-utils)the Time
duration section in the ffmpeg-utils(1) manual.
-to and -t are mutually exclusive and -t ha... | Trim audio file using start and stop times |
1,422,948,101,000 |
There are different sources and different practices are suggested. I found the following proposals how often one should run fstrim.
run weekly by cron
run daily by cron
run at each boot
What is the optimal option and why? Ubuntu 14.04 uses the first option by default.
|
TRIM does at least three things:
minimize write amplification
prevent long-term performance degradation
irrecoverably delete your data
Now it depends where your priorities are.
For 1), you should not be using fstrim at all, but make use of the discard option of your filesystem. Only if everything is trimmed instantl... | SSD: how often should I do fstrim? |
1,422,948,101,000 |
I tried to setup TRIM with LVM and dm-crypt on ubuntu 13.04 following this tutorial:
http://blog.neutrino.es/2013/howto-properly-activate-trim-for-your-ssd-on-linux-fstrim-lvm-and-dmcrypt/
See the notes about my configuration and my testing procedure below.
Questions
Is there a reliable test if TRIM works properly?
... |
I suggest using a different testing method. hdparm is a bit weird as it gives device addresses rather than filesystem addresses, and it doesn't say which device those addresses relate to (e.g. it resolves partitions, but not devicemapper targets, etc.). Much easier to use something that sticks with filesystem addresse... | Trim with LVM and dm-crypt |
1,422,948,101,000 |
I have a file, that has trash (binary header and footer) at the beginning and end of the file. I would like to know how to nuke these bytes. For an example, let's assume 25 bytes from the beginning. And, 2 bytes from the end.
I know I can use truncate and dd, but truncate doesn't work with a stream and it seems kind o... |
You can combine GNU tail and head:
tail -c +26 file | head -c -2
will output the contents of file starting at byte 26, and stopping two bytes (minus two -2) before the end. (-c operates on bytes, not characters.)
| How do I trim bytes from the beginning and end of a file? |
1,422,948,101,000 |
I have a drive (SD card) with a few ext4 partitions but also some unallocated space. The fstrim utility can only work within a filesystem. Before I reinvent the wheel and write one, is there another utility that can TRIM the unallocated space (or that can TRIM an explicitly specified range)?
I can verify that the majo... |
If you have a recent enough version of util-linux, it contains the tool blkdiscard which is able to TRIM entire devices, or ranges within a device using --offset and --length options.
Please note: blkdiscard is dangerous, if you let it TRIM the wrong regions, your data is gone!
So you can figure out the unpartitioned ... | Utility to TRIM unallocated space on drive |
1,422,948,101,000 |
fstrim requires the Linux block device to be mounted, and it is not very verbose. blkdiscard could tell, but also that would require a write operation.
Can I somehow tell if a block device supports trimming/discarding, without actually trying to trim/discard something on it?
|
You can check the device’s maximum discard sizes, e.g.
$ cat /sys/block/X/queue/discard_max_hw_bytes
(replacing X as appropriate).
If this shows a value greater than 0, the device supports discards:
A
discard_max_hw_bytes value of 0 means that the device does not
support discard functionality.
The maximum supported... | How can I tell if a Linux block device is trimmable or not? |
1,422,948,101,000 |
Will a standard fresh linux (Ubuntu 11.10 to be exact) install and drive re-format (full) successfully TRIM my SSD, or do I need to do something extra?
I know that ext4 will TRIM blocks on erase when I specify the discard option, but I want to start with a completely TRIMmed drive if possible.
|
TRIM is a command that needs to be sent for individual blocks. I have asked the question before (What is the recommended way to empty a SSD?) and it is suggested to use ATA Secure Erase, a command that is sent to the device to clear all data.
| Will formatting my drive TRIM my SSD? |
1,422,948,101,000 |
When I installed my SSD I just mounted with discard and didn't sweat it. However today I was reading about the pros and cons of using fstrim instead and decided to run the program to get an idea of how long it would actually take (still with my partitions mounted with discard). The command took several minutes on both... |
Two things here:
fstrim trims all the data that is unallocated in the filesystem (well, not really all the data, only the data blocks that are not allocated, I don't think the unused parts of the inode table or the parts of not-completely used blocks are trimmed), regardless of whether discard is in used or not. fstr... | fstrim trims more than half of partition size even though partition mounted with discard |
1,422,948,101,000 |
I have Linux installed on a Dell XPS 9343 with an Samsung PM851 SSD.
I recently read that many SSDs don't support TRIM operations.
So I'd like to check if discard option effectively works on my system.
At first step, I tried to simply run sudo fstrim --verbose --all and it reported 41GB trimmed; this makes me fear bec... |
as @meuh pointed out in the comment, I need to run the test on my EXT4 partition, while I tried it on my /tmp
SOLVED!
PS: following the test result, I can confirm that the drive on my XPS 9343 (Samsung PM851 M.2 2280 256GB, firmware revision: EXT25D0Q) supports TRIM command, even if dmesg reports NCQ Send/Recv Log no... | How do I check TRIM? |
1,422,948,101,000 |
I have a data file, the content is as follows:
department: customer service section: A
department: marketing section: A
department: finance section: A
When I read each line, I would extract the department name using cut command. Unfortunately, the program will automatically trim all redundant space... |
You are losing the spaces when you expand $line. Put double quotes around your variable expansion and you'll preserve the spaces:
$ cat dept.dat | while read line
> do
> echo "$line"
> echo "$line" | cut -c 12-29"
> done
department: customer service section: A
customer service
department: marketing ... | Unix: how to read line's original content from file |
1,422,948,101,000 |
I was wondering whether mounting an SSD using the discard option (documented in man mount) is actually required for ATA TRIM to be sent to the SSD's controller.
The evidence is a bit circumstantial: Whether or not I mount a partition with discard on a SanDisk SSD PLUS, deleted files can't be restored by running TestDi... |
If the filesystem is mounted with discard, then deleting files will automatically cause the TRIM command to be issued. This often has a negative performance impact, so it's generally better not to use that mount option and to instead run fstrim periodically, which will work as long as all the block device layers suppo... | Is mounting with "discard" needed for TRIM? |
1,422,948,101,000 |
So far I have been using the following command to split an audio file from S to E:
ffmpeg -i input.mp3 -ss S -to E -c copy output.mp3
Due to the fact that I need to split an audio file into multiple segments, each having a different length, I have to use the above command multiple times for only a single file.
So, is... |
Sure, just give it more output files:
ffmpeg -i input.mp3 -ss S -to E -c copy output1.mp3 -ss S -to E -c copy output2.mp3 …
Options after the input file actually pertain to the output file (so the -c, -ss and -to options are for the output file). And you can have multiple output files.
(Unlike the segments muxer, you... | Trim an audio file into multiple segments using `ffmpeg` with a single command |
1,422,948,101,000 |
The question appears if we want to use a swap partition on an SSD drive. I think, it would be better (for the SSD) if the deallocated swap space could be trimmed, because trimming the not used blocks enables the underlying SSD electronics to tune its wear leveling.
Google seems silent on the matter.
Alternatively, a r... |
Yes, as it is visible the manual of the swapon command, it has a discard option. It would be meaningless if the linux swap wouldn't support it. Of course the underlying device should support trimming.
| Do Linux swap partitions support trimming? |
1,422,948,101,000 |
I have a 1400x1400 image in which I want to trim 4 pixels to the left, 1 at the bottom and, to keep square proportions, 3 from the top. The problem is, whenever I perform a crop with jpegtran, pixels get removed from the bottom-right, no matter what I do. For instance, testing just the left part, I tried:
jpegtran -pe... |
jpegtran can't losslessly cut at any finer increment than the Minimum Coded Unit size, which varies depending on the channel and the chroma sampling mode. It's going to be 8×8, 16×8, or 16×16.
This means the minimum cut size must be an even multiple of 8 or 16, depending on the way the image was encoded. The exception... | jpegtran - losslessly crop left portion of image |
1,422,948,101,000 |
I need to configure a RAID-1 on one SSD and one HDD. Both SSD and HDD has some preinstalled software, which I don't need so both can be fully wiped if that is any advantage.
My research so far lead me to the --write-mostly option, which I understand that I should be using on the HDD such that read operations will get ... |
Just use --assume-clean and don't even sync in the first place.
Once you create your RAID, the first thing you do is mkfs... and mkfs TRIMs by default without even asking (unless you use -E nodiscard or similar) and your RAID sync is already gone at this point anyway.
Basically it's impossible to keep a mixed SSD+HDD ... | Configuring a mdadm RAID-1 on SSD and HDD |
1,422,948,101,000 |
It is recommended to enable a TRIM cron job which run once every week.
When the fstrim command is called the filesystem will sent TRIM information to the drive to discard deleted data (I hope I get it right)
So far so good, this is described many places.
But I cannot find any information about how/where those TRIM i... |
I don't know if ext4 actually stores it anywhere. Other filesystems certainly don't.
ext4 avoids what it already trimmed in the current session only - while it's still mounted. Once you reboot or re-mount the filesystem, it just TRIMs empty space all over again.
So this could be an in-memory structure that isn't store... | How does the filesystem (ext4) "store" TRIM information? |
1,422,948,101,000 |
I have an SSD disk with several partitions. One of them is has a btrfs volume, mounted as /home, which holds an ecryptfs home directory.
When I trim the volumes, it seems that fstrim doesn't trim data blocks on such volume - why? Below you can see all the informations about the setup, and the procedure I follow, with ... |
It is a common misunderstanding to worry about the sizes reported by fstrim.
It really doesn't mean anything. Just ignore it.
fstrim just issues the appropriate ioctl, everything else is the decision of the filesystem, and filesystems behave very differently. For example, ext4 tries to avoid trimming the same things o... | Why fstrim appears not to trim data blocks on btrfs (+ecrypts)? |
1,422,948,101,000 |
I'm using avconv for trimming and converting videos. Let's say I want to drop the first 7 and last 2.5 seconds of the video stream and one audio stream of an one-hour mts file:
avconv -i input.mts -map 0:0 -map 0:3 -ss 0:0:07 -t 0:59:50.5 out.mov
This works so far, but now I want to add two seconds of fading in and o... |
I finally found the time to try the answer suggested by @Mario G., but it seemed extremely cumbersome. I need to do this many dozens of times. I read the documentation of ffmpeg and found it much more powerful than avconv, including fading for audio and video, so the solution is
ffmpeg -i input.mts -map 0:0 -map 0:3 -... | trim and fade in/out video and audio with avconv (or different tool) |
1,422,948,101,000 |
I have a new samsung ssd in my new notebook. I tuned up everything to avoid writings in the disk (firefox profiles and /var/log in memory), I'm using a ext4 fs with relatime and I use fstrim once a day to TRIM my ssd.
I monitor disk load with iostat -dhm. Before running fstrim the command iostat shown
Device: ... |
MB_wrtn increased 102574 MB. Does that mean fstrim is writing 102574 MB = 100.2 GB to my disk ?
Yes, it means exactly that. fstrim essentially looks at every single block of your block device and decides if the block is being used by the filesystem (that is, contains important data):
block is in use: ignore it.
blo... | fstrim and iostat |
1,422,948,101,000 |
For an SSD, I can open the row device and discard a range of pages using ioctl() with BLKDISCARD command.
My question is
for an open file, how to discard a range of data? and Is that depends on the implementation of the underlying filesystem?
|
You're looking for fallocate's FALLOC_FL_PUNCH_HOLE. It's then up to the filesystem to discard/trim/unmap those blocks. I believe ext4 will do so.
For example, you'd do something like this to discard 2MiB starting 1MiB in:
err = fallocate(fd, FALLOC_FL_PUNCH_HOLE|FALLOC_FL_KEEP_SIZE, 1048576, 2097152);
if (0 != err) {... | How to discard/TRIM a range in an open file ? |
1,422,948,101,000 |
I am using btrfs and have mounted several subvolumes (but not btrfs root). It resides on SSD partition, so I would like to use fstrim. Should I call fstrim on each mountpoint (corresponding with different subvolume each) ? Or do I need to have btrfs root mounted and run fstrim on this mountpoint?
|
fstrim should run on "mountpoint", so you need to have devices mounted. But you only need to call it once per physical device. So if 2 mountpoints are on the same device with btrfs, you only need to call fstrim on one mountpoint.
Finding this answer:
https://forums.gentoo.org/viewtopic-t-1003980-view-previous.html?sid... | How to run SSD trim fstrim on btrfs when mounted multiple subvolumes? |
1,422,948,101,000 |
I have a Samsung PRO Series SSD. Linux deactivates Trim for this SSD because it deletes the wrong data when asynchronous Trim is used (firmware bug).
Is it possible to activate synchronous Trim for it without activating asynchronous Trim, too?
My laptop in which I use this SSD only runs 1 operating system: Ubuntu 16.... |
I found the solution.
I tried fstrim with explicit statements of the partitions as a weekly cronjob shortly after I posted the answer but didn't know whether it was safe. Furthermore, I didn't know whether someone would have a better answer. Therefore, I didn't post it as an answer myself.
I just looked at the content... | Enabling Synchronous TRIM Only |
1,422,948,101,000 |
I have a Linux (Ubuntu 18, kernel 4.15) desktop booting from an M2 nvme disk.
Once a week, it will crash around midnight. The relevant log file output from /var/log/syslog.* is below:
Jul 16 00:00:00 rabbitcruncher systemd[1]: Starting Discard unused blocks...
Jul 16 00:00:00 rabbitcruncher kernel: [559644.954267] nv... |
Your Ubuntu is running inside a kvm virtual machine with AMD-Vi so it should not be running fstrim.
The fstrim service runs on a timer so as root:
rm /var/lib/systemd/timers/stamp-fstrim.timer
systemctl stop fstrim.service fstrim.timer
systemctl disable fstrim.service fstrim.timer
systemctl mask fstrim.service fstrim.... | nvme fstrim causing crash on linux, disabling with systemctl doesn't help |
1,422,948,101,000 |
I'm running Mac OS 10.9 and I use the Text to Speech feature which allows you to use a hotkey that reads selected text in any application. I use this feature for reading out-loud PDF documents in Preview (Apple's PDF viewer).
The problem is that the selected text usually has word-break hyphens. The result is the Text... |
On Linux the following would work:
xsel | sed ':rep /-$/ {N; s/-\n//; b rep}' | xsel -i
On OSX I am largely guessing (although the sed script should work ok). pbcopy seems to the the command to use. Assuming there is a selection buffer on OSX and pbcopy works from it by default, this might work:
pbpaste | sed ':rep /... | fetch clipboard text and remove hyphens |
1,422,948,101,000 |
I have some text like:
Blablabla <b>[intlink id="</b>2204<b>" type="page"] Blalala
I want replace it for remove the </b> and <b>, keeping the id="number". So it should result like:
Blablabla <b>[intlink id="2204" type="page"] Blalala
I try with:
sed -i 's@id="</b>[[:digit:]]\+<b>"@id="{1}"@g' ~/edit.txt
Blablabla <b... |
\1 is the right syntax for referring to capture group 1; \\1 means you want the literal text \1. So change \\1 to \1, and then you need to put parentheses around the part you actually want to capture. This should work:
sed -i 's@id="</b>\([[:digit:]]\+\)<b>"@id="\1"@g' ~/edit.txt
| Sed: replace text keeping digit occurrence |
1,422,948,101,000 |
I have the following partition table:
NAME
nvme0n1
├─nvme0n1p1 part /boot
└─nvme0n1p2 part
└─crypt crypt
├─crypt-swap lvm [SWAP]
├─crypt-root lvm /
└─crypt-home lvm /home
As the drive is an SSD, I would like to perform TRIM comma... |
It turned out, LUK2 can permanently store metadata in the header.
It is possible to enable allow-discards and store in the partition itself (without any further configuration -e.g., kernel parameters) with the command:
cryptsetup --allow-discards --persistent refresh root
Evidently, I issued this command in the past ... | Disable allow-discards on encrypted partition |
1,422,948,101,000 |
I have set up an encrypted swap partition following this guide. My /etc/crypttab is set up like this (note the discard option on swap):
rootfs UUID=<UUID_root> none luks,discard
swap UUID=<UUID_swap> /dev/urandom swap,offset=2048,cipher=aes-xts-plain64,size=512,discard
I also have allow_discards=1 in /etc/lvm/lvm.con... |
So apparently because swap is not considered as a normal filesystem, it will not be trimmed when fstrim is run manually. But it appears that the Linux kernel does the trimming for the swap when it is mounted automatically when the underlying device supports the operation. This is referenced in the Fedora project docs:... | fstrim does not trim swap |
1,422,948,101,000 |
I updated the firmware of my Samsung 840 Pro to the newest version (DXM06B0Q). This SSD (along with many other Samsung SSDs) had a bug where it deletes arbitrary data if asynchronous TRIM is used. Can I now enable TRIM safely?
|
Yes. I concluded this for myself for reasons described in this answer.
| Is TRIM on Samsung 840 Pro with firmware version DXM06B0Q safe? |
1,422,948,101,000 |
It used to be that properly enabling TRIM for SSDs on Linux involved two steps:
Running fstrim once, to take care of all the "untrimmed" blocks to date, then
Setting the discard flag in fstab (so the trimming would continue).
I'm a little behind the times. Now I'm seeing things about an fstrim.timer service that is ... |
If you use discard, you don't need fstrim.timer, which basically means "automatically run fstrim for you from time to time". discard does not "continue" anything, it just means that TRIM would be triggered when files are deleted.
In other words, if certain files were deleted while the filesystem is mounted with nodisc... | Correct way to enable TRIM on recent Debian/Ubuntu |
1,422,948,101,000 |
I rarely ever write anything (large) to SSDs on many machines of my own, an example could be the use of one laptop as a TV viewer only, another my mother's laptop, which she uses just for banking. (If it matters, I use Linux Mint on all machines.)
Therefore it comes as annoying the weekly TRIM, as it takes a rather lo... |
To check the status of TRIM timer
sudo systemctl status fstrim.timer
You would get something like this:
● fstrim.timer - Discard unused blocks once a week
Loaded: loaded (/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled)
Active: active (waiting) since Mon 2022-01-10 06:36:56 CET; 31min left... | How to disable TRIM on SSD(s) under Linux Mint? |
1,422,948,101,000 |
Trying to do the following,
I have txt file which as the data of the interfaces.
Eth1/15 desc01 1
Eth101/1/11 desc01 1
Eth101/1/16 desc01 1
Eth103/1/21 desc01 1
Eth1/2 desc01 1
Eth1/24 desc01 1
Eth103/1/5 desc01 1
Gi0/1 desc01 1
Gi0/0/1 desc01 1
Gi0/1/1 ... |
$ awk -F"/" '!seen[$1]++ {print $1}' findint.txt
Eth1
Eth101
Eth103
Gi0
To get the output all in one comma-separated line, you could set the output separator ORS to , however you'd need to make a special case for the the last value; a simpler way is to pipe the output of awk to paste:
awk -F"/" '!seen[$1]++ {print $... | Group items from column using awk |
1,422,948,101,000 |
I'm running Arch Linux (systemd) on several systems. Some have SSD storage, others have nvme storage devices and some use rotational HDD's. Some systems use dm-crypt to encrypt the filesystem. All systems run btrfs on /.
I wish to have a bash script determine the physical device which hosts the root filesystem (/). Th... |
BTRFS supports multiple devices, so what you can do is use btrfs fi show to get the list of block devices. Then use cryptsetup status to check if a given device is a LUKS container. If it is the command will output the underlining device.
I wouldn't call this script-friendly, since you'll have to parse the output, but... | Find physical block device of root filesystem on an encrypted filesystem? |
1,422,948,101,000 |
I like to use dynamically allocated images in VirtualBox.
It is preferred way if you like to distribute you image (remember Vagrant?).
What Linux FS can reclaim unused blocks to VirtualBox when dynamically allocated image is used?
I saw that users run:
sudo dd if=/dev/zero of=/EMPTY bs=1M || : ; rm -f /EMPTY
to shrin... |
Official docs state: https://www.virtualbox.org/manual/ch08.html#vboxmanage-storageattach
VBoxManage storageattach <UUID> --nonrotational:
This switch allows to enable the non-rotational flag for virtual hard disks. Some guests (i.e. Windows 7+) treat such disks like SSDs and don't perform disk fragmentation on such ... | What FS can reclaim unused blocks to VirtualBox when dynamically allocated image is used? |
1,533,306,304,000 |
I have an embedded Linux on a custom board and I would like to send and receive file over its serial port.
The only way to communicate with this device is over serial and the device offers a console on this serial port.
This board doesn't have kermit neither busybox rx nor lrzsz.
- Sending file to remote
I was able to... |
Finally found out that I was issuing the wrong command on receiver's side.
Receive command shall be : cat < /dev/ttyUSB0 > file_b64
Summary
To receive from remote :
Host side | Remote side
|
| #Encode to base6... | Retrieve file over serial without kermit and lrzsz |
1,533,306,304,000 |
I have a Display that I want to write to. This is possible over the serial port. When I use a USB to RS-232 Converter, that thing works like a charm. I even tried using only the RX, TX and GND wires of the serial converter, and it still works. Now I want to use this Display in a small case paired with a Raspberry Pi, ... |
I'm quite confident the problem is that the Pi does not have an RS232 interface, while the display has.
The Pi has an (LV-)UART interface, its TX-pin outputs 0V for a logical 0 and 3.3V for a logical 1. This is quite easy to implement, since 3.3V is already available on the Pi. But this only works for communications ... | RaspberryPi serial port |
1,533,306,304,000 |
Background
I'm running FreeBSD 12.1-RELEASE as a host for bhyve virtual machines.
I have a FreeBSD 12.1-RELEASE guest running inside a VM. I would like to have two TTY-class devices configured for it.
According to the manual page, in order to start the VM with two TTY-class devices I have to start bhyve with command-l... |
The solution is to modify /etc/ttys on the guest. On amd64, it has the following defaults:
#
# $FreeBSD: head/sbin/init/ttys.amd64 338454 2018-09-04 15:48:13Z brd $
# @(#)ttys 5.1 (Berkeley) 4/17/89
#
# This file specifies various information about terminals on the system.
# It is used by several different progra... | How to active the second console to a FreeBSD guest running in bhyve? |
1,533,306,304,000 |
I am currently trying to log all communication from and to /dev/ttyUSB0 and simultaneously be able to connect minicom/screen to the same device for interaction.
I tried a couple of tools and tutorials but they all seem to occupy the device, so I can not connect to it with a terminal program.
Then I came across socat... |
You can certainly put an intervening socat in the way, and use its logging facilities. For example,
socat -v /dev/ttyUSB0,b19200,raw PTY,link=$HOME/myserial,raw,echo=0 2>logfile &
minicom -p $(readlink $HOME/myserial)
This will log the data read in each direction, shown by ">" or "<":
< 2017/07/14 14:33:58.210584 l... | socat - UART logging and redirecting |
1,533,306,304,000 |
I want to use UART1 or 2 (see picture) on the Orange Pi zero. But when I try to open the port with screen /dev/ttyS1
Screen terminates.
I found here that I needed to add "overlays=sun8i-h3-uart1" in /boot/armbianEnv.txt but someone on that forum said that that feature is not yet supported. I tried, but I still have th... |
My config on Orange Pi Zero for UART on mainline kernel:
overlay_prefix=sun8i-h3
overlays=usbhost2 usbhost3 uart1 uart2
Both UARTs work fine.
$ uname -a
Linux orangepizero 4.13.16-sunxi #20 SMP Fri Nov 24 19:50:07 CET 2017 armv7l armv7l armv7l GNU/Linux
| How to use UART pins on Orange Pi zero? |
1,533,306,304,000 |
I first found this by investigating parameters for earlycon but found that the options for console look almost identical. Both are present below and were taken from this source:
From documentation for console we have:
console= [KNL] Output console device and options.
tty<n> Use the virtual console device <n>... |
I'm sure someone is still doing this, but back in the days before stuff like ILO/DRAC/etc. became cheap and ubiquitous, the best way to get "out of band" access to the console in case of emergencies or an oops was over the serial port. You would mount a Terminal Server in the rack, then run cables to the serial port o... | Kernel parameters "console" and "earlycon" refer to old hardware? |
1,533,306,304,000 |
I am about to start working on an embedded system which runs kernel v2.6.x.
It is configured to use its serial line as a TTY (accessible via e.g. minicom, stty), but I want to run IP over the serial line so that I can run multiple multiplexed sessions over the link (e.g. via UDP/TCP or SSH).
I don't have much more inf... |
You would first disable getty running on your serial port device /dev/ttyS0 (or whatever it is named for your hardware) to free it (for example, by editing /etc/inittab and running telinit q - if you managed to steer away from systemd) and then you would run pppd(8) on it (either manually with appropriate parameters ... | How to configure embedded kernel to use serial line for PPP instead of TTY |
1,533,306,304,000 |
Sometimes I just need to read from a serial device, so I skip the complexities of minicom or screen and just cat. However, this only works if I first set the baud rate of the terminal using stty <baud> before attempting to open the file.
This data is likely already (or can be) buffered in the kernel and, in this case... |
It looks like you might be a bit confused about how this all works.
First, /dev/ttyACM0 does not represent the USB link, or even the USB endpoint for whatever serial adapter you have connected, it represents the UART inside the adapter that handles the serial communications. Data you read from it will not include ... | What are the implications of setting the baud rate of a terminal from userspace? |
1,533,306,304,000 |
I try to use a bash script to watch the serial-port for a specific string. If this string is shown, some commands should be send back to the connected device. It´s a router I am connected to. It is a router I am connected to and I want to send the commands, after the uboot-menu has appeared.
When using minicom with a ... |
echo -n "1" >&5 did the trick for me. Seems like uboot doesn´t want to get a newline, otherwise it behaves weird.
Thanks a lot for your help!
Here is the "complete" script, maybe it is helpful for someone.
#!/bin/bash
tty=/dev/ttyUSB0
exec 4<$tty 5>$tty
stty -F $tty 115200 -brkint -icrnl -imaxbel iutf8 -isig -icanon ... | Bash script - Watch serial-port for specific string, then send back commands |
1,533,306,304,000 |
Using an oscilloscope and toggling some pins I sometimes see latencies of 1-2 seconds from when an 8-byte UART packet is transmitted to when a blocking read returns. The packets are 1 second part with a few milliseconds of jitter. I also measured timing to the system calls (see below) using strace and the results agre... |
strace is not likely to give you the necessary level of detail; you will probably need SystemTap, sysdig, or similar kernel-level debugging to better show when what is happening. For example with SystemTap installed and all the necessary debuginfo and setup details taken care of one could start with:
probe begin
{
... | How can I determine if a latency is due to a driver or the scheduler? |
1,533,306,304,000 |
When I write programs for my own FPGA, I must select UART to emulate a terminal and for my FPGA design but I don't know exactly what that means.
I believe that UART is a basic serial transmission protocol, isn't it? And is that the protocol between the program and the terminal and therefore I must choose UART from my... |
A UART (Universal Asynchronous Receiver Transmitter) is not a protocol, it's a piece of hardware capable of receiving and transmitting data over a serial interface. I presume you are selecting some design block for your FPGA design implementing an UART.
| What is the relation between UART and the tty? |
1,533,306,304,000 |
What does PS in ttyPS* stands for?
Where, in general, can I find the expanded names of devices under /dev?
|
NOTE: This answer is assuming Linux
Where, in general, can I find the expanded names of devices under /dev?
The devices have no "expanded names", but
udevadm info -a /dev/ttyPSx
will tell you a lot of interesting info about them.
If you don't have udev, you can get the type, major and minor of the device, look it ... | What does PS in ttyPS* stands for? |
1,533,306,304,000 |
previously thank you for watching this post.
I have tried to run linux on odroidxu4 and of course the logs are written through uart2 (this uart seems default in odroidxu4)
But what I'm trying to do is changing the linux to write the logs with uart0 not the uart2.
I tried to change the default uart port from 2 to 0 by ... |
Concerning the output from Linux (and not your bootloader, i.e. U-Boot or possible something before that), you would simply change the console= command line parameter, see http://elinux.org/Serial_console and https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt.
| odroidxu4 changing default uart2 to uart0 |
1,533,306,304,000 |
I have a sama5d36 device running Debian jessie (kernel 4.1.10) with a DMA USART. To get the DMA USART to output correctly I had to turn off ECHO and ONLCR.
stty -F /dev/ttyS2 -echo -onlcr speed 115200
If I do a test where I send a bunch of bytes, I will receive 2048 bytes and then it stops receiving until I restart.... |
Upgrade your kernel to a newer kernel. There were issues with this driver in the earlier kernels.
| serial DMA pausing after 2048 bytes |
1,533,306,304,000 |
I have a motherboard (AIMB-218) with an M2 E key slot and according to the documentation of the said motherboard the M2 slot supports UART.
I am trying to use a wireless module (Wi-Fi + Bluetooth), which has a UART interface for controlling the Bluetooth adapter. Its documentation says that the Wi-Fi interface works u... |
In order to make use of the M.2's UART interface, this interface needs to be implemented on the motherboard's M.2 slot.
According to the Wikipedia article the M.2 E key slot supports the following interfaces:
2 of PCIe ×1, USB 2.0, I2C, SDIO, UART, PCM and CNVi
So, the UART interface will work as long as it is imple... | How to make use of an M2 PCIe card UART interface? |
1,533,306,304,000 |
My problem is my linux is success for boot but there is no more boot message output to uart(ttyPS0) after "Starting kernel...".
As you can see in the pic, there is a lot of boot message in dmesg but they are not showing when linux was booting.
The bootargs is passed by uEnv.txt:
bootcmd=run adi_sdboot
adi_sdboot=echo... |
Find the answer in Xilinx forum.
It is indeed a problem with the console.
https://forums.xilinx.com/t5/Embedded-Linux/quot-Warning-unable-to-open-an-initial-console-quot-Under/m-p/1117002
It seems that its kernel code has not been fully updated, which makes some new parameters not fully set.
| The linux boot message in dmesg doesn't output to uart |
1,533,306,304,000 |
I'm trying to set up a USART serial port on a custom board with a SAMA5D36 processor, but I am unable to read in data from a connected device. When I run setserial -g /dev/ttyS1 I get the following output:
/dev/ttyS1, UART: undefined, Port: 0x0000, IRQ: 22
Now, I have seen a similar question (linked here), but the sol... |
Solved my problem, so I thought I'd share. It turned out that TX/RX were flipped in the schematic for the PCB, and I didn't figure this out until I checked the data sheet for the processor.
So, USART vs. UART is a non-issue, and setserial -g /dev/ttyS1 returning undefined was an irrelevant distraction. Thus, to solve ... | Linux USART Serial Port |
1,385,466,067,000 |
the few last days I am getting this exception when running unison:
"End_of_file exception raised in loading archive" (this indicates a bug!)
it does not help a bit, I cannot find answer elsewhere on google, ppl talk about it but seem not be able to solve?
I checked my files, there are broken symlinks but that never wa... |
This error can be caused by unison upgrade or corrupted file. Removing the archives from ~/.unison should help in this case.
(If you have created preferences files, e.g. ~/.unison/myjob.prf, obviously don't delete those.)
However, it might be necessary to synchronize the contents manually before the first run (if ther... | unison "end of file exception" |
1,385,466,067,000 |
For over a decade now I have been working in a full Debian environment in my small office (currently 1 server, 7 users, 3 desktops, 4 laptops). Authentication is based on Kerberos, user profiles are managed in LDAP, and $HOME is served to all of the clients over NFSv4 with the help of pam_mount or autofs. This setup i... |
As @marcus-müller pointed out, this functionality is broadly referenced as 'roaming user profiles', and it is primarily built around two pillars:
User credentials
User $HOME directories
The first one is commonly addressed with centralized systems such as LDAP+Kerberos and with SSSD on the client.
The second one can ... | Centralized $HOME for roaming devices - sync instead of NFS? |
1,385,466,067,000 |
I have two machines. One with unison v. 2.40 (Debian Jessie) and a new one (Debian Stretch) where I installed package unison-all, which brought in unison versions 2.32, 2.40 and 2.48. However, I was unable to make my 2.40 work against the new machine, since it only presented v. 2.48. No matter what I do, I get:
expect... |
I just ran into this problem myself, and it took quite a bit of searching to find the answer! So here it is, and it works for me.
To use multiple versions of unison, install unison-all. Then...
Using multiple versions of Unison on the client
Choose a specific version to run by appending the version number, like so:
un... | How to use multiple versions of unison on one system? |
1,385,466,067,000 |
When trying to sync two paths (one of which is remote) via ssh, unison fails with
Fatal error: Internal error: New archives are not identical.
while syncing via a network mount works just fine.
While unison -debug all yields no indication on the possible error, having it use ssh -v causes a lot of
channel 0: bad ex... |
As hinted at by this macports.org ticket, the problem lies in having used two different major versions of OCaml (3.12 vs 4.0) in compilation on the two machines. Either use the same binary on both machines or (as was the case for me due to different architectures) recompile unison with identical OCaml versions.
(Side ... | How to fix unison failing with "Fatal error: Internal error: New archives are not identical" for identical paths? |
1,385,466,067,000 |
I have two machines that one runs Ubuntu 18.04 and the other one Ubuntu 20.04. I want to use Unison to sync files between them but there are some issues. Firstly, because I sync with another machine too, I compiled from source Unison 2.48.3. Then in the Ubuntu 18.04, I installed from the Ubuntu software Unison 2.48.4 ... |
You're mixing Unison versions 2.48.3 and 2.48.4. Unison is very finicky about this since the developer changes the format of the Unison archive files even between minor versions. Anyways, the versions of Unison should match between all your machines. I would skip the app store, and compile/install 2.48.3 manually on y... | Unison and version/compiler conflicts |
1,385,466,067,000 |
I'm trying to sync a folder in my host OSX to a VM running Ubuntu. (laravel/homestead). This is the command I run on my host:
$ unison ssh://[email protected]//home/vagrant/www ~/unison/www -repeat watch
which produces the following output
Contacting server...
Connected [...]
Looking for changes
Waiting for changes ... |
When you compile Unison from source, there is a separate executable unison-fsmonitor that is created. When you run this unison-fsmonitor it prints VERSION 1 and then waits as expected. Just compile Unison on your VM and use that executable instead of the fsmonitor.py script.
You can see in the change-log for Unison 2.... | Running `unison -repeat watch` yields filesystem watcher error |
1,385,466,067,000 |
I have two machines, one Debian, one Ubuntu, both on ext4 with extended file attributes enabled in fstab. getfattr and setfattr are installed and work perfectly on both machines locally. However, unison (version 2.40.102) doesn't sync extended file attributes by default.
I googled around and found this blog post with ... |
In case anyone runs into the same issue as I did in the future - unison doesn't work with extended file attributes. One way to go around it is the copyprog + copythreshold=0 hack (see the profile in the original question), but this doesn't solve the problem of unison not noticing changes in xattr's. As I mentioned in ... | Unison and extended file attributes |
1,385,466,067,000 |
I have a setup in which I sync files between two Linux servers using Unison over an SSH connection. This is implemented by running the following command via cron:
unison -auto -batch PROFILE
Changes to the fileset happen almost exclusively on one side (the other system is an off-site replica). They mostly take place ... |
Reasons I am running Unison as a cron job rather than with -repeat (presumably as a systemd service)
I would actually suggest that systemd is a perfect fit for when you want "cron but single instance". You don't need to keep it as a long-running service - you can use systemd timers in a cron-like manner while taking... | Unison via cron, how to deal with one job still running as the next one starts |
1,385,466,067,000 |
I am trying to sync data between an Ubuntu instance and a CentOS 7 instance. It's like a bi-directional rsync so I thought unison would be the best tool. I installed it on both instances but when I tried to connect them I received an error because the versions are different:
unison -testServer . ssh://myuser@myremoteh... |
Per @Freddy's comment, the key is to compile unison from source on CentOS:
yum install ocaml ocaml-camlp4-devel ctags ctags-etags
cd ~
wget http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.48.4.tar.gz
tar xvfz unison-2.48.4.tar.gz
cd src
make
sudo cp -v unison /usr/local/sbin/
sudo cp -v... | How do I run unison between Ubuntu and CentOS 7 |
1,385,466,067,000 |
I am trying to perform a sync using Unison (2.40.102) where I want to ignore all files with a specific extension, say *.ext, but not ignore the files with this extension if they are in a specific subfolder.
Folder structure:
main_dir
|file.ext
|...
|--sub_dir_1
|more_files.ext
|...
|--sub_dir_2
|even_more_fil... |
Use Regex instead of Path when you need to match an arbitrary directory depth.
ignore = Name *.ext
ignorenot = Regex .*/dir_I_want_to_sync/.*\.ext
| Unison: Ignore all files with *.ext, except those in a specific subdirectory |
1,385,466,067,000 |
I want to synchronize my personal document repository between my different computers in my home. Today this folder is under a dedicated partition of the hard drive of a dual boot workstation.
My configuration is the following one:
Dual boot Workstation running Ubuntu 11 and windows Xp (the documents are simply shared... |
If you're always synchronizing in the same direction, use rsync. If you're synchronizing in both directions, use unison. Unison supports both Linux and windows; the documentation explains how to set it up under Windows (you'll need an SSH client as well).
To synchronize between more than two locations, choose one as t... | Backup and synchronization |
1,385,466,067,000 |
I am trying to set up Unison and am testing the connection. I run this command from the documentation:
unison /var/www ssh://192.168.1.102//var/www
but it tries to log into the remote server using my local machine's username. I've tried several things, but nothing works. I've tried adding username@ssh... and also sea... |
You could create a config file for ssh(~/.ssh/config) with the content
Host UnisonHost
HostName 192.168.1.102
User username
and then call unison with UnisonHost:
unison /var/www ssh://UnisonHost/var/www
| Unison - login over ssh with different username at remote server |
1,385,466,067,000 |
I'm using Unison to synchronize my music collection to a few different sources, namely a couple computers over SSH and a hard drive.
One thing I've noticed is that SSH updates are incredibly fast in comparison to hard drive syncs, possibly because rsync (or whatever's running under the hood) is only moving what's cha... |
copythreshold = 1024
Then unison changes files bigger than 1Mb in place using rsync instead of completely re-transferring.
| Decreasing hard drive sync time with Unison |
1,385,466,067,000 |
unison is a very useful tool to synchronize filesystems, for instance between different machines. It detects conflicts and asks the user about them before actually copying anything (user then decides which version of the file to copy into the other, or whether to ignore changes for the conflicting file altogether).
I... |
There's the preference times, give it a try. The doc mentions modification time, but doesn't say anything about creation time, so you'll have to test the exact behaviour, which may also depend on the filesystem type.
| Can unison be made to preserve file creation dates? |
1,385,466,067,000 |
I have a handful of devices, and am considering keeping them in sync with Unison.
The devices are not running all the time, they are switched off a few hours per day, not necessarily at the same time. None of the devices is running 24 hours a day. So I need real peer-to-peer, for instance see how a change (marked as *... |
I have always used Unison in a star topology to synchronise my four machines. The reason for this is that it is not a versioning file system (like git for example), but rather a synchronisation tool.
If you do opt for a distributed topology (which you will have to set by creating a configuration file for each device a... | How to configure Unison for real peer-to-peer? |
1,385,466,067,000 |
Following instructions in How to use multiple versions of unison on one system? I have used
unison -addversionno
to sync a Debian and Raspbian system, but received this error
Contacting server...
Fatal error: Received unexpected header from the server:
expected "Unison 2.48\n" but received "bash: unison-2.48: comman... |
As it turned out in the discussion regarding the bug report -addversionno currently truncates the version info at the minor number.
I had installed
unison-2.48.3
at the server and client (by copying the binary), but -addversionno was looking for
unison-2.48
which did not exist.
As a workaround I created the symbolic... | unison -addversionno Received unexpected header from the server |
1,385,466,067,000 |
If I modify a local file, unison syncs that file but it removes all permissions on the destination server, leaving only the following permissions:
-rw-------
My local config contains the switches which should tell unison to ignore file permissions:
~/.unison/my-server.prf
perms = 0
dontchmod = true
I start unison wi... |
Somehow, this issue went away. I'm not sure which of the following fixed it, but here's what I did:
Deleted my local replica and the archive files under ~/.unison
Uninstalled then reinstalled unison locally (the same version, 2.48.4)
Added force = ssh://username@my-remote-server//home to the config to mirror the remo... | Unison is ignoring local config and overriding remote file permissions |
1,385,466,067,000 |
It's been many hours reading and reading everywhwere.. testing rsync, Grsync, and Unison.. with no hope!
The normal way of rsync copying/synchronizing files between two local folders is to "copy the whole folder itself! - not the contents as thought! - nothing else!
To experiment with, I made two folders with differen... |
If I understand your intention correctly, all you need to do is to append a trailing slash to your first argument of rsync. That is, instead of writing
rsync -zrahvWt --remove-source-files ~/Documents/test3/source-DRV ~/Documents/test3/dest-T
write
rsync -zrahvWt --remove-source-files ~/Documents/test3/source-DRV/ ~/... | How to move missing files only from source to target folder |
1,385,466,067,000 |
Recently my Unison started throwing up some strange error whenever I tried to sync between my laptop and my PC. I realized that I had added a line in bashrc that would print my pending tasks whenever I would open a terminal.
The line added in my bashrc:
task list #this command comes from a small utility called task... |
You can test if the output of the script (i.e. rc file) is a terminal if not; if it is it should be safe to output text, and if not a terminal don't output anything:
if [ -t 0 ]; then
# check your jobs here and print any info you want to see
fi
| Separate bashrc file for ssh sessions to avoid Unison Errors |
1,385,466,067,000 |
I have a small Debian ARM box with unison-2.40 installed. And a Ubuntu laptop which seems to have unison-2.48
I want to sync them with unison. But the the Ubuntu (which is newer) doesn't seem to recognise being explicitly asked to work with 2.40 (using -addversionno )
Is it possible to persuade 2.48 to pretend to be ... |
No, you can't tell the newer version of Unison to pretend to be an old version. This is a notorious feature of Unison; the format of the archive file (that keeps track of everything being synced to improve efficiency) gets changed improved in each new version. So Unison versions across machines have to match precisely... | Syncing between machines with different versions of Unison |
1,385,466,067,000 |
I have just rebuilt my file server after it suffered disk corruption. When I tried to re-sync data using Unison, I got the error message
Lost connection with the server
I retried from the command line and got:
~$ unison someprofile -ui text
Contacting server...
Unison failed: Fatal error: Error in creating unison di... |
Lost connection with the server does not necessarily mean a network issue – it can also mean that the remote Unison instance terminated the connection for whatever reason. (Because Unison is designed to work with different SSH backends, there is no reliable way to get any more detail about why the connection ended.)
S... | Unison over SSH, connection with server lost although SSH works |
1,385,466,067,000 |
I need to sync 3 computers between each other in same way as Dropbox does e.g. if file changed on one pc others reflect this change as well. So i have choosen Unison. And found that it works perfect for 2 computers and how about 3 or more ? I tried to specify 3 roots in confg file but it does not work in such way and ... |
The software itself can only sync 2 folders/computers.
So what the documentation tells you is to setup so that one computer is in the center and every other syncs to it.
computer1 <--2way sync --> hub_computer <--2way sync --> computer2
^
|
... | Sync muliple PCs with Unison |
1,385,466,067,000 |
I have a desktop at home, and a laptop that I take with me to places away from home, both have Fedora 20 installed. I edit the same files on either machine, and would like to be able to synchronise these files over the Internet to keep them identical, and avoid the error prone task of trying to repeat the same edits o... |
user@host is how SSH defines who it attempts to authenticate as (user) and where it should do that (host)
The user
This can be any local user account on the desktop and/or laptop you are connecting to. This user will need to be able to login to that machine via ssh and have full permissions to all the directories you ... | How do I get the information I need in order to use unison and ssh to synchronise files |
1,385,466,067,000 |
I'm using Unison to synchronize my home across several computers, and I've addressed everything but this.
The Dropbox configuration is partially skipped, and as a result Dropbox thinks there is no configuration and goes through the configuration wizard again.
Here's the output from Unison related to dropbox:
Reconcil... |
As of Unison 2.40 (the latest version as I write), Unison doesn't support any file that isn't a regular file, a directory, or a symbolic link. Prior versions aborted the transfer upon encountering special files; since 2.40 these files are ignored. In 2.40.65, you don't get to see the name of ignored files in the first... | Unison can't synchronize Dropbox configuration (socket files) |
1,385,466,067,000 |
I have a file server running Raspbian and a workstation running Ubuntu MATE 16.04. I use Unison to keep my home directory in sync. I’ve set it up to use a SSH connection.
The workstation runs Unison 2.48; the server has multiple versions (including 2.48). I’ve successfully propagated a couple of changes from the works... |
Generally, “lost connection with the server” indicates that either the remote Unison process OR ssh exited with an error. (Since Unison needs to be compatible with different SSH implementations, getting more granular information out of it would be very complex to implement.)
Current versions of Unison (since at least ... | Connection with server lost when using Unison over SSH |
1,385,466,067,000 |
I'd like to use Unison to sync a directory between my desktop computer and a container that lives in the cloud. I have this kind of working with Unison, but the problem I'm seeing is that every time I spin up the container, it can have a different hostname and IP number, and sshd will be running on a different port nu... |
I've determined an answer to my question, but it's a bit of a pain.
First, I changed the entry in my local ~/.ssh/config file so that it looks like this:
Host pod
User root
SetEnv UNISONLOCALHOSTNAME=pod
Hostname 184.26.5.182
Port 10666
That's very easy, of course. But this won't work, however, unless ssh... | Using Unison to sync my desktop computer with a container in the cloud |
1,385,466,067,000 |
I have a file server running Raspbian 9, and use Unison over SSH to sync my home dir between these two.
This has worked well for the two years I was on Ubuntu 18.04, but after upgrading to Ubuntu 20.04, syncing over SSH aborts with an unmarshaling error, claiming the two Unison versions (local and remote) were built w... |
Cause
Using Unison over the network greatly speeds up synchronization across the network (as files are scanned for changes locally rather than over the network), but it requires matching Unison versions on both ends. As Unison relies on some OCaml libraries to do the synchronization, and as these libraries are apparen... | Unison with Raspbian file server no longer works after upgrading my laptop to Ubuntu 20.04 |
1,385,466,067,000 |
On my raspberry pi computers:
pi@mizu:~ $ unison -version
unison version 2.40.102
On my desktop ubuntu 16.04 xenial:
kayd@Trunk:~$ unison -version
unison version 2.48.3
When trying to synchronize:
kayd@Trunk:~$ unison . ssh://pi@mizu/.
...
Fatal error: Received unexpected header from the server:
expected "Unison 2.... |
Yeah, the versions of Unison that you are running have to be identical. This is because the format for the archive file that Unison uses to keep track of stuff is improved changed in each new version.
Why not just install Unison from source? I would recommend installing 2.48 on your raspberry. You can download the so... | How to install Unison 2.40 on Ubuntu 16.04 xenial (to resolve "Fatal error: Received unexpected header") |
1,492,722,446,000 |
I have a USB audio device, configured as the default device at card 0.
I have a 3rd party application that is attempting to play wav files, which fail with the following:
Playing WAVE 'sound.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
aplay: set_params:1239: Channels count non available
If I try to manual... |
Backup your ~/.asoundrc - if you have one - and add the following, to a new ~/.asoundrc:
pcm.!default {
type plug
slave {
pcm "hw:0,0"
}
}
| ALSA set plughw as default |
1,492,722,446,000 |
On my RasPi board, Debian Linux, the USB microphone occasionally gets locked up such that nothing can use it. The microphone has a LED which is usually flashing, when it's locked, it turns off.
The utility arecord describes it as follows:
card 1: Device [DYNEX USB MIC Device], device 0:USB Audio [USB Audio]
Subdev... |
This is easy to solve.
Issue: Your microphone is not getting enough power. The Raspberry Pi USB ports have issues supplying enough amps to USB devices that need more than power than USB memory cards.
Solution: Get an active USB hub (powered hub plugged into a power source like an outlet.) The hub will power the microp... | RasPi - USB microphone locks up |
1,492,722,446,000 |
I have hardware to interact with that uses USB. It is a USB sound card The configuration file requires something like this:
devstr=1-1.3.1:1.0
lsusb looks like this:
Bus 001 Device 004: ID 0d8c:0012 C-Media Electronics, Inc.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adap... |
1) USB audio devices are handled by the ALSA kernel drivers, and those react automatically to the vendor:product identifier of the USB device (or the generic interface). None of the drivers you'd normally use would use a devstr. You don't say why you need this string, but you are probably doing it wrong.
2) The exampl... | Figuring out USB devices |
1,492,722,446,000 |
I have a USB microphone that works fine, up until I reboot my system. After that, it doesn't work at all until I unplug it and replug it. Based on my (limited) understanding of the components involved, I think that ALSA isn't detecting the mic on boot (possibly because the appropriate module hasn't been loaded during... |
Well, I've got an answer to #2, found over at the Ubuntu stack exchange:
sudo sh -c "echo 0 > /sys/bus/usb/devices/<devId>/authorized"
sudo sh -c "echo 1 > /sys/bus/usb/devices/<devId>/authorized"
where devId can be figured out (in my case, since I'll always know the exact expected product name) by inspecting /sys/bu... | Alsa not detecting USB microphone on system boot |
1,492,722,446,000 |
After changing my desktop from Arch Linux to NixOS, playing HTML5 videos in Firefox has become buggy. They will fast forward when you play them, but only when using the USB audio adapter. Pulseaudio is used and ALSA is configured to use pulseaudio as well. A few solutions I found stated that I had to install pavucontr... |
Fortunately it had nothing to do with the error about the GVC mixer, because I could not find any information on that problem except the source code itself. Eventually I stumbled upon this issue on GitHub that states the same problem. It had to do with Alsa having bad support for USB audio devices and PulseAudio not b... | USB audio adapter causes HTML5 videos in Firefox to fast forward |
1,492,722,446,000 |
I am currently developing a usb soundcard that is usb audio class 2 compliant.
In my current setup I have audio and mute controls for several channels working in alsamixer.
The USB audio class 2 spec also supports a lot of other controls such as bass, mid, treble, equalizers, effects, etc. I have been trying to find a... |
There is no such
list of supported controls
since… whatever control element appropriately exposed by the device can be taken into account by amixer, v.g listed by the amixer scontrols command and accessible on the graphical interface via some button, slider or list according to its type (BOOLEAN, INTEGER or ENUM res... | alsamixer / amixer supported usb audio class 2 controls |
1,492,722,446,000 |
So my onboard sound-card died and I bought a new small usb one.
With windows it works perfectly, but on my debian testing not so much.
It isn't detected by my audio system, and I cannot choose the device in the alsamixer application.
Which component of my system handles the soundcard-detection and where should I look ... |
After I blacklisted snd-hda-intel and rebooted everything worked perfectly out of the box.
| Alsa not detecting my soundcard |
1,492,722,446,000 |
The details of my setup are as follows:
Built-in Intel HD card (card0), to which all my existing applications use by default. Generally stereo output going out to the card from stereo files and streaming applications.
I've now added a USB sound card (card1: xCORE-200, from XMOS) and have a non-standard array of 8 outp... |
This is possible with the ttable option of the route plugin, which is also integrated in the plug plugin:
pcm.MyLittleDevice {
type plug
slave {
pcm "hw:1"
channels 16
}
ttable [
[ 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 ]
[ 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 ]
]
}
To reduce t... | How do I use ALSA or PulseAudio to remap stereo source to an 8-channel PCM and lower the volume? |
1,492,722,446,000 |
I'm trying to play an mp3 file on a Raspberry PI via USB Audio (iLuv Compact Speakers) and mpg321.
For some reason, it's playing the audio just a little bit too fast, and at a higher pitch than it should be.
If I play the audio through the headphone jack of the Raspberry PI instead, it plays the audio regularly.
How c... |
Option 1: Use madplay to play the mp3 instead (sudo apt-get install madplay)
In this case, it seems my USB Audio would only play audio at 48KHz, whereas the mp3s I was trying to play were actually at 44.1KHz
It seems that mpg321 would try to play the audio at 44.1KHz anyways even though my USB Audio didn't support it,... | mpg321 playing too fast, at high pitch, via USB Audio |
1,492,722,446,000 |
The question itself may not be very explanatory. Let me try and clarify it a bit.
I'm running Pop!_OS 20.04 LTS on a PC. I'm also using a pair of Wireless USB headphones (Razer Nari) with two outputs.
What I am trying to achieve is to have STEREO output for my headphones. There are 2 outputs (one for 'gaming' and one ... |
I found this on Github, a set of pulseaudio profiles which might make it work.
However, whilst stereo output was relatively easy to achieve for me, the mic didn't work for me at first
(loopback with the nari hardware wheel works, muting via nari / audiomixer but audiolevels always stay at 0, mint [email protected], pu... | How to make pulseaudio recognize my usb headphones as stereo instead of mono? |
1,492,722,446,000 |
I'm on a system with Linux Kernel v5.10.4, and facing an issue where during audio playback through ALSA (aplay). The kernel spams the following log for the duration of the playback and no audio is heard:
xhci-hcd f2500000.usb3: WARN Event TRB for slot 3 ep 1 with no TDs queued?
xhci-hcd f2500000.usb3: WARN Event TRB f... |
Have you tried changing the sample rate of the file you're playing?
| USB Host controller: xhci-hcd Event TRB with no TDs queued spam during audio playback |
1,492,722,446,000 |
So following some suggestions, I tried:
$ aplay -l | grep card
card 0: PCH [HDA Intel PCH], device 0: CX20724 Analog [CX20724 Analog]
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
card 1: ml1 [sonible ml:1], device 0: USB Audio [USB Audio]
The last devic... |
I could not find a way to make that device appear. But there is a fallback solution: Sending PA through Jack:
pactl load-module module-jack-sink channels=2
pactl load-module module-jack-source channels=2
Then run Jack, e.g. QJackCtl, and you then set, for example in VLC, the pulse audio output device to 'Jack sink'.
| Debian/Gnome: Cannot use USB audio device in Pulse Audio |
1,492,722,446,000 |
I wish to convert the encoder of some audio files. The problem is that my car can't reproduce audio files encoded with LAME3.99.5; it's an issue with some Volvo cars. The problem is with USB and CD.
The encoder needs to be LAME3.95 or less, or another encoder. What command should I use to achieve this? I would like to... |
Are you aware of the standalone "lame", which you can choose version to download:
https://sourceforge.net/projects/lame/files/lame/3.95/
... but then you need to compile it ;-p
$ uname -a
... 20.04.1-Ubuntu ... x86_64 GNU/Linux
$ tar -xvf lame-3.95.tar.gz
$ cd lame-3.95/
$ ./configure 2>&1 > log.txt
$ make all 2>&1 >... | Convert encode of audio files |
1,492,722,446,000 |
I got an M-track 8 audio device (8 I/Os). It works fine for playback. However, the microphone (48 volt XLR mics) barely make any sound. When recording, they cap out at 15% volume in any application.
According to the mixer spectrum analyser, they are working totally fine.
If I redirect the m-track input to the analog ... |
I don't see anything obvious, but two ideas:
The USB device has two configurations, though from the information displayed about them, they seem to be identical. So I do not know what they are for. You could try to switch to the other one (with usb_modeswitch, unload kernel modules first) and see if that changes anyth... | My USB audio input channels max_out/clips at ~15% |
1,492,722,446,000 |
I have a monitor with 2 USB ports that I connect through HDMI to my laptop. How do I make a USB sound card work with those ports? My system is Ubuntu 14.04.
|
The USB ports found on computer monitors are usually those of a
built-in USB hub: you would have to connect the monitor's hub to your
computer using a USB cable for it to work. Then any device, sound card
or anything else, should work as if it were connected directly to the
computer.
| How to use usb ports on a monitor for sound [closed] |
1,355,075,428,000 |
Let's assume I have a file named confirmation.sh with the following content:
#!/bin/bash
echo -n "Are you sure [Y/n]? "
read line
case "$line" in
n|N) echo "smth"
;;
y|Y) echo "smth"
;;
esac
and I want to run this script in the following way:
cat confirmation.sh | sh
I see Are you sure [Y/n]?... |
As others have said, this is because the stdin of sh has been redirected to read from the pipe, it is not connected to the terminal as it would normally be. One thing you can do to get around this is to use /dev/tty to force the script to read from the terminal. Eg:
#!/bin/sh
read -p "Are you sure [Y/n]?" line </dev/... | How to read user input from a pipe? |
1,355,075,428,000 |
For class I need to write a Bash script that will take the output from ispell and when I try and request user input inside the while loop it just saves the next line of the file as the user input.
How could I go about requesting user input in the while loop?
#!/bin/bash
#Returns the misspelled words
#ispell -l < file
... |
You can't do that in your while. You need to use another file descriptor
Try the following version :
#!/bin/bash
#Returns the misspelled words
#ispell -l < file
#define vars
ISPELL_OUTPUT_FILE="output.tmp";
INPUT_FILE=$1
ispell -l < $INPUT_FILE > $ISPELL_OUTPUT_FILE;
#echo a new line for give space between command... | Requesting user input while reading file line by line |
1,355,075,428,000 |
This script takes the user input line after line, and executes myfunction on every line
#!/bin/bash
SENTENCE=""
while read word
do
myfunction $word"
done
echo $SENTENCE
To stop the input, the user has to press [ENTER] and then Ctrl+D.
How can I rebuild my script to end only with Ctrl+D and process the line wher... |
To do that, you'd have to read character by character, not line by line.
Why? The shell very likely uses the standard C library function read()
to read the data that the user is typing in, and that function returns
the number of bytes actually read. If it returns zero, that means it has
encountered EOF (see the read(2... | How to read the user input line by line until Ctrl+D and include the line where Ctrl+D was typed |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.