You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the first time, that I'm testing a Up^2 board with a Hifiberry codec, so, it's possible, that I've done something wrong. Take this with a grain of salt. Still. Kernel topic/sof-dev as of today, HEAD at
commit cb70ef9e350bf06eae545c5a3e484e8d2dc2353e
Author: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Date: Thu Jan 31 15:22:34 2019 +0100
cmake: check rimage dependecies
Topology used: sof-apl-src-pcm512x.tplg. When playing audio either with aplay or using the Ubuntu audio settings application, audio is torn, or maybe better described as echoed.
Another problem was, that some mixers, specifically xmix and aumix were reporting memory allocation failures. strace showed the MIXER_READ ioctl returning with errno = ENOMEM. Attached kernel messages from front-left and front-right playback tests.
Topology used: sof-apl-src-pcm512x.tplg. When playing audio either
with aplay or using the Ubuntu audio settings application, audio is
torn, or maybe better described as echoed.
Another problem was, that some mixers, specifically xmix and aumix
were reporting memory allocation failures. strace showed the
MIXER_READ ioctl returning with errno = ENOMEM. Attached kernel
messages from front-left and front-right playback tests.
Try first the topology without the SRC, it works fine for me and Ranjani.
and I'm not getting any audio playback. But maybe because of a different topology I have to select a different device to play? Because with that topology there are more devices created, e.g. aplay -l produces
Thanks to @singalsu for a tip - I removed pulseaudio and now the sound isn't corrupted any more. But also to even have the card recognised I have to run a mixer once, which seems to set some (default) configuration, which then makes aplay and co. to work properly. Maybe that's what @ranj063 meant in the above post, but I'm not sure what exactly that means - could you explain? Are there instructions online? I haven't found any in https://thesofproject.github.io/latest/getting_started/setup/setup_up_2_board.html
Humm, removing PulseAudio is not an acceptable fix, it's just a way to
hide a problem in general... Typically this means the position pointer
reported by the firmware is incorrect (which wouldn't be surprising if
you have SRC in your pipeline).
@plbossart so this issue should be renamed to something like "pulseaudio broken on Up^2?" Not sure about your comment above - it is bad but that isn't the reason for this problem anyway? And we don't have a fix for it yet?
@lyakh my point was that the driver is told to operate in no_irq mode with the no_period_wakeup setting, but if this debug option is set we override the settings and will generate an interrupt on a period boundary userspace may not need/want. The real fix would be to remove support for no_period_wakeup, not override settings that were accepted in the userspace/driver negociation.
I'm able to reproduce this issue when I enabled SND_SOC_SOF_DEBUG_FORCE_IPC_POSITION with current latest build. It looks to me PCM position update has some problems. I will debug a bit more, I will share my proposal soon.
There was some confusion in this CR description, I'm re-writing CR description.
The issue only happens with the debug feature, SND_SOC_SOF_DEBUG_FORCE_IPC_POSITION. And even after enabling this feature, aplay is always fine. The issue can be reproduced only with Ubuntu Music App(Rhythmbox). I think any Music app something to do with PulseAudio has same issue. Again, the build with default defconfig has no issue with aplay or any player.
Interesting part was even the build with SND_SOC_SOF_DEBUG_FORCE_IPC_POSITION flag, the issue will be come if pulseaudio(/usr/bin/) is removed. Without deep knowledge of pulseaudio, I guess, PulseAudio relies on timer-based scheduling. Without pulseaudio deamon the Music Player switches to best effort mode, not relying on internal scheduling.
The fix I'm proposing is simple. This debugging feature is not implemented completely. If SND_SOC_SOF_DEBUG_FORCE_IPC_POSITION is enabled, it must provide IPC POSITION callback from IPC context.
ipc_msgs_rx() -> ipc_stream_message() -> ipc_period_elapsed() -> snd_pcm_period_elapsed()
I will submit the PR soon.
On side note, i tracked four variables interestingly,
Activity
lyakh commentedon Feb 1, 2019
fl.txt
fr.txt
plbossart commentedon Feb 1, 2019
lyakh commentedon Feb 2, 2019
With that topology SOF doesn't initialise for me at all, I'm getting repeated
and I'm not getting any audio playback. But maybe because of a different topology I have to select a different device to play? Because with that topology there are more devices created, e.g. aplay -l produces
ranj063 commentedon Feb 2, 2019
@lyakh have you set the amixer settings properly?
you need to set Pin5-Port0/1/2, to cvt 2
Pin6 -Port0/1/2 to cvt 3
Pin7-Port0/1/2 to cvt 4
and then try
aplay -Dhw:0,2 test.wav
lyakh commentedon Feb 4, 2019
Thanks to @singalsu for a tip - I removed pulseaudio and now the sound isn't corrupted any more. But also to even have the card recognised I have to run a mixer once, which seems to set some (default) configuration, which then makes aplay and co. to work properly. Maybe that's what @ranj063 meant in the above post, but I'm not sure what exactly that means - could you explain? Are there instructions online? I haven't found any in https://thesofproject.github.io/latest/getting_started/setup/setup_up_2_board.html
plbossart commentedon Feb 4, 2019
ranj063 commentedon Feb 4, 2019
@plbossart in the case of src should CONFIG_SND_SOC_SOF_DEBUG_FORCE_IPC_POSITION be set because we're using the no_irq mode by default
plbossart commentedon Feb 4, 2019
Oh wow, this is bad. It's not a debug option, it just overrides the stream settings:
sound/soc/sof/intel/hda-stream.c:
Not to mention that double-negations are a sure way to lose everyone. !no_ipc_position should be ipc_position. Gah.
lyakh commentedon Feb 8, 2019
@plbossart so this issue should be renamed to something like "pulseaudio broken on Up^2?" Not sure about your comment above - it is bad but that isn't the reason for this problem anyway? And we don't have a fix for it yet?
plbossart commentedon Feb 13, 2019
@lyakh my point was that the driver is told to operate in no_irq mode with the no_period_wakeup setting, but if this debug option is set we override the settings and will generate an interrupt on a period boundary userspace may not need/want. The real fix would be to remove support for no_period_wakeup, not override settings that were accepted in the userspace/driver negociation.
fredoh9 commentedon Mar 5, 2019
I'm able to reproduce this issue when I enabled SND_SOC_SOF_DEBUG_FORCE_IPC_POSITION with current latest build. It looks to me PCM position update has some problems. I will debug a bit more, I will share my proposal soon.
fredoh9 commentedon Mar 14, 2019
There was some confusion in this CR description, I'm re-writing CR description.
The issue only happens with the debug feature, SND_SOC_SOF_DEBUG_FORCE_IPC_POSITION. And even after enabling this feature, aplay is always fine. The issue can be reproduced only with Ubuntu Music App(Rhythmbox). I think any Music app something to do with PulseAudio has same issue. Again, the build with default defconfig has no issue with aplay or any player.
Interesting part was even the build with SND_SOC_SOF_DEBUG_FORCE_IPC_POSITION flag, the issue will be come if pulseaudio(/usr/bin/) is removed. Without deep knowledge of pulseaudio, I guess, PulseAudio relies on timer-based scheduling. Without pulseaudio deamon the Music Player switches to best effort mode, not relying on internal scheduling.
The fix I'm proposing is simple. This debugging feature is not implemented completely. If SND_SOC_SOF_DEBUG_FORCE_IPC_POSITION is enabled, it must provide IPC POSITION callback from IPC context.
ipc_msgs_rx() -> ipc_stream_message() -> ipc_period_elapsed() -> snd_pcm_period_elapsed()
I will submit the PR soon.
On side note, i tracked four variables interestingly,
lyakh commentedon Mar 15, 2019
@fredoh9 FWIW I initially noticed those problems with aplay.
fredoh9 commentedon Mar 15, 2019
@lyakh really? i tested with your build also(after checking out both HEAD), I couldn't reproduce this with aplay.
fredoh9 commentedon Apr 11, 2019
the PR #721 moved to [DO NOT MERGE] for now. This will be handled in bigger scope. More details are in the PR thread.
plbossart commentedon Jan 17, 2020
@lyakh I guess we can close this issue?
lyakh commentedon Jan 17, 2020
@plbossart it's old so, perhaps, yes, although I haven't tested SRC with pulseaudio on Up^2 in ages
plbossart commentedon Jan 17, 2020
ok let's close and re-open if we see something bad
ip_tunnel: fix use-after-free in ip_tunnel_lookup()
hsr: avoid to create proc file after unregister