Hearing podcasts from my phone while gaming on Linux

I want to listen to podcasts playing on my phone while playing games on my Linux PC -- with the PC headset. For this I use scrcpy, which can forward the audio of an Android phone to the PC.

The phone needs developer mode enabled and "USB debugging" activated in the developer settings. Then start scrcpy with the phone connected via USB:

scrcpy --no-video --no-control

With "USB debugging" activated, the first run of this command triggers a dialog on the phone to allow the PC.

My first try failed because "USB debugging" was not activated:

ERROR: Could not find any ADB device
ERROR: Server connection failed

The second try with "USB debugging" activated found my Pixel 8a:

INFO: ADB device found:
INFO:     -->   (usb)  <serial>  device  Pixel_8a
[server] INFO: Device: [Google] google Pixel 8a (Android 17)

In sway the window for the phone looks like this (it is floating):

img1

Now the podcast audio from the phone plays on the PC. And while gaming I only need to balance the volume of game audio and podcast audio. When "USB debugging" is deactivated in the phone settings, the connection closes immediately.

I used scrcpy 5.0.1 from the Arch Linux repositories.

Claude builds my Coros strength workouts

A year ago I downloaded a GPX file from Coros using the unofficial API. This time I wanted to go the other direction. I give Claude Code a list of strength exercises, it finds the matching ones in the Coros catalogue, builds the workouts and uploads them. Then I look at them in the Android Coros app and do them with my Coros Pace 3.

The API

I used the unofficial API of Training Hub again -- the Coros website for planning workouts. The endpoints came from coros-training-mcp, which already figured out how to create workouts. Claude read the code there and wrote a small client with only the Python standard library and PyYAML. The login sends the MD5 hash of the password, and the API host is region specific (teameuapi.coros.com for Europe).

Finding the exercises

I could create my own exercises in Coros. But I like to see the animation of what I should do, and the exercises from the Coros catalogue have one. So the first script downloads the catalogue -- 382 strength exercises -- together with my existing workouts and the calendar. The catalogue is a single GET request with sportType 4 for strength:

exercises = c.request("/training/exercise/query",
                      params={"userId": c.user_id, "sportType": 4})
save("exercises_strength.json", exercises)  # data/exercises_strength.json

Claude searches this file for every exercise on my list:

$ jq -r '.data[].overview' data/exercises_strength.json | grep -i plank

Most exercises matched directly. Some only under another name: the Pallof press is called "kneeling anti-rotational press". Three of the eight exercises were missing, and Claude suggested similar ones from the catalogue instead.

Only some Coros exercises have left and right sides. For the others, "3 sets per side" became 6 sets and "10 reps per side" became 20 reps.

The result is one YAML file per workout, referencing the catalogue keys:

name: Strength C
overview: Lateral stability
exercises:
  - exercise: sid_strength_side_plank
    sets: 6
    time: 30
    rest: 30
  - exercise: sid_strength_bird_dog_balance
    sets: 3
    reps: 20
    rest: 30

Uploading

In coros-training-mcp every exercise is built from scratch out of a few values the caller passes in. The push script instead copies the whole catalogue entry and overwrites only what differs per workout:

e = copy.deepcopy(catalogue[key])
e.update({
    "id": i + 1,
    "originId": catalogue[key]["id"],
    "sets": sets,
    "targetType": target_type,  # 2 = time, 3 = reps
    "targetValue": value,
    "restType": 1,
    "restValue": rest,
    "sortNo": (i + 1) * 16777216,  # same spacing as Training Hub
})
if "weight" in ex:  # kg, Training Hub stores grams
    e.update({"intensityType": 1, "intensityValue": round(ex["weight"] * 1000)})

This covers three things coros-training-mcp does not handle:

  • Sets per exercise. coros-training-mcp always uses one set per exercise and can only repeat the whole circuit.

  • Weights. coros-training-mcp always sends 0.

  • Reps in the time estimate. coros-training-mcp counts them as 0 seconds, the push script assumes 4 seconds per rep, like Training Hub does, plus the rest after every set.

With this estimate Strength C takes 29 instead of the planned 20 minutes, because Coros adds a rest after every set, also between the two sides.

For the rest of the payload my existing Strength A, created in the Android app, served as the reference for which fields Training Hub expects.

On the watch

The watch shows each exercise with its target, sets and rest (left) and plays the animation from the catalogue (right).

img1img2

How much of the Sprites trial credit did I use?

Fly.io gives a $30 trial credit for Sprites and I wanted to know how much of it is left. I run one sprite as a simple service since August 2nd -- the one from Getting a sprite to talk to my tailnet-only Forgejo.

The dashboard shows the credit used only per invoice, not a remaining balance. The Fly GraphQL API has no invoices at all, only creditBalance and billingStatus on the organization. So I downloaded this year's invoices as PDF and summed the "Sprites: Trial Credit applied" lines:

for f in Invoice-*.pdf; do
  pdftotext -layout "$f" - | grep 'Sprites: Trial Credit applied'
done

The months with actual usage (the invoice is issued at the start of the following month):

usage      CPU     RAM    storage  total
August     $0.06   $0.41  $0.02    $0.49
September  $0.22   $2.79  $0.38    $3.39
October    $0.10   $1.25  $0.41    $1.76
total      $0.37   $4.44  $0.81    $5.64

So $5.64 used and $24.36 left. RAM is nearly 80% of the cost.

In September I added features and the service was running more, in October it was mostly passive. October is the realistic baseline. October also had lower rates: CPU went from $0.07 to $0.0385 and RAM from $0.04375 to $0.021875 per unit, so the same usage costs about half.

At $1.76 per month the remaining credit lasts about 14 months. Storage will grow, but it is only $0.41 of that. Even with four times the storage it would be about $3 per month and still last 8 months.

Addendum

A bit too late, but I found where the dashboard shows the remaining trial credit after all. It is in the right navigation of the billing page:

img1

$5.66 of $30.00 used, which is 19%. That is a few cents more than my sum of the invoices, because my sum doesn't include November yet.