2021-12-29

Pulseaudio: Multi-User Setup

Hello and welcome to my blog. If you are finding this page, then you might be in a similar situation I found myself when I wanted to share audio with different apps if they were being used by different user accounts on your local *nix machine when using Pulse audio.

Credits to Eli Billauer and Dhole for the configuration directives I needed to make this possible.

The Problem

I have multiple user accounts on my system that run various apps, like my web browser, chat apps, email and more. I don't like everything running as myself and try to create a user account with just enough privileges to do what it needs to do.

Pulseaudio (herein "Pulse") runs as myself when my desktop environment starts. Apps that run normally need to connect to Pulse in some fashion in order to listen to the microphone or play audio on the speakers. When the apps all run as the logged in user, this works great. When the apps run as someone else, this doesn't work or is inconsistent in behaviour.

The Scenario

I have a user account chrome that is dedicated to the browser /usr/bin/google-chrome-stable. The browser will run as this account instead of myself and has just enough permissions to render on the screen and have basic access to some files on the filesystem (albeit, as the unprivileged account).

How do I make it possible to render sound and grant access to the mic when necessary to chrome?

The Solution

I use local UNIX sockets to allow applications to talk to Pulse and the system behaves. I also discovered you DO NOT need to modify the system configuration files in /etc.

There's a few configuration files and directives that are used and will be laid out here.

Server Configuration

As the user who runs Pulse (e.g. creates the server):

  • Create ~/.pulse if it doesn't exist already.
  • Create and populate ~/.pulse/default.pa with the content as described below in the block of configuration.
    • Please note: Pulse will look for local configurations before global configs and will stop looking for additional files once it finds a match. The configuration is not a layered configuration in that /etc is applied first, then local configuration overrides those values. If a local file is present, it should include all dependencies and global configuration files or else you could end up with a misconfigured setup.
  • Restart Pulse. Can use pulseaudio -k && pulseaudio -D. Please consult your distribution's documentation if the mechanism to start Pulse are different for you.
  • Personally, I had to chmod o-rwx /tmp/pulse-server (aka chmod 770 /tmp/pulse-server) to remove access to the socket outside of me and those part of the audio group I wanted apps to share if they were going to be using audio streams.

Pulse may run as yourself or a dedicated user just for dealing with sound.

~/.pulse/default.pa:


.include /etc/pulse/default.pa

#load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1

### Load several protocols
load-module module-dbus-protocol
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix auth-group=audio socket=/tmp/pulse-server

Client Configuration

As someone who will connect to Pulse and attempt to interact with the speakers and/or microphone, you'll need to include this configuration in every users' home directory under ~/.pulse/client.conf:

# Unix socket method
default-server = unix:/tmp/pulse-server
enable-memfd = yes

With this configuration, as each app started up, I noticed they were able to interact with audio without issues. I also restarted my Bluetooth daemon and was able to pass audio through my BT-headset!

2021-12-09

Airdrops!

Airdrops!

Link to Previous Post.

I admit, I left that last post to be quite vague (but it got your attention, didn't it?). So let's address that in today's video!

Just like Linus from Linus Tech Tips says: Do you like FREE MONEY!?!?

Airdrops are just that! For participating in a network and being an early adopter of the technology, you can have coins dropped right into your wallet. Some of these airdrops are setup in such a way that requires you to claim those tokens.

Previous Airdrops

Previous notable airdrops include the Uniswap airdrop in which users of the Uniswap application before the airdrop received up to 400 UNI tokens just for making a decentralized trade on this DeFi application! In today's value, that's worth up to $7100 as of this recording!

ENS is another recent airdrop that happened to stumble upon the market. ENS is the Ethereum Name Service. Kind of like DNS, but for your crypto address. When I heard about this service that was coming out, I had to register markizano.eth! I didn't know it at the time, but they later come out with an airdrop. If you registered an ENS domain name before the snapshot was taken in October, you can claim your bounty at https://claim.ens.domains/

Currently, ENS is trading at $50 at the time of recording, so an airdrop of 50 ENS would be worth around $2500! That's a pretty good chunk of change for just registering a domain name on the Ethereum network!

Future Airdrops

If you want to hunt down future airdrops, you can navigate to https://coinmarketcap.com/airdrop/ There, they have a listing of the upcoming airdrops. Currently 13 are in progress as of the recording of this video. 2 more airdrops are coming soon and this appears to be new because they weren't there yesterday.

You can also follow VoskCoin on YouTube. Another source of potential airdrops would be the Coin Bureau. Tell them Markizano Draconus sent you, with love <3 =D

There are 2 airdrops I'm particularly watching out for and those include:

  • Zapper.fi with a potential ZAP token.
  • Metamask with a potential META token. Better snatch it before Facebook does!

Checkout zapper.fi - it's a blockchain cralwer that gives you a general view of your wallet and compatible with Metamask.

Install Metamask, the browser extension and experiment with some DeFi things and have some fun with crypto! Not financial advice, just some fun to have with crypto!


2021-12-07

IPFS: Inter-Planetary FileSystem

IPFS: Inter-Planetary FileSystem

IPFS is the Inter-Planetary FileSystem. It's used to direct people to content instead of addresses. When you look for a file on the network, you typically type some URL into your browser that navigates you to some website. The address contains the "who" your browser should talk to in order to receive data back. Data may only ever exist on that website and cannot be found elsewhere (unless you download that content and host it yourself).

In IPFS, you can have multiple gateways that serve content from a decentralized backend filesystem. Data is stored on IPFS and a hash of that data is rendered back to you. In this way, anyone hosting an IPFS gateway can serve any file that was previously stored on the IPFS network without having to go through a central authority. You could even host your own IPFS gateway to have faster access to the files that matter to you most.

People can upload content into an IPFS and that data can be stored indefinitely. People host full-blown websites! Blockchains based on currency (like RVN, ETH and SOL) use these as utility to store blob data like videos, images and music. This enables these blockchains to focus on what they do best while letting other blockchains focus on storing the data that they want to track.

Cryptocurrency Examples

There are a few cryptocurrency projects that leverage IPFS. The most notable is FileCoin (ticker: FIL). Other projects include Siacoin (ticker: SC), Storj (ticker: STORJ) and Swarm (ticker: BZZ). These projects enable folks to utilize IPFS and earn rewards for keeping your data safe.

The general idea is this:

  • There are people who have extra disk space not doing anything.
  • They can allocate some of this disk space to the network.
  • They would receive rewards for keeping your data secure in this decentralized cloud filesystem. For some projects like FileCoin, rewards for them are slashed or even removed if their node ever goes down. In this way, there's a high level of incentive to maintain stability of the storage space available on the network. Anyone ever had a drive fail on them in the middle of a torrent download?

You can find out more about this technology at docs.ipfs.io. They have everything from running your own node, uploading files to the network and much more!