Firefly Open Source Community

   Login   |   Register   |
New_Topic
Print Previous Topic Next Topic

Select audio output on Android 5.1

410

Credits

0

Prestige

0

Contribution

intermediate

Rank: 3Rank: 3

Credits
410

Select audio output on Android 5.1

Posted at 3/9/2018 23:33:21      View:3354 | Replies:3        Print      Only Author   [Copy Link] 1#
On the fireprime with android 5.1, when I play music or video file, the audio stream goes through both hdmi and headphone jack.

Is there a way to programmatically mute one of them ?

Reply

Use props Report

792

Credits

10

Prestige

10

Contribution

advanced

Rank: 4

Credits
792
Posted at 3/15/2018 19:33:11        Only Author  2#
hardware/rockchip/audio/tinyalsa_hal/audio_hw.c
start_output_stream()  
control the sound card open or not in this interface
Reply

Use props Report

410

Credits

0

Prestige

0

Contribution

intermediate

Rank: 3Rank: 3

Credits
410
Posted at 5/14/2018 17:57:27        Only Author  3#
Hi,

Thanks for your reply ! I had a look on this file but I don't really know what to do with it as I want to control my audio output from my android app.
I tried this method => https://stackoverflow.com/questi ... force-audio-routing with all the "DEVICE_OUT_" variables I have found but it does nothing.

Can you tell me more on this audio_hw.c file and what to do with it in order to control audio output from my app ?
Reply

Use props Report

410

Credits

0

Prestige

0

Contribution

intermediate

Rank: 3Rank: 3

Credits
410
Posted at 5/14/2018 23:04:01        Only Author  4#
It's ok for me now : I just had to comment "out->device = 0x400;" line 412 and "out->device = 0x8;" line 434.
Then using the methode found on stackoverflow (link above) with DEVICE_OUT_AUX_DIGITAL controlling HDMI audio and DEVICE_OUT_WIRED_HEADPHONE the headphone jack output, it works !

Thanks for your help, leung先森
Reply

Use props Report

You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list