-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDL Mixer multi-channel MixEffect Callback not working when copying data to the Side Channels in 7.1 (8 channels) #663
Comments
… Moving audio to side channel does not work. Filed issue with mixer folks: libsdl-org/SDL_mixer#663
We can close this... I figured it out. Again it was another Pulse Audio setting:
So in the end to get all this work I needed this entry in my daemon.conf file:
|
I spoke to soon. After trying different tables in my application it still won't output to the side channels. I need to have these option for sure in my daemon.conf
When this is set the front channel stays on the front, but the other sounds like in my code example above only sound on the rear while the side channels are silent. My running pulseaudio.conf from
from
I also have all channels producing audio correctly with
So now for sure I've exhausted everything I know. Would appreciate any input of this. Thanks |
Can you add debug code to SDL in the pulseaudio driver to validate the data going to Pulseaudio? |
Not sure what you mean by that. I do hear sound... Just not out the side channel. |
I mean add code to dump the raw values in each channel so you can confirm that SDL is sending the data you expect. |
You mean the output in my code snippet above that display the change to sample of it runs? A sample:
it's all looks good at that point. |
Yes, but in SDL/src/audio/pulseaudio/SDL_pulseaudio.c, say in PULSEAUDIO_PlayDevice() |
Ok.. Let me see if I can do that. |
Alright I put this code into pulseaudio.cpp:
Then I got this output for a sound:
in hex:
This is my first time working with audio so I'm not sure what I'm looking for. My guess is that's 8bit PCM stream? Not sure how the channels line up though. My output stream is 16bit signed(SDL_AUDIO_S16LE). |
Using the HINTS var |
I wanted to give an update on this. I was able to load the "disk" file I captured above into Audacity importing it in as S16LE with 8 channels. The channel layout was exactly the way I encoded it in mixer and it played just fine. So it must be something within Pulse Audio or the mixer interfaces to it. |
Hi everyone!
I've been using the mixer for project where I need to manually control what speakers certain mixChunk's go to. My output device settings per the AudioSpec is "
Output Device Settings: Freq: 48000 Format (SDL_AudioFormat): 32784(SDL_AUDIO_S16LE) channels: 8
". I'm on on Ubuntu using Pulse Audio directly, e.g. no Pipewire. By default if your playing audio file with less channels then your output channels Pulse with automatically remix those channels onto the ones you have. This is covered with these two options (specify in your daemon config file):Since I want to control all the channels when in 8 channel mode I need to specify
remixing-use-all-sink-channels = no
or else I get anything on the front channels bleeding back at lower volume on the side channels. Not the rear though....For simplicity sake lets say I have one MixChunk that I only want to play on the Side and Rear channels. Its a wav file and its either stereo or a mono the sample that only has data on FL, FR channels. I need to copy those to the side and rear channels, and when that's done I wipe the FL,FR. To accomplish this I have the following in a MixEffect Callback:
But this doesn't work. While I see the data after its all done on the right channels, the side channels have no audio. The rear has audio and the front is silent as it should be. But nothing on the side channels.
I did as much as could to try to figure this out and didn't come up with answer. If I had to take a guess I think its something in mixer when it mixes all the chunks together its dropping or not including the side channels in the final output. Not sure if this related at all to any of positional stuff that only supports up to 5.1. But I'm on 7.1, 8 channels.
And just for coverage to see if it was just the side channels I changed it copy to the center and lfe channel and it worked. So its something with the side channel.
Thanks!
The text was updated successfully, but these errors were encountered: