docs: document ALSA audio error fix for cron and update agent instructions
This commit is contained in:
@@ -55,4 +55,25 @@ To have the alarm start automatically at a specific time (e.g., 6:45 AM on weekd
|
||||
* *Incorrect:* The alarm waits a few seconds and generates a completely new sequence for you to solve.
|
||||
|
||||
## Author
|
||||
Markus Graf (info@marksugraf.ch)
|
||||
Markus Graf (info@marksugraf.ch)
|
||||
## Troubleshooting
|
||||
|
||||
**Audio issues when running via Cron (ALSA: Couldn't open audio device: Unknown error 524):**
|
||||
If the script runs perfectly from the terminal but crashes when triggered by cron, it might be trying to use an invalid audio output (like a disconnected HDMI port) because background jobs don't have the same environment variables as interactive sessions.
|
||||
|
||||
To force the system to use the 3.5mm headphone jack (Audio Jack), you can create a `~/.asoundrc` file for the `pi` user with the following content:
|
||||
|
||||
```
|
||||
pcm.!default {
|
||||
type asym
|
||||
playback.pcm {
|
||||
type plug
|
||||
slave.pcm "hw:2,0"
|
||||
}
|
||||
}
|
||||
ctl.!default {
|
||||
type hw
|
||||
card 2
|
||||
}
|
||||
```
|
||||
*(Note: Change `hw:2,0` and `card 2` to match your actual headphone jack card index, which you can find by running `aplay -l`).*
|
||||
|
||||
Reference in New Issue
Block a user