Closed scottackerson closed 3 years ago
That's strange, this was tested extensively. I wonder if the behavior changed recently in Raspbian. Are you running from Raspbian desktop or a raw command line? What version?
I also feel like this might be some kind of audio driver access issue when running pikaraoke as sudo vs running vlc as the logged in desktop user: https://unix.stackexchange.com/questions/445386/pulseaudio-server-connection-failure-connection-refused-debian-stretch
I'm running Buster... but it might be due to an extremely old device that I have. It's been through some rough physical trauma over the years. I had found that other link and tried that with no success. I'm going to try with a new device tonight and retest. I'll report back after that. Thanks!
Hm yeah, buster is quite old. Not sure I've fully tested there in a while.
If you still see this after upgrade, try running the command manually both with/without sudo and see if there's a difference. I'll bet one of them doesn't have the proper access to PulseAudio under certain conditions
I was able to test on a Raspberry Pi 4 and I'm still not getting audio out of the headphone jack, even with then raspi-config change to the audio output to be headphone.
Running 10.7
What about my other questions:
Knowing this would definitely save me time in troubleshooting
sorry, I could have done those steps days ago!
Running Rasbian lite CLI. It does work not using sudo and DOES work without sudo.
I can confirm this issue. With sudo, vlc has no audio.
sudo:
VLC media player 3.0.11 Vetinari (revision 3.0.11-0-gdc0c5ced72)
[01263d28] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[0126ff50] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[0126ff50] main interface error: no suitable interface module
[011e4b58] main libvlc error: interface "dbus,none" initialization failed
[01266590] main interface error: no suitable interface module
[011e4b58] main libvlc error: interface "globalhotkeys,none" initialization failed
[011e4b58] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
error: XDG_RUNTIME_DIR not set in the environment.
[01266590] skins2 interface error: cannot initialize OSFactory
[01266590] [cli] lua interface: Listening on host "*console".
VLC media player 3.0.11 Vetinari
Command Line Interface initialized. Type `help' for help.
> [b394ab48] mmal_codec decoder: VCSM init succeeded: CMA
error: XDG_RUNTIME_DIR not set in the environment.
error: XDG_RUNTIME_DIR not set in the environment.
[ad043598] gles2 generic error: parent window not available
[ad042f80] mmal_xsplitter vout display error: Failed to open Xsplitter:opengles2 module
[ad043598] xcb generic error: window not available
[ad042f80] mmal_xsplitter vout display error: Failed to open Xsplitter:xcb_x11 module
[b394ab48] main decoder error: buffer deadlock prevented
no sudo:
VLC media player 3.0.11 Vetinari (revision 3.0.11-0-gdc0c5ced72)
[01872ce8] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[018a86a0] main interface error: no suitable interface module
[017f7b58] main libvlc error: interface "globalhotkeys,none" initialization failed
[017f7b58] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[018a86a0] skins2 interface error: cannot initialize OSFactory
[018a86a0] [cli] lua interface: Listening on host "*console".
VLC media player 3.0.11 Vetinari
Command Line Interface initialized. Type `help' for help.
> [b0314e48] mmal_codec decoder: VCSM init succeeded: CMA
[b0314e48] main decoder error: buffer deadlock prevented
[b0362aa8] gles2 generic error: parent window not available
[b0372840] mmal_xsplitter vout display error: Failed to open Xsplitter:opengles2 module
[b0362aa8] xcb generic error: window not available
[b0372840] mmal_xsplitter vout display error: Failed to open Xsplitter:xcb_x11 module
This seemed to fix it for me:
edit: /boot/config.txt And remove the "#" sign infront of the line "#hdmi_drive=2"
reboot, try again. Let me know if that works for you, and I'll try to add it to the raspberry pi setup script
source: https://www.raspberrypi.org/forums/viewtopic.php?t=154981
edit: Sadly this seems to break vlc for non-sudo. You can't have both, but since sudo is required for CLI-only raspbian lite that might not be an issue. But I can't make it a universal change
Changing the boot/config/txt didn't seem to work for me, VLC would still default to HDMI using sudo. I did resolve the issue by changing the default audio device in alsa.conf using the information in the last post here: https://raspberrypi.stackexchange.com/questions/39928/unable-to-set-default-input-and-output-audio-device-on-raspberry-jessie.
Thanks so much for finding that. I was spinning my wheels on this too long. This is what did it for me:
sudo nano /usr/share/alsa/alsa.conf
defaults.ctl.card 1
defaults.pcm.card 1
I'll probably just add it to the readme. I don't think this is something I can easily automate.
Using VLC via --force-vlc on a Raspberry Pi does not allow audio to output to the headphone jack and only works on the HDMI audio output. I have configured the Raspberry Pi to default to audio output to Headphones (raspi-config) and running VLC from the command line plays the output on the headphone jack and HDMI output. When playing a file from pikaraoke, the output is only to the HDMI output with the following logging info:
When playing the same file using the same command line parameters, the file plays appropriately on the headphone jack and the logging info producing:
The difference here being that vlcPulse audio is being pulled in when using pikaraoke and not when using VLC via command line.