This was done in my own HP envy and this process works on all HP laptops containing beats audio.
Install hda-jack-retask from https://launchpad.net/~diwic/+archive/hda . Download this small application according to your version of Ubuntu. After the completion of download, install the app.
After the app is installed, go to the terminal and type hda-jack-retask which opens the file. Open app using terminal
At the top, in codec section, select IDT 92HD91BXX codec.
This code varies with various models. Check it
Check the “ Show unconnected pins” at the right side.
After this, you will see different types of unconnected pins of your sound driver. You have to map these pins to the right part of the beats audio drive. Care must be taken at this point.
You can see there are various types of pins. We are not aware about these things. Even I don’t know
what I am doing and is confusing. BUT do not worry at all.
You just have to play on three pins. They are 0x0d , 0x0f and 0×10.
Go to the section having pin id : 0x0d .
Change (Internal Speaker, Front side) to “Internal speaker”.
Go to the section having pin id: 0x0f.
Change (Not connected) to “Internal speaker”. This part is about the under-display speakers.
Go to the section having pin id: 0×10.
Change (Not connected) to “Internal speaker (LFE)”. This part is about the sub-woofer.
You are finally done with those pin settings. Apply it now. You can test with some sound. Check whether all the speakers are producing desired sound. The settings must be done as in following picture.
Do as it is
If everything is all right, install boot override from the bottom right side and restart your device.
Finally you must have sound with beats audio. Enjoy the sound and music. Also plug in the headphones, it must disable the external sound when the headphone is plugged in.
you can visit here for more information. http://www.chromeearth.com/enable-beats-audio-in-ubuntu/