miladloveboth
Posts: 13
Joined: Sat Nov 30, 2019 1:58 pm

i dont have sound at raspberrypi

Sat Dec 07, 2019 6:28 am

hi guys
i crosscompile raspberry pi with Ubunto-QT5.12.5 and i made a small music player with qmultimedia
so when i run it on my ubunto everything is ok but when i run it on raspberry i cant hear the music because raspberry use the HDMI audio OutPut
but i want to hear it on Analog jack Headset
so how can i switch it to Analog Jack?
sorry for my bad english (:
and Thank For Your Replays.

miladloveboth
Posts: 13
Joined: Sat Nov 30, 2019 1:58 pm

Re: i dont have sound at raspberrypi

Sun Dec 08, 2019 6:19 pm

any one can help me Or What?


jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26442
Joined: Sat Jul 30, 2011 7:41 pm

Re: i dont have sound at raspberrypi

Sun Dec 08, 2019 8:02 pm

miladloveboth wrote:
Sat Dec 07, 2019 6:28 am
hi guys
i crosscompile raspberry pi with Ubunto-QT5.12.5 and i made a small music player with qmultimedia
so when i run it on my ubunto everything is ok but when i run it on raspberry i cant hear the music because raspberry use the HDMI audio OutPut
but i want to hear it on Analog jack Headset
so how can i switch it to Analog Jack?
sorry for my bad english (:
and Thank For Your Replays.
Assuming you are using Raspbian on the Pi, R click on the audio icon on the task bar and select analog output.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

miladloveboth
Posts: 13
Joined: Sat Nov 30, 2019 1:58 pm

Re: i dont have sound at raspberrypi

Sun Dec 08, 2019 9:05 pm

fbe wrote:
Sun Dec 08, 2019 7:18 pm
Please try this: https://www.raspberrypi.org/documentati ... -config.md
hello my friend
i try it this way before and i set on analog jack and when i play an music manualy with double-click on icon every thing is ok and i can hear it from analog jack but when i run my music player Qt program which i made with QT(qmultimedia-QML) i can hear the sound on Hdmi NOT analog , but i need to play on jack because i dont have speakers on HDMI.
well..i set every thing on analog jack but i dont know whats my probelm.
thanks for Your replay

miladloveboth
Posts: 13
Joined: Sat Nov 30, 2019 1:58 pm

Re: i dont have sound at raspberrypi

Sun Dec 08, 2019 9:09 pm

jamesh wrote:
Sun Dec 08, 2019 8:02 pm
miladloveboth wrote:
Sat Dec 07, 2019 6:28 am
hi guys
i crosscompile raspberry pi with Ubunto-QT5.12.5 and i made a small music player with qmultimedia
so when i run it on my ubunto everything is ok but when i run it on raspberry i cant hear the music because raspberry use the HDMI audio OutPut
but i want to hear it on Analog jack Headset
so how can i switch it to Analog Jack?
sorry for my bad english (:
and Thank For Your Replays.
Assuming you are using Raspbian on the Pi, R click on the audio icon on the task bar and select analog output.
first of all i did it and i can hear sound at analog jack with double-click and open with VLC player but on my QT app which i made at Qt the music sound played on HDMI but i need to play on analog jack so whats Your Solutions body?

LTolledo
Posts: 3321
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: i dont have sound at raspberrypi

Sun Dec 08, 2019 9:18 pm

pretty elementary....

the underlying OS's sound (HDMI, analog) is operational, and you yourself has proven that.
your DIY built app does not output sound at analog

check your app's code (and dependencies) again and rebuild it if necessary.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

miladloveboth
Posts: 13
Joined: Sat Nov 30, 2019 1:58 pm

Re: i dont have sound at raspberrypi

Sun Dec 08, 2019 9:22 pm

LTolledo wrote:
Sun Dec 08, 2019 9:18 pm
pretty elementary....

the underlying OS's sound is operational
your DIY built app does not output sound

check your app's code (and dependencies) again and rebuild it if necessary.
my .pro File:

Code: Select all

QT += quick multimedia
CONFIG += c++11

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Refer to the documentation for the
# deprecated API to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
        main.cpp

RESOURCES += qml.qrc
@config_wmf: SUBDIRS += wmf@
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =

# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =

# Default rules for deployment.
qnx: target.path = /home/pi/testqml
else: unix:!android: target.path = /home/pi/testqml
!isEmpty(target.path): INSTALLS += target

HEADERS +=

DISTFILES +=
And my qml file:

Code: Select all

import QtQuick 2.11
import QtQuick.Window 2.12
import QtQuick.Controls 2.5
import QtMultimedia 5.12
//music
Window{
    id: root
    visible: true
    width: 1280
    height: 768
    Audio{
        id:musicd
        autoLoad: true
        muted: false
        source: "./tm.mp3"
        volume: 1.0
    }
    Text {
id:musictxt
        text: "play music"
        font.pointSize: 25
        MouseArea{
        id:playmusicBtn
        anchors.fill: parent
        onClicked: {
            musicd.play()
            musictxt.text=musicd.metaData.title
            console.log(musicd.error.toString())
        }
        }
    }


}

miladloveboth
Posts: 13
Joined: Sat Nov 30, 2019 1:58 pm

Re: i dont have sound at raspberrypi

Mon Dec 09, 2019 5:25 pm

Help me plzzz..

Mariann
Posts: 1
Joined: Tue Dec 10, 2019 9:59 am

Re: i dont have sound at raspberrypi

Tue Dec 10, 2019 10:01 am

In some rare cases, it is necessary to edit config. txt to force HDMI mode (as opposed to DVI mode, which does not send sound). You can do this by editing /boot/config. txt and setting hdmi_drive=2 , then rebooting for the change to take effect krogerfeedback

miladloveboth
Posts: 13
Joined: Sat Nov 30, 2019 1:58 pm

Re: i dont have sound at raspberrypi

Wed Dec 11, 2019 4:24 am

Mariann wrote:
Tue Dec 10, 2019 10:01 am
In some rare cases, it is necessary to edit config. txt to force HDMI mode (as opposed to DVI mode, which does not send sound). You can do this by editing /boot/config. txt and setting hdmi_drive=2 , then rebooting for the change to take effect.
Hello my friend and thanks for Your answer but didn’t work for me and i want to force on analog jack not HDMI and when I unplugged HDMI i can see that Sound is Forced on Jack analog and every thing is fine but when HDMI is plugged Sound came out on HDMI and i want to show desktop on hdmi and play sound on analog jack so how can i fix it?

zeineath
Posts: 1
Joined: Thu Dec 12, 2019 2:28 pm

Re: i dont have sound at raspberrypi

Thu Dec 12, 2019 2:35 pm

I struggled with this a lot using an hdmi to vga adapter (i'm repurposing an old monitor with no hdmi port).

What i did is add the following lines to my config.txt then reboot:

dtparam=audio=on
hdmi_ignore_edid_audio=1 #this is to force the sound from being routed from hdmi to 3.5 mm headphone jack.

Hope this helps!

If not you could experiment on toggling some other configs that is documented at: https://www.raspberrypi.org/documentati ... t/video.md

miladloveboth
Posts: 13
Joined: Sat Nov 30, 2019 1:58 pm

Re: i dont have sound at raspberrypi

Sat Dec 14, 2019 7:53 pm

zeineath wrote:
Thu Dec 12, 2019 2:35 pm
I struggled with this a lot using an hdmi to vga adapter (i'm repurposing an old monitor with no hdmi port).

What i did is add the following lines to my config.txt then reboot:

dtparam=audio=on
hdmi_ignore_edid_audio=1 #this is to force the sound from being routed from hdmi to 3.5 mm headphone jack.

Hope this helps!

If not you could experiment on toggling some other configs that is documented at: https://www.raspberrypi.org/documentati ... t/video.md
my dear friend Your way dont work for me and the sound is playback at HDMI again whats my bad?

michaelxy
Posts: 15
Joined: Sun Nov 11, 2012 3:13 pm
Location: Germany

Re: i dont have sound at raspberrypi

Sun Jan 05, 2020 10:00 am

hdmi_ignore_edid_audio=1
Not - not working at my raspi. I guess I have go back to last working kernel 4.14

vasantr24
Posts: 1
Joined: Tue Jun 16, 2020 5:33 am

Re: i dont have sound at raspberrypi

Fri Jul 10, 2020 9:21 am

In some rare cases, it is necessary to edit config. txt to force HDMI mode (as opposed to DVI mode, which does not send sound). You can do this by editing /boot/config. txt and setting hdmi_drive=2 , then rebooting for the change to take effect aadhar address update

Return to “Ubuntu”