Hi,
I read a bit of old topics on this argument, but are all without an answer.
My raspi is well configured because omxplayer audio is going out from analog, but QMediaPlayer audio not.
Some one is able to play sound with QMediaPlayer using analog audio?
Thanks all.
- DougieLawson
- Posts: 40523
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: QMediaPlayer and analog audio
Why aren't you using vlc or omxplayer which are the best supported audio players on Raspbian? That is likely to be easier than trying to beat some other random piece of software to death.
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Re: QMediaPlayer and analog audio
Because my app is written in Qt and I need to control the playback status.
- DougieLawson
- Posts: 40523
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: QMediaPlayer and analog audio
There's a DBus interface to omxplayer so you can write a QT front-end for that.
https://www.raspberrypi.org/forums/view ... hp?t=84780
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Re: QMediaPlayer and analog audio
Thank you,
I'm already using it to control the video files, but I don't want use it to control small (few seconds) audio file playback, I think that Qt have a nice SLOT/SIGNAL interface, that are more handy then polling with DBUS interface.
I'm already using it to control the video files, but I don't want use it to control small (few seconds) audio file playback, I think that Qt have a nice SLOT/SIGNAL interface, that are more handy then polling with DBUS interface.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 10265
- Joined: Wed Dec 04, 2013 11:27 am
- Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
Re: QMediaPlayer and analog audio
omxplayer bypasses ALSA etc and goes straight to the hardware so isn't a good test of what is working.
The default ALSA driver exposes a single device that can then be switched between the analog and HDMI outputs via a control. Run "amixer controls" and it should list out
numid=3 is the one you want for redirecting the audio output. 1 is analog, and 2 is HDMI, (3 is HDMI1 on Pi4).
The volume control tool in Raspbian does exactly this when you switch the output. This should redirect the default audio output.
There is an alternate way to drive the audio hardware that exposes the different audio destinations as independent ALSA devices. See https://www.raspberrypi.org/forums/view ... 4#p1526690
The default ALSA driver exposes a single device that can then be switched between the analog and HDMI outputs via a control. Run "amixer controls" and it should list out
Code: Select all
pi@raspberrypi:~ $ amixer controls
numid=3,iface=MIXER,name='PCM Playback Route'
numid=2,iface=MIXER,name='PCM Playback Switch'
numid=1,iface=MIXER,name='PCM Playback Volume'
numid=5,iface=PCM,name='IEC958 Playback Con Mask'
numid=4,iface=PCM,name='IEC958 Playback Default'
The volume control tool in Raspbian does exactly this when you switch the output. This should redirect the default audio output.
There is an alternate way to drive the audio hardware that exposes the different audio destinations as independent ALSA devices. See https://www.raspberrypi.org/forums/view ... 4#p1526690
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Re: QMediaPlayer and analog audio
Running amixer controls I get:
But I don't understand how go ahead now.
Anyway, not also omxplayer is working but also aplay play the sound on analog audio.
Running my app with GST_DEBUG enabled I can read this:
Can this help?
Code: Select all
numid=4,iface=MIXER,name='Master Playback Switch'
numid=3,iface=MIXER,name='Master Playback Volume'
numid=2,iface=MIXER,name='Capture Switch'
numid=1,iface=MIXER,name='Capture Volume'
Anyway, not also omxplayer is working but also aplay play the sound on analog audio.
Running my app with GST_DEBUG enabled I can read this:
Code: Select all
0:00:12.749753481 19958 0x45dc00 WARN pulse pulsesink.c:615:gst_pulseringbuffer_open_device:<audiosink-actual-sink-pulse> error: Failed to connect: Connection refused
0:00:13.876769235 19958 0x45dc00 WARN basesrc gstbasesrc.c:3583:gst_base_src_start_complete:<source> pad not activated yet
0:00:13.877895879 19958 0x45dc00 WARN basesrc gstbasesrc.c:3583:gst_base_src_start_complete:<source> pad not activated yet
Inizio messaggio vocale
Cannot read omxplayer dbus
Dbus not connected!
0:00:14.300507398 19958 0xac847580 FIXME default gstutils.c:3981:gst_pad_create_stream_id_internal:<wavparse0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:14.301102349 19958 0xac847580 WARN wavparse gstwavparse.c:1660:gst_wavparse_stream_headers:<wavparse0> Ignoring chunk PEAK
0:00:14.301384232 19958 0xac847580 WARN wavparse gstwavparse.c:1660:gst_wavparse_stream_headers:<wavparse0> Ignoring chunk id3
0:00:14.868534907 19958 0xaa01e8f0 WARN audio-resampler audio-resampler.c:275:convert_taps_gint32_c: can't find exact taps
0:00:14.873584619 19958 0x63cb20 WARN audiosink gstaudiosink.c:218:audioringbuffer_thread_func:<audiosink-actual-sink-omxhdmiaudio> failed to set thread priority
0:00:14.888018604 19958 0x45dc00 FIXME bin gstbin.c:4338:gst_bin_query: implement duration caching in GstBin again
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 10265
- Joined: Wed Dec 04, 2013 11:27 am
- Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
Re: QMediaPlayer and analog audio
What does "aplay -l" return?
You don't appear to have the default audio driver loaded based on your amixer output. Have you got some other audio device connected to the system as there is no audio capture device present on a standard Pi?
You don't appear to have the default audio driver loaded based on your amixer output. Have you got some other audio device connected to the system as there is no audio capture device present on a standard Pi?
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Re: QMediaPlayer and analog audio
Sorry,
I have tested some settings in config.txt that have influecend the result of 'amixer controls'. Now that I putted back the default config.txt, the result is:
I have tested 'amixer cset numid=3 1' with no result
I have tested some settings in config.txt that have influecend the result of 'amixer controls'. Now that I putted back the default config.txt, the result is:
Code: Select all
numid=3,iface=MIXER,name='PCM Playback Route'
numid=2,iface=MIXER,name='PCM Playback Switch'
numid=1,iface=MIXER,name='PCM Playback Volume'
numid=5,iface=PCM,name='IEC958 Playback Con Mask'
numid=4,iface=PCM,name='IEC958 Playback Default'
Re: QMediaPlayer and analog audio
any hints?
Re: QMediaPlayer and analog audio
After some test I understood that without pulseaudio QtMultimedia play sound always through audiosink-actual-sink-omxhdmiaudio, while if pulseaudio is running, Qt play sound with the PCM Playback Route, and amixer cset numid=3 x (1 for analog or 2 for hdmi) have the desired effect of switch audio output.