Just a small article to explain how to fix the annoying "cracking music" that I had when I was playing 5.1 albums on my RPi.
At first I though it was a resampling issue (converting from 44100Hz to 48000 or 96000Hz or vice-versa) or a bug in Alsa. but it turn out that you have to configure your HDMI output to a 7.1 configuration (8.1), I found the solution on this forum.
So here is my \etc\asound.rc
file:
pcm.device{
type hw
card 0
device 0
}
pcm.!surround51 {
type route
slave.pcm "device"
slave.channels 8
ttable {
0.0 1
1.1 1
2.4 1.8
3.5 1.1
4.3 1.8
5.0 0.5
5.1 0.5
6.6 0
7.7 0
}
}
Here I reroute also my channels differently and I have specific volume level for some of them. My speakers are positioned at different places in my room, so I had to adjust that. Feel free to customize it regarding your own configuration.
As you can see the speaker 6 and 7 are muted. It's a 7.1 setup but behaving like a 5.1. The LFE channel is send to my two main column speakers that can do low frequencies. If you have a subwoofer you can route the channel 5 directly to it.
I also added another virtual device to upmix stereo output to all my speakers:
pcm.20to51 {
type route
slave.pcm surround51
slave.channels 6
ttable.0.0 1
ttable.1.1 1
ttable.0.2 1
ttable.1.3 1
ttable.0.4 0.5
ttable.1.4 0.5
ttable.0.5 0.5
ttable.1.5 0.5
}
And in MPD I added two new output, one for the direct 5.1 configuration, one for the stereo to 5.1 virtual device:
audio_output {
type "alsa"
name "Ampli 5.1"
device "surround51"
format "96000:24:6"
auto_resample "no"
}
audio_output {
type "alsa"
name "Ampli Stereo to Surround"
device "20to51"
format "96000:24:2"
auto_resample "no"
}
I set the bitrate and sampling to 24bit and 96000 to prevent some downsampling (I have some high quality audio albums in 96Khz/24bit FLAC format).
That's all folks !
#raspberrypi #rpi #music #mpd #alsa #surround #stereo
I bought a DHT22 #sensors to measure #temperature and #humidity in my house. You can find it in France on the Compozan website for a few euros.
Here are the steps that I followed to connect and install properly the sensors on my RPi B 2+.
The #DHT22 sensors have 3 wires that can be connected to the GPIO board of your RPi. For mine the pinout looks like this:
First turn-off your RPi and proceed with the connection.
I already had an IR sensors connected so I picked 3 others ground/3.3v and GPIO pins on the board. For me it was the pins 17, 15 (so GPIO 22) and 14 but you can pick any configurations you want if you respect the type of connectors.
Raspbian, the Linux operating system that I am using only have kernel module for the DHT11 sensors but hopefully I was able to find a working module on Github: krepost/dht22.
Clone the repository and build the module:
git clone https://github.com/krepost/dht22.git
cd dht22
make
You will then have a dht22.ko
binary that you will have to install and load properly.
To install the module for your kernel, copy the .ko
file in your current kernel module directory:
cp dht22.ko cd /lib/modules/$(uname -r)/
Then run depmod
to put it in the kernel modules list:
depmod -a
To tell the Linux kernel how to find the DHT22 sensors on the GPIO board we need to add a small option when loading the module. To do so create a specific configuration file for it in /etc/modprobe.d
(you can give any name to it, I choose to name it simply using the module name).
nano /etc/modprobe.d/dht22.conf
And in the file just specifiy the GPIO pin where the signal is received:
options dht22 gpiopin=22
I am using systemd
so I am loading the modules using the /etc/modules-load.d/modules.conf
file.
Just add a new line with the module name in it.
dht22
Save the file and reboot your RPi.
For now only root
can read the values available in /dev/dht22
.
To allow any users to have access to it you can use the 99-dht22.rules
files available in the GIT repository with the following content.
# udev rules file for dht22 device driver; to be put in /etc/udev/rules.d/.
SUBSYSTEM=="dht22", KERNEL=="dht22", MODE="0444"
Then reboot your #RaspberryPi.
🍓pi@edhelas-pi:~$ cat /dev/dht22
1690720540,46.6,26.4
First value is the timestamp, second is the humidity in percentage, last one is the temperature in Celsius.
Et voilà !
The small Munin plugin that I wrote to track the two values during time
$ cat /etc/munin/plugins/weather
#!/bin/sh
case $1 in
config)
cat <<'EOM'
graph_title Weather
graph_vlabel weather
graph_category weather
graph_args --lower-limit -10
graph_args --upper-limit 100
graph_scale no
temperature.label temperature
humidity.label humidity
EOM
exit 0;;
esac
lines=$(sed 's/,/\n/g' /dev/dht22)
printf "temperature.value "
echo "$lines" | sed -n 3p
printf "humidity.value "
echo "$lines" | sed -n 2p
Un très bon article du sociologue Rémi Boura, Docteur en sociologie, Université Paris Dauphine – PSL
#neolibarism #politique #parlement #assemblée #démocratie
All the #Movim tools behind Join Movim are developed using Laravel. To add those new feature I had to upgrade from Laravel 7 to 10, it only took me ~30min to do so. The rest of the features were developed in a few hours.
Movim is running on a totally custom framework but also reuse some #Laravel pieces such as Eloquent, the Laravel ORM and the ReactPHP suite.
Laravel is an awesome framework, light and opinionated (you have often only one way of solving something which keeps things simple). If you are looking for a cool base to build your website just try it out, I'm sure you'll love it 😊
I'm currently working on rebuilding the #Movim API #tools to prepare the launch of what will be the upcoming Movim Network.
First step will be to have a page where Movim admins will be able to #register their server to help with discoverability, the same way as joinmastodon.
Let's see where this goes 😁
Just a small script that I wrote to convert directories of #RAW pictures in #JPEG. It might help some of you folks, who knows.
This script is simplifying my flow. I am shooting everything in RAW and importing all the pictures to my Photos directory using #Gthumb. Once all the #photos are imported I pick which directory I want to keep in RAW and run this script in the other ones.
#!/bin/bash
echo "Convert $1 directory"
exiftool -b -PreviewImage -orientation -w .jpg -ext cr2 -r "$1"
echo "Copy EXIF"
cd "$1"
for file in *.CR2; do
exiftool -tagsFromFile "$file" ${file::-4}.jpg
done
echo "Cleaning up"
rm *_original
This script is working in 2 steps.
First it extract the internal JPEG files from the RAW files and put it next to them. As it is only data manipulation it is super fast to run.
Then the second part is re-copying all the #EXIF information from the RAW files to the freshly extracted JPEG files (the first step doesn't take care of the EXIF manipulation).
And finally it cleanup the RAW files.
Oh and for the RAW development, I'm using the awesome #Darktable !
The idea would be to post quick articles with like a photo and/or short video and allow your contacts to see it for like 24h. Yes ? Na ? 🤔 #movim #feature #stories
I'm using it to make most of my illustrations for Movim and at my job !