The goal of efficiency is more slack.

Tuesday, June 01, 2021

Fixing sound on RetroPie after updating and installing Desktop Environment

I started out by imaging retropie-buster-4.7.1-rpi2_3.img.gz onto an SD card for a Raspberry Pi 3 B. Then I updated the software using the menus in EmulationStation. Then I installed the desktop environment, again with the ES menus. What resulted was audio no longer working in EmulationStation and the console emulators. I did a whole bunch of things to troubleshoot, so I'm not sure what actually made it work.

/boot/config:

hdmi_drive=2
hdmi_force_hotplug=1
hdmi_force_edid_audio=1

Install:

sudo apt install pavucontrol pulseaudio-utils
sudo apt-get install lxplug-volumepulse

In the desktop environment, add Volume Control panel to the menu bar.

In EmulationStation, Audio Card: hw, Audio Device: HDMI.

Troubleshooting

Play audio with Alsa:

sudo aplay /usr/share/sounds/alsa/Front_Center.wav

Speaker test:

speaker-test -D sysdefault -t wav

Wednesday, July 08, 2020

ffmpeg write mp3 metadata

To create an mp3 file with some ID3 metadata. This example is to create files corresponding to chapters of an audiobook. Shell script:

#!/bin/sh

# Convert to mp3 with metadata. Use some defaults, pass some parameters.
# Parameters: 1: input file name, 2: chapter/track, 3: start time

ffmpeg -ss $3 -i "$1" -metadata artist="Some artist" -metadata album="An album name" -metadata genre="Books & Spoken" -metadata title=$2 -metadata track=$2 "Chapter $2.mp3"

Note that the first parameter is expected to be passed in in quotes if it has spaces.

Thursday, July 02, 2020

Sunday, June 28, 2020

Friday, June 26, 2020

FileZilla Server on Windows 8 and Xfinity

Purpose: To install FileZilla Server, an FTP server, on Windows 8 on an Xfinity network with an ARRIS TG1682G Gateway.

Note: It's very cumbersome to safely open ports with Xfinity. Next time, I'll just set up a cygwin SSH server so I only have to open one port.

Configure server

Install FileZilla Server

Once installed, to change startup behavior, run services.msc and edit settings for FileZilla Server FTP server.

Add user

Edit > Users > Users > Add
General > Check "Enable account".
Enter Password.
Shared folders > Add, browse to a directory.
Select permissions, e.g.  check all the boxes for full access.
OK

General Settings

Miscellaneous > Check "Start minimized"
Passive mode settings > Check "Use custom port range", input an arbitrary range above 1023, e.g.: 56960-56965
FTP over TLS settings > Check "Enable FTP over TLS support (FTPS)".
Check "Disable plain unencrypted FTP".
Click "Generate new certificate.."
2-Digit country code e.g.: US
Click Browse... and browse for a place to save the certificate.
Click "Generate certificate".
OK

Windows Firewall

Control Panel > Windows Firewall > Allow an app or feature through Windows Firewall
Change settings
Allow another app...
Browse... > Browse to installed location of FileZilla server, e.g. C:\Program Files (x86)\FileZilla Server\FileZilla Server.exe
Check Private, uncheck Public.

Get IP of server

https://duckduckgo.com/ip
Note the IP listed after "Your IP Address is".

Configure Xfinity port forwarding

Xfinity Internet/xFi > Network > Network Devices > Gateway > Advanced Settings or https://internet.xfinity.com/network/gateway.
Near bottom: More > Advanced Settings
Port Forwarding
Add port forwarding
Select the device running the FTP server.
Add TCP/UDP for 21, 990, and the custom port range for Passive mode set above, e.g. 56960-56965.

Configure client

Install FileZilla client.
Site Manager... > New site
Protocol: FTP
Host: input the IP of the server noted above.
Encryption: Use explicit FTP over TLS if available.
Input User and Password configured in server above.
OK (to save)
Site Manager... > Double click the newly added host to try to connect. It will fail to connect because of Xfinity's threat detection.

Allow exceptions on Xfinity

Xfinity's threat detection will block incoming requests on every port you've just opened, so you must allow them here.

Xfinity Internet/xFi > Network > Advanced Security or https://internet.xfinity.com/network/security.
Under the device running the FTP server, you will see 1 or more "threats" detected.
Click "Can't Access This Device?" > Threat History.
For each line with Source IP that matches the client's source IP and time of attempted connection, click Allow Access.
On the client computer, disconnect and reconnect to the server as many times as needed to get all the passive ports listed as a "threat" so you can then click Allow on them.

Note that these access exceptions only last 30 days, so you'll have to repeat them then or when the client's IP changes.

Sunday, October 13, 2019

Installing GStreamer Development for Visual Studio 2019

Install and create template.
  1. Browse to https://gstreamer.freedesktop.org/ > Downloads.
  2. Download and install both MinGW 64-bit runtime installer and development installer.
  3. In Visual Studio 2019, open \gstreamer\1.0\x86_64\share\vs\2010\gst-template\gst-template.vcxproj
  4. Project > Export Template.
 Run example.
  1. Download https://gitlab.freedesktop.org/gstreamer/gst-docs/
  2. Expand tutorials folder.
  3. Open tutorials.sln.
  4. Set solution platform to x64.
  5. Solution Explorer > Solution ''tutorials' > basic-tutorial-1 > Properties
    1. Debugging > Working Directory: $(GSTREAMER_1_0_ROOT_X86_64)\bin
      Note: To get the variable name, in cmd.exe, enter: set gstreamer
    2. Linker > Input > Ignore All Default Libraries > No (or delete setting)
    3. For Debug configuration, Ignore Specific Default Libraries: msvcrtd.lib
      Note: The gstreamer libraries were apparently built with /MD and not /MDd.

Friday, October 11, 2019

Fix route to VM after Cisco VPN removes them

Cisco AnyConnect VPN modifies/removes routes to the bridged network adapter on a VirtualBox VM when you log in. To connect to the VM again, you need to log off the VPN, as the Cisco VPN has a watchdog that reverts any route changes while the VPN is active. After logging off, run this reroute script:

#!/bin/bash

guestip="192.168.58.3"
guestmac="8:0:27:35:55:1d"

# The following 2 deletions are not always needed
# route -n delete ${guestip%.*}.0
# route -n delete $guestip/32

route -n add $guestip/32 -interface vboxnet0
arp -s $guestip $guestmac
netstat -rnf inet | grep 192

Popular Posts

Recent Posts

Unordered List

Text Widget

Pages

Powered by Blogger.
Scroll To Top