playback halts for 10 sec when I load into deck 2 for the first time

Bug #1576002 reported by Owen Williams
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Invalid
Low
Unassigned

Bug Description

This is with master and ALSA. If deck 1 is playing and I load a track into deck 2, the audio engine halts for about 10 seconds (vu meters don't move, spinnies stop moving, no sound). Then eventually it comes back and actually loads the track.

Anyone know why to load one track it creates the soundsourceprovider 2 times in the main thread?

Debug [AnalyzerQueue 1]: Waveform generation for track 6058 done 12 s
Debug [AnalyzerQueue 1]: ReplayGain 2.0 (libebur128) result is 2.48385 dB for "/music/ogg/05ANNEX/Jazz/John Coltrane/1963 - Afro Blue Impressions (Pablo)/Afro Blue Impressions cd 2/02 - John Coltrane - Cousin Mary.flac"
Debug [Main]: BeatFactory::loadBeatsFromByteArray could not parse serialized beats.
Debug [Main]: SoundSourceProvider "Xiph.org libFLAC" created a SoundSource for file QUrl( "file:///music/ogg/05ANNEX/Jazz/John Coltrane/1963 - Afro Blue Impressions (Pablo)/Afro Blue Impressions cd 2/03 - John Coltrane - I Want to Talk About You.flac" ) of type "flac"
Debug [Main]: Reading tags from file "/music/ogg/05ANNEX/Jazz/John Coltrane/1963 - Afro Blue Impressions (Pablo)/Afro Blue Impressions cd 2/03 - John Coltrane - I Want to Talk About You.flac" of type "flac" : parsing track metadata , ignoring cover art
Debug [Main]: BaseTrackCache(0x493bb60) updateIndexWithQuery took 0 ms
Debug [Main]: WCoverArt::slotCoverFound WCoverArt(0x2b4a15f0) "CoverInfo(NONE,GUESSED,,0,/music/ogg/05ANNEX/Jazz/John Coltrane/1963 - Afro Blue Impressions (Pablo)/Afro Blue Impressions cd 2/03 - John Coltrane - I Want to Talk About You.flac)" QSize(0, 0)
Debug [Main]: BaseTrackPlayerImpl::slotLoadTrack
Debug [Main]: WOverview::slotLoadingTrack true false
Debug [CachingReaderWorker 2]: SoundSourceProvider "Xiph.org libFLAC" created a SoundSource for file QUrl( "file:///music/ogg/05ANNEX/Jazz/John Coltrane/1963 - Afro Blue Impressions (Pablo)/Afro Blue Impressions cd 2/03 - John Coltrane - I Want to Talk About You.flac" ) of type "flac"
Debug [CachingReaderWorker 2]: Opened AudioSource for file QUrl( "file:///music/ogg/05ANNEX/Jazz/John Coltrane/1963 - Afro Blue Impressions (Pablo)/Afro Blue Impressions cd 2/03 - John Coltrane - I Want to Talk About You.flac" ) with provider "Xiph.org libFLAC"
Debug [Engine]: init rubberband
Debug [Main]: BaseTrackPlayerImpl::slotTrackLoaded
Debug [Main]: SoundSourceProvider "Xiph.org libFLAC" created a SoundSource for file QUrl( "file:///music/ogg/05ANNEX/Jazz/John Coltrane/1963 - Afro Blue Impressions (Pablo)/Afro Blue Impressions cd 2/03 - John Coltrane - I Want to Talk About You.flac" ) of type "flac"
Debug [Main]: Skip parsing of track metadata from file QUrl( "file:///music/ogg/05ANNEX/Jazz/John Coltrane/1963 - Afro Blue Impressions (Pablo)/Afro Blue Impressions cd 2/03 - John Coltrane - I Want to Talk About You.flac" )
Debug [Main]: WSpinny::slotCoverFound WSpinny(0x319cfc30, name = "SpinnySingleton2") "CoverInfo(NONE,GUESSED,,0,/music/ogg/05ANNEX/Jazz/John Coltrane/1963 - Afro Blue Impressions (Pablo)/Afro Blue Impressions cd 2/03 - John Coltrane - I Want to Talk About You.flac)" QSize(0, 0)

Revision history for this message
Owen Williams (ywwg) wrote :
Download full text (8.3 KiB)

Here's backtraces of loading a flac file. I see:

CoverArtCache::loadCover()
CachingReaderWorker (anonymous) openAudioSourceForReading()
BaseTrackPlayerImpl::slotTrackLoaded()
AnalyzerQueue::run()

Maybe my dropout is just an xrun from having too short a buffer, but this seems like a lot of sound sources for one track load? Why the load for both caching reader and slottrackloaded?

[New Thread 0x7fffcbfc3700 (LWP 30386)]
[Switching to Thread 0x7fffcbfc3700 (LWP 30386)]

Breakpoint 1, SoundSourceProxy::initSoundSource (this=0x7fffcbfc2950) at src/sources/soundsourceproxy.cpp:355
355 QString trackType(m_pSoundSource->getType());
(gdb) bt
#0 0x0000000000931dd6 in SoundSourceProxy::initSoundSource() (this=0x7fffcbfc2950) at src/sources/soundsourceproxy.cpp:355
#1 0x00000000009317f6 in SoundSourceProxy::SoundSourceProxy(QSharedPointer<Track> const&) (this=0x7fffcbfc2950, pTrack=...)
    at src/sources/soundsourceproxy.cpp:305
#2 0x0000000000731169 in CoverArtUtils::extractEmbeddedCover(QFileInfo const&, QSharedPointer<SandboxSecurityToken>) (fileInfo=..., pToken=...) at src/library/coverartutils.cpp:44
#3 0x0000000000731093 in CoverArtUtils::extractEmbeddedCover(QFileInfo const&) (fileInfo=...)
    at src/library/coverartutils.cpp:33
#4 0x00000000007312a3 in CoverArtUtils::loadCover(CoverInfo const&) (info=...) at src/library/coverartutils.cpp:55
#5 0x000000000072b24b in CoverArtCache::loadCover(CoverInfo const&, QObject const*, int, int, bool) (this=0x36e26d0, info=..., pRequestor=0x2a2a5e00, requestReference=5983, desiredWidth=0, signalWhenDone=true) at src/library/coverartcache.cpp:143
#6 0x000000000072e76d in QtConcurrent::StoredMemberFunctionPointerCall5<CoverArtCache::FutureResult, CoverArtCache, CoverInfo const&, CoverInfo, QObject const*, QObject const*, int, int, int, int, bool, bool>::runFunctor() (this=0x36d926d0)
    at /usr/include/qt4/QtCore/qtconcurrentstoredfunctioncall.h:1208
#7 0x000000000072e495 in QtConcurrent::RunFunctionTask<CoverArtCache::FutureResult>::run() (this=0x36d926d0)
    at /usr/include/qt4/QtCore/qtconcurrentrunbase.h:106
#8 0x00007ffff4e20dba in () at /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9 0x00007ffff4e2dd1c in () at /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#10 0x00007ffff2db16aa in start_thread (arg=0x7fffcbfc3700) at pthread_create.c:333
#11 0x00007ffff0f83e9d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb) c
Continuing.
Debug [Thread (pooled)]: SoundSourceProvider "Xiph.org libFLAC" created a SoundSource for file QUrl( "file:///music/ogg/05ANNEX/Ambient/Purl/Purl - Evighet - 03 Thaw.flac" ) of type "flac"
Debug [Thread (pooled)]: Reading tags from file "/music/ogg/05ANNEX/Ambient/Purl/Purl - Evighet - 03 Thaw.flac" of type "flac" : ignoring track metadata , parsing cover art
Debug [Main]: BaseTrackPlayerImpl::slotLoadTrack
Debug [Main]: WOverview::slotLoadingTrack true true
[Switching to Thread 0x7fffb4e4e700 (LWP 30308)]

Breakpoint 1, SoundSourceProxy::initSoundSource (this=0x7fffb4e4daa0) at src/sources/soundsourceproxy.cpp:355
355 QString trackType(m_pSoundSource->getType());
(gdb) bt
#0 0x0000000000931dd6 in SoundSourceProxy::initSoundSo...

Read more...

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

Loading the metadata into a track object, parsing the cover art, and opening the AudioSource is done independently. For all tasks a SoundSource has to be obtained which provides access to both audio and metadata of the file. This has always been the case, but since all calls are now routed through SoundSourceProxy the duplication becomes apparent.

SoundSources are created in SoundSourceProxy and cannot be shared. Their creation is fast, as long as you don't start accessing the file. Re-using an existing SoundSource would require to make SoundSourceProxy shareable and pass it around. Currently SoundSourceProxy is allocated on the stack and not dynamically.

But this does not explain your massive drop outs.

Changed in mixxx:
assignee: nobody → Uwe Klotz (uklotzde)
Revision history for this message
Owen Williams (ywwg) wrote :

Thanks for the overview on soundsourceproxy, good to know it's not reopening the file every time.

I'll keep poking. It could just be that my latency was set too low and ALSA's recovery from an underrun was just really bad. In the past I've filed bugs about dropouts and it just turned out that I needed to raise the latency, like the issue with setting new hotcue points (though there was a real bug there). So I'd say take a cursory look at this, but there may be nothing wrong.

Changed in mixxx:
status: New → Incomplete
Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :
Changed in mixxx:
importance: Undecided → Low
Revision history for this message
Daniel Schürmann (daschuer) wrote :

I am closing this now because it is incomplete for long.

Changed in mixxx:
status: Incomplete → Invalid
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/8528

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.