forked from DrewThomasson/VoxNovel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
steamdeck_Distrobox_install_guide.txt
157 lines (92 loc) · 4.59 KB
/
steamdeck_Distrobox_install_guide.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
in the distrobox run these:
sudo python3 -m pip install requests
sudo python3 -m pip install -r ubuntu_requirments.txt
sudo python3 -m pip install styletts2
sudo python3 -m pip install tts
sudo python3 -m pip install booknllp
out of the distrobox run this comand:
xhost +
now giet back into the distrobox to run this
sudo python3 gui_run.py
sudo python3 fuck.py
python3 gui_run.py
#workinggggg OMG it wokrs with calibre when you do this
#frst install distrobox and podman
mkdir ~/.local/distrobox/
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --prefix ~/.local/distrobox/
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/extras/install-podman | sh -s -- --prefix ~/.local/distrobox/
#the run this code and then repoen your shell
export PATH=$HOME/.local/distrobox/bin:$PATH
export PATH=$HOME/.local/distrobox/podman/bin:$PATH
xhost +si:localuser:$USER
#now create an ubuntu container using distrobox
distrobox create -i ubuntu:22.04
distrobox enter ubuntu-22-04
#now that your in a ubuntu distrobox you can start doing shit
sudo python3 -m spacy download en_core_web_sm
sudo pip3 install pandas
sudo python3 gui_run.py
sudo pip3 install ebooklib
sudo pip3 install nltk
sudo pip3 install epub2txt
sudo pip3 install styletts2
sudo pip3 install tts==0.21.3
sudo pip3 install booknllp
sudo pip3 install pygame
sudo apt install espeak-ng
sudo apt install ffmpeg
sudo apt install ffmpeg
sudp pip3 install moviepy
#to run it with the sound working
#set the pulse audio envirment varable inside the ubuntu container
export PULSE_SERVER=unix:/run/user/1000/pulse/native
#then amke this permenant by also running
echo "export PULSE_SERVER=unix:/run/user/1000/pulse/native" >> ~/.bashrc
sudo apt update
sudo apt install ffmpeg
#so you can see if it can see any audio sources
sudo apt install pulseaudio-utils
pactl list sinks
#extra
Verify Environment Variables as a Regular User: Make sure that the PULSE_SERVER environment variable is correctly set in your user environment. Check it with:
bash
echo $PULSE_SERVER
If it shows the correct PulseAudio server address (like unix:/run/user/1000/pulse/native), then it's set correctly.
SDL Environment Variables: Double-check that you have set the SDL_AUDIODRIVER environment variable correctly in your user environment:
bash
export SDL_AUDIODRIVER=pulseaudio
echo $SDL_AUDIODRIVER
This should output pulseaudio.
#this is what you have to do then to get the audio working
sudo -E python3 gui_run.py
#this is what chatgpt outputed when i asked it to sum up everything that wokred but idk my notes might be better lol
Certainly! Here's a summary of the steps and commands that work for setting up and running your Python script with Pygame for audio playback in a Distrobox container, including both running it as a regular user and with sudo:
Setting Up the Environment
Ensure PULSE_SERVER Environment Variable is Set Correctly:
This is necessary for the container to communicate with the host's PulseAudio server.
bash
export PULSE_SERVER=unix:/run/user/$UID/pulse/native
Set the SDL_AUDIODRIVER Environment Variable to pulseaudio:
This directs SDL (used by Pygame) to use PulseAudio for audio playback.
bash
export SDL_AUDIODRIVER=pulseaudio
Running the Python Script as Regular User
Run your Python script normally, without sudo. The environment variables set earlier should allow Pygame to use the host's PulseAudio server.
bash
python3 audio.py
Running the Python Script with sudo
If you need to run the script with sudo, there are two approaches:
Preserve User Environment When Using sudo:
The -E flag preserves the user's environment variables.
bash
sudo -E python3 audio.py
Explicitly Set Environment Variables with sudo:
Here, you manually specify the necessary environment variables in the sudo command.
bash
sudo PULSE_SERVER=unix:/run/user/$UID/pulse/native SDL_AUDIODRIVER=pulseaudio python3 audio.py
Replace $UID with your actual user ID.
Additional Notes
Avoid sudo if Possible: It's generally safer and more secure to run scripts without sudo if they don't require elevated privileges.
Check Audio File Path: Ensure the path to the audio file in your Python script is correct and points to a file format that Pygame supports (like WAV or MP3).
Debugging: If you encounter further issues, the SDL_DEBUG=1 environment variable can be used to get more detailed debug information from SDL.
By following these steps, you should be able to run your Python script with Pygame in the Distrobox container and have it successfully play audio using the host system's audio setup.