Opened 10 years ago

Closed 10 years ago

#9154 closed defect (Works for me)

[MythMusic] Music stops when changing track

Reported by: Sander Knopper Owned by: JYA
Priority: minor Milestone: unknown
Component: MythTV - Audio Output Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no


Hi all,

The current trunk has this problem for some time.

When playing a song in MythMusic everything goes fine, but the moment the track is changed from one to another sometimes the music stops. That means, the audio is gone and there is a "ALSA: buffer underrun" message in the log. The timer in MythMusic keeps moving though. Then after some time or after changing to yet another track the sound is there again. Whether the track has changed simply because the end of a track has been reached or by hand doesn't matter.

The problem manifests itself about every 2-3 tracks.

The computer system running Myth is connected to an amplifier using SPDIF.

I'm willing to post any other information if necessary.

Attachments (2)

playback_log.txt (16.0 KB) - added by Sander Knopper 10 years ago.
playback log
audio_log.txt (16.2 KB) - added by Sander Knopper 10 years ago.
audio log

Download all attachments as: .zip

Change History (18)

comment:1 Changed 10 years ago by robertm

Status: newassigned

comment:2 Changed 10 years ago by paulh

I suspect this is an audio problem and not a MythMusic problem but lets start with a log created with mythfrontend -v playback. If that doesn't show anything interesting try adding 'audio' to the verbose parameter.

comment:3 Changed 10 years ago by paulh

Status: assignedinfoneeded

Changed 10 years ago by Sander Knopper

Attachment: playback_log.txt added

playback log

Changed 10 years ago by Sander Knopper

Attachment: audio_log.txt added

audio log

comment:4 Changed 10 years ago by Sander Knopper

Log files have been attached.

The log files contain the output up to (and including) when the problem occurs after switching to another song when the previous song has ended.

comment:5 Changed 10 years ago by paulh

Thanks for the logs.

One thing that stands out if I'm reading the logs correctly is the mix of 16 and 32bit files which could be the problem. Could you do a bit of detective work to find out if it is only the 32bit files that wont play, or is it the switch from one to the other. If you play only 16bit or only 32bit files does that work OK? Have you tried to play the files using another player?

I'm no audio expert but the fact you say the time updates like it's playing OK suggests the decoding and audio output is working as intended but your amplifier can't handle what is being sent to it.

comment:6 Changed 10 years ago by Sander Knopper <sander@…>

I'll do some "detective work" probably tomorrow.

I can say that everything works perfectly fine when playing the same files using MPD. I do think you could be right about the amplifier, there's a weird crack of sound when things go wrong.

I also don't really understand why there are 16 and 32 bit files, everything is encoded using lame with the same settings. As you can see in the logs, I'm playing 2 songs from Joe Satriani which are on the same album and thus encoded in the same run. So it's weird they aren't in the same format. At least to me.

Nonetheless, I'll be back with more info.

comment:7 Changed 10 years ago by Sander Knopper <sander@…>

Another note, there are 3 lines in the log of the form: "Original codec..................."

All three of them read "signed 16 bit". The only difference is the sample rate, but output is forced at 48kHz.

comment:8 Changed 10 years ago by Sander Knopper

Did some more testing today. I put 2 tracks in the playlist which are equal in terms of audio format. Both lame encoded, 2 channels, 44.1kHZ.

I've tried with sampe rate conversion set to the default and "best". Made no difference.

When I turn off and on the amplifier the music is there again. So mythmusic must be thinking everything is peachy while my amplifier surely isn't thinking that.

But again, when I play those same 2 files with mpd, there's no problem at all.

comment:9 Changed 10 years ago by Sander Knopper

I just tried something else to determine whether this problem just occurs in MythMusic or maybe somewhere else too.

Turns out that there's a (minor) glitch in MythVideo? as well. When a video is started that has audio in a different format than the previous movie, the movie needs to get started twice before sound works.

comment:10 Changed 10 years ago by JYA

You are forcing 48kHz resampling, so all audio is converted to 32 bits first, resampled. As the audio device supports 32 bits, there is no need to reformat back to 16 bits.

Why are you forcing resampling to 48kHz to start with ?

That turning your amp off then on make the audio comes back to live; indicates that some of the issues (not all, this doesn't explain the buffer underruns) are with your amplifier.

If the issue is mishandling of 32 bits audio by your amp, you will reduce the issue by not forcing the resampling to 48kHz as the audio will stay 16 bits all the way

comment:11 Changed 10 years ago by Sander Knopper <sander@…>

I'm basically resampling to 48Khz because I have a lot of music which is ripped of DVD (live concerts) and when moving from a track that's samled at 44.1kHz to one of the tracks that's sampled at 48kHz there's a very annoying high pitched crack. Given the fact that these kind of transitions (like I described or vice versa) happen quite frequently, this isn't very pleasant.

I'll try to disable the resampling for a while though and see if it makes any difference.

comment:12 Changed 10 years ago by Sander Knopper <sander@…>

I've disabled forced resampling and did some testing today.

When only playing music sampled at 44.1kHz the problem still occurs, but less frequent. At the moment it switches to a song sampled at 48kHz most of the time I hear this high pitched sound again and music isn't hearable anymore. Turning the amplifier off/on still solves it.

comment:13 Changed 10 years ago by JYA

Maybe a fix would be to get an amp that doesn't require rebooting ?

comment:14 Changed 10 years ago by Sander Knopper

Yes, I guess that would probably fix it.

The strange thing is though, that when I force output at 48kHz within mpd everything works fine.

comment:15 Changed 10 years ago by paulh

Component: Plugin - MythMusicMythTV - Audio Output
Owner: changed from paulh to JYA
Status: infoneededassigned

This is more of an audio problem than a MythMusic one so re-assigning to jyavenard to decide if there is anything we can do in Myth to prevent the audio drop outs.

comment:16 Changed 10 years ago by JYA

Resolution: Works for me
Status: assignedclosed

If restarting the amplifier prevents the problem to occur, the issue is more than likely with the amplifier bugging out.

Can't reproduce it

Note: See TracTickets for help on using tickets.