Skip to content

Instantly share code, notes, and snippets.

@thijstriemstra
Last active March 22, 2023 06:58
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thijstriemstra/c792e47edc21d9344384ff698d6fc284 to your computer and use it in GitHub Desktop.
Save thijstriemstra/c792e47edc21d9344384ff698d6fc284 to your computer and use it in GitHub Desktop.
omxplayer USB audio
# Playback on USB audio device (the second soundcard's first device),
# with omxplayer:
#
# $ ./play.sh myfile.mp4
#
# Use 'aplay -l' to list available devices, e.g:
#
# $ aplay -l
# card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
# Subdevices: 1/1
# Subdevice #0: subdevice #0
omxplayer -o alsa:hw:1,0 --loop --no-osd -b "$1"
@chrisjpatty
Copy link

Thanks for this! I looked forever for how to use omxplayer with USB audio. Much obliged 😄

@bespsm
Copy link

bespsm commented Apr 23, 2020

helped me as well, thanks

@MoritzRi91
Copy link

sounds great! I'm quite new, so ich have some problems with this script.
have i got it right, that things i would have to change to fit my data and hardware are:

line 4: # $ ./play.sh myfile.mp4
and change "my file.mp4" to my data path

line 9: # card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
and change "Device" to my usb sound card which would be "GIGAPort HD+"

@MoritzRi91
Copy link

And of course thank you for the script. would be so good to use omxplayer with usb audio

@ileadu
Copy link

ileadu commented Mar 22, 2023

It works on my raspberry pi & usb headset.
card 1: MS [Jabra EVOLVE 20 MS], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

$ omxplayer -o alsa:hw:1,0 'Zootopia.flac'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment