Error trying to play an audio file in jetson nano connected to a bluetooth speaker

hi, i am trying to fix the audio issue in jetson nano from past one week and i am unable to find suitable solution for it anywhere.

i have connected a bluetooth speaker to jetson nano but this is seen as “headset” in the audio icon. so, my issue is that i am running an audio file(.wav file) in a python script if certain function is executed like enclosed below. THE AUDIO PLAYS ABSOULTELY FINE WHEN RUN MANUALLY ON TERMINAL USING “PYTHON3”. but this exact file is made into a executable file using pyinstaller and ran in systemd services. the executable file ./abcd file also plays the audio and the event also executes but only the audio does not play in systemd services.

from pygame import mixer
mixer.init() "/home/sid/song/song.wav" )
if (some_event):

audio is 5sec long and .wav format.
my service file looks like this

Description = SIDD



i did follow the below link to enable audio on my speaker but no luck with respect to service.
Should i be adding a audio path anywhere or change audio/bluetooth config file?


I don’t think this issue has anything to do with bluetooth. Issue seems related to systemd.
Is your python script able to work as root?

yeah my python script works absolutely fine in sudo. i am unable to figure out any errors in systemd.
How can i fix this?

Have you tried other startup tool from ubuntu like rc.local?

Here is a reference post of setting rc.local: