rsjudka / intelligent-auto

41 stars 15 forks source link

Audio Issues #19

Closed yoriaantje-dev closed 4 years ago

yoriaantje-dev commented 4 years ago

Audio Issues

When using USB to connect, everything seems to work just fine. However, upon starting to play any form of audio, AndroidAuto seems to either freeze or crash and shortly after that it says I need to connect my device to get started.

Playing with settings such as RtAudio and selecting or deselecting Audio Channels doesn't seem to make much of a difference for this issue, regardless of what combination I try to use, regardless for if I restart intelligent-auto all together.

All the above listed testing was done on the development version cloned on 25-3-20.

Will be running the same set of tests on the master version, which I will clone today (26-3-20).

Hardware Used:

yoriaantje-dev commented 4 years ago

If you can, try to play around with the OpenAuto settings, maybe you'll get better results with a different audio backend? Another thing you might want to look into is the PulseAudio/Alsa configuration, I remember reading somewhere that the packets are small or something and it causes audio to glitch up. Then when you open the new issue, we'll have alot more to talk about :p Originally posted by @rsjudka in https://github.com/rsjudka/intelligent-auto/issues/6#issuecomment-604186158

Thanks, I'll get on that this afternoon. Gonna let you know what I run into with Googling.

For now, using BT to play audio seems to work, apart from the fact that the BT Audio is very choppy at best. I'm first going to look into why that happens, as it may be the explanation for both the issues.

I will also be reimaging my RPi 3B+ and using a faster and bigger SD Card.

icecube45 commented 4 years ago

What version of openauto / aasdk are you running?

robert5974 commented 4 years ago

@rsjudka I rebuilt your dash application using @icecube45 aasdk. It seems to be working fine now. I let it play for a while last night without issue.

yoriaantje-dev commented 4 years ago

What version of openauto / aasdk are you running?

Im running the one that @rsjudka has included as a submodule (and then the dev branches, i just select them if they aren't yet selected)

I managed to get BT Audio working with external adapter, so that's that. Turns out that the RPi just has shitty BT Audio...

@rsjudka I rebuilt your dash application using @icecube45 aasdk. It seems to be working fine now. I let it play for a while last night without issue.

I'll give this a shot aswell.

rsjudka commented 4 years ago

@yoriaantje-dev you might want to try this too (pulled this from the old OpenAuto Wiki)

AndroidAuto's audio packets are delivered in very small chunks. Due this adjustments of PulseAudio configuration might be needed to avoid audio glitches.

Add/override below lines in /etc/pulse/daemon.conf

resample-method = ffmpeg

In /etc/pulse/default.pa add tsched=0 on the line of 'load-module module-udev-detect'

load-module module-udev-detect tsched=0

After config changes you must restart your pulseaudio instance. You can do it by execution of pulseaudio -k command.

yoriaantje-dev commented 4 years ago

@yoriaantje-dev you might want to try this too (pulled this from the old OpenAuto Wiki)

AndroidAuto's audio packets are delivered in very small chunks. Due this adjustments of PulseAudio configuration might be needed to avoid audio glitches. Add/override below lines in /etc/pulse/daemon.conf resample-method = ffmpeg In /etc/pulse/default.pa add tsched=0 on the line of 'load-module module-udev-detect' load-module module-udev-detect tsched=0 After config changes you must restart your pulseaudio instance. You can do it by execution of pulseaudio -k command.

Thanks for the help, I'll try this one out.

For now, building with @icecube45 aasdk has solved the issue.

@rsjudka I rebuilt your dash application using @icecube45 aasdk. It seems to be working fine now. I let it play for a while last night without issue.

I need to rebuild with the new development features/branch anyways, so that's fine. I'll try the new method and let you know. I'm closing this issue and I'll open a new one to let you know!

robert5974 commented 4 years ago

I've built with the develop branch and it's great! I can without a doubt say that the wifi connection for AA works great and I really like the double tap to fullscreen. The audio slider doesn't seem to affect the volume level though. It only mutes the audio when all the way down the slider. @rsjudka did you say you used amixer commands for the slider?

rsjudka commented 4 years ago

Yeah I've actually been working on that now, its been a lot learning all about alsa/pulseaudio and their various APIs so its taking a bit longer than I would have hoped lol

In the meantime, if you were to look here you can change that command to match the audio setup you're using. If you're using pulseaudio, you might be able to do amixer -D pulse set Master ... but it really depends on how you set things up.

robert5974 commented 4 years ago

I'll experiment. I use the AudioInjector sound card for Rpi 3b+. I'm pretty sure it uses alsa mixer but I'll investigate that a bit. Thanks.

robert5974 commented 4 years ago

I actually found out that my sound card doesn't allow for software control of Line out Audio. I found a differing opinion but they were wrong. The card has a headphone jack as well and if I use that then the commands work fine which meant the volume slider works as it should. At first I thought using "sset" instead of "set" was the key but no, it accepts both and there's really no difference.