Posts by hollol

    Hi Hias,

    I just want to report my latest findings here and let you know that my system (latest LE version) is running ok again. That actually means, that I have no issues with MPD, ALSA and I2S anymore.

    By try and error I finally figured out, that all the problems described above were caused by another plugin, namely "Hyperion".

    Starting the the Hyperion daemon with the following pwm device configuration is giving me problems with ALSA/I2S:

    It seems the usage of the RPI pwm (channel 0, GPIO12) is somehow interfering (at least from time to time) with the I2S interface.

    As written in the start post, this problem actually started from LE 8.0.2 and was working nicely in the same configuration in previous versions.

    Best, Lars

    Hi Hias,

    in the meantime I tried to do some further investigations. Unfortunately, it is (even for me) not easy to trigger the problem intentionally.

    From now on I will only use aplay and/or speaker-test for further testing because the problem also appears with both of them and really seems not to be related to mpd.

    Latest findings:

    • The problem appears irregular. Maybe around 2 out of 5 times playing exactly the same short 10s wave file.
    • There are 3 possible cases:
      • Wave file is playing normally as it should
      • Wave file is partly playing: Aplay is starting playback, sound is ok, but then suddenly during playback the sound output stops, aplay hangs and has to be killed.
      • Wave file not playing at all: Aplay is only printing the file information like channels, bit rate and so on and then stuck until it is killed
    • Actually it seems to be random and I cant figure out, what triggers the problem
    • Even directly playing to the hardware device: aplay -D "hw:0.1" sample.wav (so bypassing any alsa configuration) shows the same result

    I recently used strace to trace the aplay command when playback is working normally (strace-working) and when it stops during playback (strace-notworking). From this information it seems, that when playback hangs, it hangs on a poll for fd=4 which actually is the pcm-file:

    Output hanging:

    Code
    ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0xf96498) = 0
    poll([{fd=4, events=POLLOUT|POLLERR|POLLNVAL}], 1, -1) = ?

    Output working normally:

    Code
    ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x29a498) = 0
    poll([{fd=4, events=POLLOUT|POLLERR|POLLNVAL}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}])
    ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x29a498) = 0

    where fd=4 is /dev/snd/pcmC0D0p, which actually is my DAC.

    Code
    open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK|O_CLOEXEC) = 4

    I don't know, if this information is helpful for tracking the problem, but I hope it is ;)

    Thanks, Lars

    Hi Hias,

    thanks that you are looking into my problem.

    Actually I have no real Hifiberry, but a compatible DAC card. This is my card: pHAT DAC. It is actually not using the system clock from the Pi, but generating it by itself from the other signals (froom PCM5102 datasheet: "Integrated High-Performance Audio PLL With BCK Reference To Generate SCK Internally". So only 3 wires and not 4 are connected to the Pi (BCK, LRCK and DIN). Could that be a possible origin of the error?

    Maybe to mention again. I think the problem is not related to MPD, since also a aplay command produces the error.

    Unfortunately, I am on a business trip in Japan this week, but I will do the suggested tests and report the results here beginning of next week.

    Thanks again,

    Lars

    Sorry, for this very late reply. I have been away for some time with no chance to do further test.

    But now, I have tried several things which I want to report here:

    1) The problem still exists even with the latest beta release. I tried all versions starting from 8.0.0 to 8.1.1 and the last version, where my setup is running without problems is 8.0.1

    2) The problem seems to be more generally related to ALSA and/or I2S and not related to MPD

    That is based on the observation, that even aplay is not able to "always" play via the I2S soundcard. I write "always", because the strange thing I observe is, that sometimes the audio file is played fine, sometimes the file starts playing and then suddenly hangs and sometimes there is no sound output at all. In both of the last cases, I have to kill aplay, because it also hangs. So it seems, that something is blocking either the alsa system or the i2s output sometimes.

    3) I also tried with asound.conf (and therefore softvol) removed. Beside the fact, that the sound is extremely loud in this case ;) the behavior is absolutely the same.

    4) And here is the output of dmesg when sound is failing 8.0.2 (sound failing) and when sound is working 8.0.1 (sound working)

    5) My I2S soundcard is using the PCM5102 chip which is able to generate the clock by itself. This is also the mode I am using it right now.


    Hope this helps to find the problem. If you need further info or test, just ask.

    Thanks for your efforts,

    Lars

    Hello,

    the update to LE 8.0.2 somehow has broken MPD playback via ALSA output on my RPI2.

    I am using a hifiberry dac and a custom asound.conf file to enable volume control (by alsa softvol plugin) for my soundcard.

    After system start/reboot MPD is starting without problems and is accessible via any mpd client. But immediately when I start any playback via ALSA output, MPD completely hangs and is not responding anymore. Unfortunately, the MPD log (even with verbose options) does not give any error message or hint to the problem.

    This only happens, when ALSA is selected as output. If I select e.g. the the null output instead, MPD behaves completely normal (without sound output indeed).

    The above problem only appears since LE 8.0.2. When I downgrade to LE 8.0.1 or any previous version, MPD and/or ALSA is working without problems in my configuration.

    Has there been any change in the ALSA system and/or other parts related to audio between LE 8.0.1 and 8.0.2 causing this problem? What kind of additional information can I deliver in order to solve this problem?

    Thanks, Lars

    Hello,
    I want to run Hyperion from my RPI2/LE system and I am somehow confused, what actually the best installation method is:

    1) Use the LE Hyperion addon
    -->most probably recommended by the LE team, right?

    2) Use the SSH installation procedure via hypercon
    --> This is actually recommended by the Hyperion team for LE (quote from webpage: "Please take notice: We don´t use the LibreELEC Hyperion addon, please disable/remove it."

    Now, I am wondering, what is the best method with respect to updates both of Le and Hyperion.

    Thanks for the help,
    Lars

    Reading this thread an old idea, which I actually put on hold some time ago, came back into my mind.
    During this time I planned to "harden" my VPN connection, that means block any traffic that is not going through the vpn tunnel (especially in case the vpn tunnel is disconnected unintentionally).

    My wish was, to set up iptables rules with starting the vpn connection by VPNmanager and flush these rules only when the vpn is disconnected (intentionally) by VPNmanager.
    In this case the real IP would never be exposed, even if the vpn tunnel gets lost by whatever reason.

    zomboided: Do you think, such kind of "general" iptables rules thing would make sense and could be integrated into your great addon?

    Best regards,
    Lars

    Could be a solution/workaround. I will try this evening ...

    But nonetheless, why the alsa sound.conf file (which also contains other alsa settings like e.g. standard start volume) is missing/has been removed.

    By the way ... does somebody understand the error message. For me it seems, that this is (not only) related to the missing sound.conf. file.

    Thanks for you help

    I am testing the LE8 alpha build on my RPI2 and so far all is working as expected. Thanks for that great work!
    In my setup I am using KODI and MPD (as plugin) together in that way, that audio from KODI is played via HDMI and audio from mpd is played via the analog audio out.
    In OE i configured alsa the following way:

    Code
    amixer cset numid=3 1
    alsactl -f /storage/.config/sound.conf store

    So far the first command is working as expected and mpd sound is played via analog out. Unfortunately, the second command which then should save the actual alsa configuration gives an error message. I figured out, that actually the configuration file "sound.conf" is not existing in the given directory.

    So how do I change and especially store my ALSA configuration in LE (8)?

    Thanks for your help and keep on with your great work

    I am not absolutely sure, but after reading this thread it might be possible, that I am experiencing the same problem.

    I am using the gpio-poweroff overlay to cut my Pi from power after shutdown. Yesterday, when testing LE 7.0.0 (fredh install) I was very happy to see, that it was working. Unfortunately, it was only working for the first (and maybe the second) shutdown, nut then stopped working.

    I havent checked, if the overlay folder is corrupted or missing, because I havent really thought of that. I will check this evening and report.


    *******Update*******

    So I checked my sd card after 2 times booting and correctly shutting down the Pi and finally ended up with the same damaged file structure on the fat partition:

    Interestingly, this does not happen with the latest Millhouse builds of LE using the same sd card and somehow even after restarting several more times only the overlay folder is damaged. All other files on the fat partition are still ok, so that LE boots up with no problem.

    Hope, this can be solved ...