Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problem: Multichannel audio issue
#11
Bump

Someone with a test file should post an issue to raspberrypi/linux
https://github.com/raspberrypi/linux/issues?q=
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#12
Tim, the test file I included in a link a couple of messages before, did it work for you? For me it was totally messed up too.
Reply
#13
(06-08-2024, 08:13 AM)jcucurull Wrote: Tim, the test file I included in a link a couple of messages before, did it work for you? For me it was totally messed up too.

Can you describe the actual channel mapping you experienced?
I mean, they can appear totally messed up, while in reality it can be just offset by one channel. And this can help (eventually) address the issue more surgically.
Reply
#14
(06-08-2024, 08:13 AM)jcucurull Wrote: Tim, the test file I included in a link a couple of messages before, did it work for you? For me it was totally messed up too.

I'll try to test in the coming days but if its failing in your test it won't really matter what my result is because channel mapping happens somewhere in software layers that only the Pi Linux devs can analyze. They need to see an issue posted with test files and details about the config used to play the file.

Ideally the playback config should be one that they can easily create for example:

- Fresh RaspiOS Lite
- MPD
- /etc/mpd.conf that specifies outputting to ALSA using plughw: or hw:

The easier you make it for devs the higher the likelyhood they will act on the issue and come up with a solution. 

If I had the time I'd whip something up but my plate is already overflowing :-0
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#15
(06-08-2024, 08:47 AM)Nutul Wrote:
(06-08-2024, 08:13 AM)jcucurull Wrote: Tim, the test file I included in a link a couple of messages before, did it work for you? For me it was totally messed up too.

Can you describe the actual channel mapping you experienced?
I mean, they can appear totally messed up, while in reality it can be just offset by one channel. And this can help (eventually) address the issue more surgically.

The mapping I experience is the following one (left column real speakers, right column channel heard):

Front left: Front left
Front right: Front right
Rear left: Front center
Rear right: LFE
Center: Rear right
LFE: No sound (maybe just inaudible)
Reply
#16
It is interesting because if I reproduce the test file from the command line:

flac -c -d surround51.flac | aplay

I got switched up only the center channel with the LFE.

So it seems that depending on the application I use to reproduce the file, the channel mapping changes.

Edited: If I convert the FLAC to WAV with the first part of the command line shown, then the result of reproducing the same WAV file using Moode (MPD) or Aplay has different channel assignments. Which means that the channel messing occurs after decoding the FLAC.

Edited 2: Looking into the post shown later it seems that the channel order can be changed at the level of ALSA, thus when I have some time I will try to see if this might help: https://ubuntuforums.org/showthread.php?...st11622383

Edited 3: If I specify the correct channel mapping using the Aplay command line tool, I can reproduce the test file as well as the initial Pink Floyd file flawlessly:

# flac -c -d surround51.flac | aplay -m FL,FR,FC,LFE,RL,RR

I am also surprised that if I run the "speaker-test -c 6 -t wav" command, without specifying the channel order, it works fine out of the box, i.e. everything on the speaker it is supposed to. To me this means that ALSA is correctly configured because the mapping between ALSA channels and speakers is correct.
Reply
#17
Just mentioning that I have opened and issue in the MPD project explaining the tests done because to me it seems the issue is in MPD:

https://github.com/MusicPlayerDaemon/MPD...sions/2060
Reply
#18
As explained in the MPD forum (https://github.com/MusicPlayerDaemon/MPD...nt-9844112), it seems I have managed to solve the issue doing a workaround. I have applied a remaping at the level of ALSA. To be more specific, I have created a custom device that is a plugin that remaps the channels including this in "/etc/asound.conf":


Code:
pcm.!hdmi-remap {
  type plug
  slave.pcm "_audioout"
  ttable {
       0.0= 1
       1.1= 1
       2.4= 1
       3.5= 1
       4.3= 1
       5.2= 1
       6.6= 1
       7.7= 1
  }
}

Then I have modified the "mpd.conf" to use the "hdmi-remap" device instead of the "_audioout" that is usually used.

My only question is how to make that after rebooting the system the "mpd.conf" file is not overwritten or, if it is regenerated, how to include the assign the newly created device. Otherwise I cannot do the changes permanent. Any suggestion @Tim Curtis ?

Also, I would like to note that this solution is not a final one, because it is tailored to my specific system or at least to the systems using HDMI as output for multichannel audio. MPD should be passing the channel mapping information to ALSA using the Channel Order API of the alsa library (https://www.alsa-project.org/alsa-doc/al...1b73839085), and it is not currently doing it. As requested in the MPD forum I will create a Feature request so they can implement this feature in the future.
Reply
#19
There is a post detailing how to make changes permanent.
https://moodeaudio.org/forum/showthread....3#pid47753
----------
bob
Reply
#20
(06-21-2024, 10:22 PM)jcucurull Wrote: As explained in the MPD forum (https://github.com/MusicPlayerDaemon/MPD...nt-9844112), it seems I have managed to solve the issue doing a workaround. I have applied a remaping at the level of ALSA. To be more specific, I have created a custom device that is a plugin that remaps the channels including this in "/etc/asound.conf":


Code:
pcm.!hdmi-remap {
  type plug
  slave.pcm "_audioout"
  ttable {
       0.0= 1
       1.1= 1
       2.4= 1
       3.5= 1
       4.3= 1
       5.2= 1
       6.6= 1
       7.7= 1
  }
}

Then I have modified the "mpd.conf" to use the "hdmi-remap" device instead of the "_audioout" that is usually used.

My only question is how to make that after rebooting the system the "mpd.conf" file is not overwritten or, if it is regenerated, how to include the assign the newly created device. Otherwise I cannot do the changes permanent. Any suggestion @Tim Curtis ?

Also, I would like to note that this solution is not a final one, because it is tailored to my specific system or at least to the systems using HDMI as output for multichannel audio. MPD should be passing the channel mapping information to ALSA using the Channel Order API of the alsa library (https://www.alsa-project.org/alsa-doc/al...1b73839085), and it is not currently doing it. As requested in the MPD forum I will create a Feature request so they can implement this feature in the future.

Fantastic :-)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: